Skip to content

Commit 3df6cb8

Browse files
committed
Merge branch 'ca/ui_upgrade_pr277'
2 parents 753a79a + 8332b6c commit 3df6cb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+907
-886
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
* Implement feature #129 Let tweet cards be True Dark as well (thanks TheHCJ)
2+
* Implement interface upgrade (thanks TheHCJ)
3+
- added: followers and following are now tappable on profiles
4+
- added: switches and appbar to feed settings
5+
- added: material 3 navigationBar
6+
- added: tweets bigger icons and bookmark button
7+
- added: material symbols
8+
- changed: locations picker bottom sheet
9+
- changed: import subscriptions bottom sheet
10+
- removed: followers and following tabs on profile page
11+
- removed: material 2 support
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
* Implement feature #129 Let tweet cards be True Dark as well (thanks TheHCJ)
2+
* Implement interface upgrade (thanks TheHCJ)
3+
- added: followers and following are now tappable on profiles
4+
- added: switches and appbar to feed settings
5+
- added: material 3 navigationBar
6+
- added: tweets bigger icons and bookmark button
7+
- added: material symbols
8+
- changed: locations picker bottom sheet
9+
- changed: import subscriptions bottom sheet
10+
- removed: followers and following tabs on profile page
11+
- removed: material 2 support

