Skip to content

Commit

Permalink
Upgrade to flutter 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodoering committed Feb 4, 2023
1 parent c480935 commit de7b1b9
Show file tree
Hide file tree
Showing 63 changed files with 628 additions and 424 deletions.
6 changes: 3 additions & 3 deletions lib/components/about/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class _SummaryCard extends ConsumerWidget {
leading: const Icon(Icons.history),
title: Text(
'version $version',
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
),
borderRadius: BorderRadius.only(
topLeft: theme.shape.radius,
Expand Down Expand Up @@ -163,7 +163,7 @@ class _DonationCard extends ConsumerWidget {
child: Text(
'if you like harpy, please consider supporting the '
'development with a donation',
style: theme.textTheme.subtitle2,
style: theme.textTheme.titleSmall,
),
),
RbyListTile(
Expand Down Expand Up @@ -218,7 +218,7 @@ class _ProCard extends ConsumerWidget {
const TextSpan(text: ' in the play store'),
],
),
style: theme.textTheme.subtitle2,
style: theme.textTheme.titleSmall,
),
),
RbyListTile(
Expand Down
1 change: 1 addition & 0 deletions lib/components/changelog/widget/changelog_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ChangelogDialog extends StatelessWidget {
await ref.read(currentChangelogProvider.future).handleError();

if (data != null) {
// ignore: use_build_context_synchronously
showDialog<void>(
context: ref.context,
builder: (_) => ChangelogDialog(data: data),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/changelog/widget/changelog_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ChangelogWidget extends StatelessWidget {
if (data.title != null) ...[
Text(
data.title!,
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
),
VerticalSpacer.normal,
],
Expand Down Expand Up @@ -61,7 +61,7 @@ class _ChangelogDate extends StatelessWidget {

return Text(
l10n.formatShortDate(date.toLocal()),
style: theme.textTheme.subtitle2,
style: theme.textTheme.titleSmall,
);
}
}
Expand Down
3 changes: 0 additions & 3 deletions lib/components/components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export 'home/home_page.dart';
export 'home/tab_configuration/model/default_home_tab_entries.dart';
export 'home/tab_configuration/model/home_tab_configuration.dart';
export 'home/tab_configuration/model/home_tab_entry.dart';
export 'home/tab_configuration/model/home_tab_entry.dart';
export 'home/tab_configuration/provider/home_tab_configuration_provider.dart';
export 'home/tab_configuration/widgets/home_tab_add_list_card.dart';
export 'home/tab_configuration/widgets/home_tab_customization.dart';
Expand Down Expand Up @@ -71,7 +70,6 @@ export 'pages/user/user_page.dart';
export 'pagination/paginated_users/paginated_users_page.dart';
export 'pagination/paginated_users/provider/paginated_users_provider.dart';
export 'pagination/provider/paginated_notifier_mixin.dart';
export 'pagination/provider/paginated_notifier_mixin.dart';
export 'replies/provider/replies_provider.dart';
export 'retweeters/provider/retweeters_provider.dart';
export 'retweeters/retweeters_page.dart';
Expand Down Expand Up @@ -257,7 +255,6 @@ export 'widgets/loading_shimmer/sliver_loading_shimmer.dart';
export 'widgets/loading_shimmer/trends_list_loading_shimmer.dart';
export 'widgets/loading_shimmer/tweet_list_info_message_loading_shimmer.dart';
export 'widgets/loading_shimmer/tweet_list_loading_shimmer.dart';
export 'widgets/loading_shimmer/tweet_list_loading_shimmer.dart';
export 'widgets/loading_shimmer/user_list_loading_shimmer.dart';
export 'widgets/scroll_direction_listener.dart';
export 'widgets/scroll_to_top.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class PostTweetNotifier extends StateNotifier<PostTweetState> with LoggerMixin {

Future<void> post(
String text, {

/// The tweet hyperlink of the quoted tweet if this tweet is a quote.
String? attachmentUrl,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class _StateMessage extends StatelessWidget {
VerticalSpacer.small,
Text(
state.additionalInfo!,
style: theme.textTheme.bodyText1,
style: theme.textTheme.bodyLarge,
),
],
],
Expand Down
4 changes: 2 additions & 2 deletions lib/components/compose/widgets/compose_max_length.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class _ComposeMaxLengthState extends State<ComposeMaxLength> {
final theme = Theme.of(context);

final style = _count <= 280
? theme.textTheme.bodyText1
: theme.textTheme.bodyText1?.copyWith(color: theme.errorColor);
? theme.textTheme.bodyLarge
: theme.textTheme.bodyLarge?.copyWith(color: theme.colorScheme.error);

return Text('$_count / 280', style: style);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/components/compose/widgets/compose_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ComposeTextField extends ConsumerWidget {
child: TextField(
controller: _controller,
focusNode: _focusNode,
style: theme.textTheme.bodyText1,
style: theme.textTheme.bodyLarge,
maxLines: null,
textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _ParentTweetCard extends ConsumerWidget {
Expanded(
child: Text(
label,
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/components/custom_api/custom_api_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class _Table extends ConsumerWidget {
children: [
Text(
'key',
style: theme.textTheme.bodyText1!.copyWith(
style: theme.textTheme.bodyLarge!.copyWith(
color: theme.colorScheme.primary,
),
),
Expand All @@ -119,7 +119,7 @@ class _Table extends ConsumerWidget {
children: [
Text(
'secret',
style: theme.textTheme.bodyText1!.copyWith(
style: theme.textTheme.bodyLarge!.copyWith(
color: theme.colorScheme.primary,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/error/error_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ErrorPage extends StatelessWidget {
children: [
Text(
'oops! something went wrong',
style: theme.textTheme.subtitle2,
style: theme.textTheme.titleSmall,
),
VerticalSpacer.normal,
RbyButton.text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class _HomeTabNameTextFieldState extends State<_HomeTabNameTextField> {
borderSide: BorderSide(color: theme.dividerColor),
),
),
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
onChanged: widget.onChanged,
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/components/home/widgets/home_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ class _AuthenticatedUser extends ConsumerWidget {
children: [
Text(
user.name,
style: theme.textTheme.headline5,
style: theme.textTheme.headlineSmall,
),
VerticalSpacer.small,
Text(
'@${user.handle}',
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/home/widgets/home_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _MentionsTab extends ConsumerWidget {
cardColor: harpyTheme.colors.alternateCardColor,
);

return Badge(
return HarpyBadge(
show: state.hasNewMentions,
child: child,
);
Expand All @@ -99,7 +99,7 @@ class _HomeCustomizationTab extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final iconTheme = IconTheme.of(context);

return Badge.custom(
return HarpyBadge.custom(
// analyzer false positive
// ignore: avoid_redundant_argument_values
show: isFree,
Expand Down
8 changes: 4 additions & 4 deletions lib/components/list/show/widgets/twitter_list_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _ListCardTitle extends StatelessWidget {
Flexible(
child: Text(
list.name,
style: theme.textTheme.subtitle2,
style: theme.textTheme.titleSmall,
softWrap: false,
overflow: TextOverflow.fade,
),
Expand All @@ -87,7 +87,7 @@ class _ListDescription extends StatelessWidget {

return Text(
list.description,
style: theme.textTheme.bodyText1,
style: theme.textTheme.bodyLarge,
maxLines: 1,
overflow: TextOverflow.ellipsis,
);
Expand Down Expand Up @@ -119,7 +119,7 @@ class _ListUser extends StatelessWidget {
Flexible(
child: Text(
list.user!.name,
style: theme.textTheme.bodyText1,
style: theme.textTheme.bodyLarge,
softWrap: false,
overflow: TextOverflow.fade,
),
Expand All @@ -128,7 +128,7 @@ class _ListUser extends StatelessWidget {
Text(
'@${list.user!.handle}',
textDirection: TextDirection.ltr,
style: theme.textTheme.bodyText1,
style: theme.textTheme.bodyLarge,
softWrap: false,
overflow: TextOverflow.fade,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/pages/user/widgets/user_page_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _UserPageAvatar extends State<UserPageAvatar> {
void didChangeDependencies() {
super.didChangeDependencies();

_controller ??= PrimaryScrollController.of(context)
_controller ??= PrimaryScrollController.maybeOf(context)
?..addListener(_scrollListener);
}

Expand Down Expand Up @@ -70,7 +70,7 @@ class _UserPageAvatar extends State<UserPageAvatar> {
Positioned.fill(
child: DecoratedBox(
decoration: BoxDecoration(
color: theme.backgroundColor,
color: theme.colorScheme.background,
shape: BoxShape.circle,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/pages/user/widgets/user_page_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class _UserPageBannerState extends State<UserPageBanner> {
void didChangeDependencies() {
super.didChangeDependencies();

_controller ??= PrimaryScrollController.of(context)
_controller ??= PrimaryScrollController.maybeOf(context)
?..addListener(_listener);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/components/pages/user/widgets/user_page_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class _Handle extends ConsumerWidget {
child: Text(
handle,
textDirection: TextDirection.ltr,
style: theme.textTheme.subtitle1,
style: theme.textTheme.titleMedium,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/pages/user/widgets/user_page_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class _UrlEntry extends ConsumerWidget {
onLongPress: () => defaultOnUrlLongPress(ref, url),
child: Text(
url.displayUrl,
style: theme.textTheme.bodyText1!.copyWith(
style: theme.textTheme.bodyLarge!.copyWith(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
),
Expand All @@ -102,7 +102,7 @@ class _Entry extends StatelessWidget {
return IconTheme(
data: theme.iconTheme.copyWith(size: theme.iconTheme.size! - 4),
child: DefaultTextStyle(
style: theme.textTheme.bodyText1!,
style: theme.textTheme.bodyLarge!,
child: Row(
children: [
icon,
Expand Down
7 changes: 6 additions & 1 deletion lib/components/search/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ class SearchPageContent extends StatelessWidget {
]),
),
),
SliverToBoxAdapter(child: Divider(height: theme.spacing.base * 2)),
SliverToBoxAdapter(
child: Divider(
height: theme.spacing.base * 2,
color: theme.dividerColor,
),
),
const TrendsSelectionHeader(),
VerticalSpacer.normalSliver,
const TrendsList(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomThemeBackgroundColors extends ConsumerWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('background colors', style: theme.textTheme.headline4),
Text('background colors', style: theme.textTheme.headlineMedium),
VerticalSpacer.normal,
_ReorderableBackgroundColors(notifier: notifier),
_AddBackgroundColor(notifier: notifier),
Expand Down
7 changes: 5 additions & 2 deletions lib/components/settings/theme/theme_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,15 @@ class _LockedProThemes extends ConsumerWidget {

return SliverList(
delegate: SliverChildListDelegate.fixed([
Divider(height: theme.spacing.base * 2),
Divider(
height: theme.spacing.base * 2,
color: theme.dividerColor,
),
Padding(
padding: theme.spacing.symmetric(horizontal: true),
child: Text(
'only available for harpy pro',
style: theme.textTheme.subtitle2?.copyWith(
style: theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.onBackground.withOpacity(.8),
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/components/settings/theme/widgets/theme_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ThemeCard extends ConsumerWidget {
final theme = Theme.of(context);
final brightness = ref.watch(platformBrightnessProvider);

final style = harpyTheme.themeData.textTheme.subtitle2!;
final style = harpyTheme.themeData.textTheme.titleSmall!;

Color? borderColor;

Expand Down Expand Up @@ -125,7 +125,7 @@ class LockedProThemeCard extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);

final style = harpyTheme.themeData.textTheme.subtitle2!;
final style = harpyTheme.themeData.textTheme.titleSmall!;

return _ThemeCardBase(
harpyTheme: harpyTheme,
Expand Down Expand Up @@ -249,11 +249,11 @@ void _showThemeSelectionBottomSheet(
),
if (onDelete != null)
RbyListTile(
leading: Icon(CupertinoIcons.delete, color: theme.errorColor),
leading: Icon(CupertinoIcons.delete, color: theme.colorScheme.error),
title: Text(
'delete',
style: TextStyle(
color: theme.errorColor,
color: theme.colorScheme.error,
fontWeight: FontWeight.bold,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/setup/widgets/setup_appearance_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _Layout extends ConsumerWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('layout', style: theme.textTheme.headline5),
Text('layout', style: theme.textTheme.headlineSmall),
const _AnimatedVerticalSpacer(),
Row(
children: [
Expand Down Expand Up @@ -102,7 +102,7 @@ class _Theme extends ConsumerWidget {
children: [
Text(
'theme',
style: theme.textTheme.headline5,
style: theme.textTheme.headlineSmall,
),
const _AnimatedVerticalSpacer(),
if (materialYouLightData != null) ...[
Expand Down
Loading

0 comments on commit de7b1b9

Please sign in to comment.