lib/client/client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class Twitter {
634634

635635
static Future<List<TrendLocation>> getTrendLocations() async {
636636
var result = await _cache.getOrCreateAsJSON('trends.locations', const Duration(days: 2), () async {
637-
var locations = await _twitterApi.trendsService.available();
637+
var locations = await _twitterApiAllowUnauthenticated.trendsService.available();
638638

639639
return jsonEncode(locations.map((e) => e.toJson()).toList());
640640
});

lib/client/client_account.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter_triple/flutter_triple.dart';
44
import 'package:http/http.dart' as http;
55
import 'package:intl/intl.dart';
66
import 'package:logging/logging.dart';
7+
import 'package:material_symbols_icons/symbols.dart';
78
import 'package:shared_preferences/shared_preferences.dart';
89
import 'package:squawker/client/app_http_client.dart';
910
import 'package:squawker/client/client_guest_account.dart';
@@ -320,7 +321,7 @@ class TwitterAccount {
320321
context: context,
321322
builder: (BuildContext context) {
322323
return AlertDialog(
323-
icon: const Icon(Icons.warning),
324+
icon: const Icon(Symbols.warning),
324325
title: Text(L10n.current.warning_regular_account_unauthenticated_access_title),
325326
titleTextStyle: TextStyle(fontSize: Theme.of(context).textTheme.titleMedium!.fontSize, color: Theme.of(context).textTheme.titleMedium!.color, fontWeight: FontWeight.bold),
326327
content: Wrap(

lib/constants.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const optionSubscriptionInitialTab = 'subscription.initial_tab';
3838

3939
const optionThemeMode = 'theme.mode';
4040
const optionThemeTrueBlack = 'theme.true_black';
41-
const optionThemeMaterial3 = 'theme.material3';
4241
const optionThemeColorScheme = 'theme.color_scheme';
4342

4443
const optionTweetsHideSensitive = 'tweets.hide_sensitive';
@@ -72,4 +71,3 @@ const routeSubscriptionsImport = '/subscriptions/import';
7271
const twitterAccountTypesPriorityToRegular = 'twitter_account_types_priority_to_regular';
7372
const twitterAccountTypesBoth = 'twitter_account_types_both';
7473
const twitterAccountTypesOnlyRegular = 'twitter_account_types_only_regular';
75-

lib/group/_feed.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ class SubscriptionGroupFeedState extends State<SubscriptionGroupFeed> with Widge
140140
_data.clear();
141141
}
142142

143+
void refresh() {
144+
setState(() {
145+
});
146+
}
147+
143148
Future<void> reloadData() async {
144149
await updateOffset();
145150
_resetData();

lib/group/_settings.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_triple/flutter_triple.dart';
3+
import 'package:material_symbols_icons/symbols.dart';
34
import 'package:squawker/database/entities.dart';
45
import 'package:squawker/generated/l10n.dart';
56
import 'package:squawker/group/group_model.dart';
@@ -21,14 +22,13 @@ void showFeedSettings(BuildContext context, GroupModel model) {
2122
),
2223
child: Column(
2324
children: [
24-
ListTile(
25+
AppBar(
2526
leading: IconButton(
26-
icon: const Icon(Icons.arrow_back_rounded),
27+
icon: const Icon(Symbols.arrow_back_rounded),
2728
onPressed: () {
2829
Navigator.of(context).pop();
2930
}),
3031
title: Text(L10n.of(context).filters),
31-
tileColor: theme.colorScheme.primary,
3232
),
3333
Container(
3434
alignment: Alignment.centerLeft,
@@ -44,21 +44,21 @@ void showFeedSettings(BuildContext context, GroupModel model) {
4444
onState: (_, state) {
4545
return Column(
4646
children: [
47-
CheckboxListTile(
47+
SwitchListTile(
4848
title: Text(
4949
L10n.of(context).include_replies,
5050
),
5151
value: model.state.includeReplies,
5252
onChanged: (value) async {
53-
await model.toggleSubscriptionGroupIncludeReplies(value ?? false);
53+
await model.toggleSubscriptionGroupIncludeReplies(value);
5454
}),
55-
CheckboxListTile(
55+
SwitchListTile(
5656
title: Text(
5757
L10n.of(context).include_retweets,
5858
),
5959
value: model.state.includeRetweets,
6060
onChanged: (value) async {
61-
await model.toggleSubscriptionGroupIncludeRetweets(value ?? false);
61+
await model.toggleSubscriptionGroupIncludeRetweets(value);
6262
}),
6363
],
6464
);

lib/group/group_model.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'dart:developer';
44
import 'package:flutter/material.dart';
55
import 'package:flutter_iconpicker_plus/flutter_iconpicker.dart';
66
import 'package:flutter_triple/flutter_triple.dart';
7+
import 'package:material_symbols_icons/symbols.dart';
78
import 'package:squawker/constants.dart';
89
import 'package:squawker/database/entities.dart';
910
import 'package:squawker/database/repository.dart';
@@ -24,7 +25,7 @@ IconData deserializeIconData(String iconData) {
2425
}
2526

2627
// Use this as a default;
27-
return Icons.rss_feed_rounded;
28+
return Symbols.rss_feed_rounded;
2829
}
2930

3031
class GroupModel extends Store<SubscriptionGroupGet> {

lib/group/group_screen.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_triple/flutter_triple.dart';
3+
import 'package:material_symbols_icons/symbols.dart';
34
import 'package:pref/pref.dart';
45
import 'package:provider/provider.dart';
56
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
@@ -172,15 +173,15 @@ class SubscriptionGroupScreen extends StatelessWidget {
172173
floating: true,
173174
title: Text(name),
174175
actions: [
175-
IconButton(icon: const Icon(Icons.more_vert), onPressed: () => showFeedSettings(context, model)),
176+
IconButton(icon: const Icon(Symbols.more_vert), onPressed: () => showFeedSettings(context, model)),
176177
IconButton(
177-
icon: const Icon(Icons.arrow_upward_rounded),
178+
icon: const Icon(Symbols.arrow_upward_rounded),
178179
onPressed: () async {
179180
await content.scrollController!.scrollTo(index: 0,
180-
duration: const Duration(seconds: 1), curve: Curves.easeInOut);
181+
duration: const Duration(seconds: 1), curve: Curves.easeInOut);
181182
}),
182183
IconButton(
183-
icon: const Icon(Icons.refresh_rounded),
184+
icon: const Icon(Symbols.refresh_rounded),
184185
onPressed: () async {
185186
GlobalKey<SubscriptionGroupFeedState>? sgfKey = DataService().map['feed_key_${id.replaceAll('-', '_')}'];
186187
if (sgfKey?.currentState != null) {

lib/home/_feed.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import 'package:flutter/material.dart';
2+
import 'package:squawker/group/_feed.dart';
23
import 'package:squawker/group/group_screen.dart';
34
import 'package:squawker/home/home_screen.dart';
45
import 'package:squawker/utils/data_service.dart';
56

7+
68
class FeedScreen extends StatefulWidget {
79
final ScrollController scrollController;
810
final String id;
@@ -16,14 +18,21 @@ class FeedScreen extends StatefulWidget {
1618

1719
class FeedScreenState extends State<FeedScreen> with AutomaticKeepAliveClientMixin<FeedScreen> {
1820

19-
Future<void> checkUpdateFeed() async {
21+
Future<void> checkUpdateOrRefreshFeed() async {
2022
if (DataService().map.containsKey('toggleKeepFeed')) {
2123
setState(() {
2224
DataService().map.remove('toggleKeepFeed');
2325
DataService().map['keepFeed'] = false;
2426
updateKeepAlive();
2527
});
2628
}
29+
if (DataService().map.containsKey('toggleRefreshFeed')) {
30+
DataService().map.remove('toggleRefreshFeed');
31+
GlobalKey<SubscriptionGroupFeedState>? sgfKey = DataService().map['feed_key_${widget.id.replaceAll('-', '_')}'];
32+
if (sgfKey?.currentState != null) {
33+
sgfKey!.currentState!.refresh();
34+
}
35+
}
2736
}
2837

2938
@override

0 commit comments

Comments
 (0)