diff --git a/.fvmrc b/.fvmrc index 3ca65ffc..2bb4682a 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.32.8" + "flutter": "3.35.2" } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 7687126e..a66ec8d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "dart.flutterSdkPath": ".fvm/versions/3.32.8", + "dart.flutterSdkPath": ".fvm/versions/3.35.2", "editor.formatOnSave": true, "explorer.fileNesting.enabled": true, "explorer.fileNesting.expand": false, diff --git a/lib/provider/theme_data_provider.dart b/lib/provider/theme_data_provider.dart index cdc6293e..538bb883 100644 --- a/lib/provider/theme_data_provider.dart +++ b/lib/provider/theme_data_provider.dart @@ -101,7 +101,7 @@ ThemeData themeData(Ref ref, Brightness brightness) { backgroundColor: colors.accent, ), sliderTheme: const SliderThemeData( - showValueIndicator: ShowValueIndicator.always, + showValueIndicator: ShowValueIndicator.onDrag, // Opting into the new appearance. // ignore: deprecated_member_use year2023: false, diff --git a/lib/provider/theme_data_provider.g.dart b/lib/provider/theme_data_provider.g.dart index 35ed412d..e661f774 100644 --- a/lib/provider/theme_data_provider.g.dart +++ b/lib/provider/theme_data_provider.g.dart @@ -6,7 +6,7 @@ part of 'theme_data_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$themeDataHash() => r'e31c4654f0baa9de9bf92edc0d9bba443237e085'; +String _$themeDataHash() => r'c24c9db267f294060c065ea98d17f64cf689e91a'; /// Copied from Dart SDK class _SystemHash { diff --git a/lib/view/dialog/account_select_dialog.dart b/lib/view/dialog/account_select_dialog.dart index 4d22059d..703bf943 100644 --- a/lib/view/dialog/account_select_dialog.dart +++ b/lib/view/dialog/account_select_dialog.dart @@ -40,48 +40,59 @@ class AccountSelectDialog extends HookConsumerWidget { return AlertDialog( title: Text(t.misskey.selectAccount), scrollable: true, - content: Column( - children: [ - ListTile( - leading: const Icon(Icons.add), - title: Text(t.misskey.addAccount), - trailing: const Icon(Icons.navigate_next), - onTap: () => context.push('/login'), - ), - ...accounts.map( - (acct) => RadioListTile( - title: Text(acct.toString()), - value: acct, - groupValue: account.value, - onChanged: (value) => account.value = value, + content: RadioGroup<(Account?,)>( + groupValue: switch (account.value) { + Account(isGuest: true) => (null,), + Account(isGuest: false) => (account.value,), + null => null, + }, + onChanged: (value) { + if (value != null) { + if (value.$1 != null) { + account.value = value.$1; + } else { + account.value = Account(host: controller.text); + } + } + }, + child: Column( + children: [ + ListTile( + leading: const Icon(Icons.add), + title: Text(t.misskey.addAccount), + trailing: const Icon(Icons.navigate_next), + onTap: () => context.push('/login'), ), - ), - RadioListTile( - title: Text(t.aria.guest), - value: true, - groupValue: account.value?.isGuest ?? false, - onChanged: (value) => - account.value = Account(host: controller.text), - ), - if (account.value?.isGuest ?? false) ...[ - MisskeyServerAutocomplete( - controller: controller, - focusNode: focusNode, + ...accounts.map( + (account) => RadioListTile<(Account?,)>( + title: Text(account.toString()), + value: (account,), + ), ), - TextButton( - onPressed: () async { - final host = await showDialog( - context: context, - builder: (context) => const MisskeyServerListDialog(), - ); - if (host != null) { - controller.text = host; - } - }, - child: Text(t.aria.findServer), + RadioListTile<(Account?,)>( + title: Text(t.aria.guest), + value: (null,), ), + if (account.value?.isGuest ?? false) ...[ + MisskeyServerAutocomplete( + controller: controller, + focusNode: focusNode, + ), + TextButton( + onPressed: () async { + final host = await showDialog( + context: context, + builder: (context) => const MisskeyServerListDialog(), + ); + if (host != null) { + controller.text = host; + } + }, + child: Text(t.aria.findServer), + ), + ], ], - ], + ), ), actions: [ ElevatedButton( diff --git a/lib/view/dialog/mute_dialog.dart b/lib/view/dialog/mute_dialog.dart index 82ce7417..524a1ab0 100644 --- a/lib/view/dialog/mute_dialog.dart +++ b/lib/view/dialog/mute_dialog.dart @@ -52,7 +52,7 @@ class MuteDialog extends HookConsumerWidget { ), ) .toList(), - value: period.value, + initialValue: period.value, onChanged: (v) { if (v != null) { period.value = v; diff --git a/lib/view/dialog/radio_dialog.dart b/lib/view/dialog/radio_dialog.dart index 57fe0fe2..f0b10ab0 100644 --- a/lib/view/dialog/radio_dialog.dart +++ b/lib/view/dialog/radio_dialog.dart @@ -43,21 +43,23 @@ class RadioDialog extends HookWidget { return AlertDialog( title: title, scrollable: true, - content: Column( - children: [ - if (header case final header?) ...[ - header, - const SizedBox(height: 8.0), - ], - ...values.map( - (value) => RadioListTile( - title: itemBuilder(context, value), - value: value, - groupValue: initialValue, - onChanged: (value) => context.pop(value), + content: RadioGroup( + groupValue: initialValue, + onChanged: (value) => context.pop(value), + child: Column( + children: [ + if (header case final header?) ...[ + header, + const SizedBox(height: 8.0), + ], + ...values.map( + (value) => RadioListTile( + title: itemBuilder(context, value), + value: value, + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/view/page/play/play_edit_page.dart b/lib/view/page/play/play_edit_page.dart index f9f07a2b..dac283c3 100644 --- a/lib/view/page/play/play_edit_page.dart +++ b/lib/view/page/play/play_edit_page.dart @@ -168,7 +168,7 @@ class PlayEditPage extends HookConsumerWidget { child: Text(t.misskey.private), ), ], - value: visibility.value, + initialValue: visibility.value, onChanged: (value) => visibility.value = value, isExpanded: true, ), diff --git a/lib/view/page/settings/languages_page.dart b/lib/view/page/settings/languages_page.dart index a06326e5..20eb9d2c 100644 --- a/lib/view/page/settings/languages_page.dart +++ b/lib/view/page/settings/languages_page.dart @@ -25,172 +25,168 @@ class LanguagesPage extends ConsumerWidget { appBar: AppBar(title: Text(t.misskey.uiLanguage)), body: ListTileTheme( tileColor: colors.panel, - child: ListView( - children: [ - const SizedBox(height: 8.0), - Center( - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 8.0), - width: maxContentWidth, - child: Card( - margin: EdgeInsets.zero, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Mfm( - account: Account.dummy(), - text: t.misskey.i18nInfo( - link: '[Crowdin](https://crowdin.com/project/misskey)', - ), - style: TextStyle( - color: Theme.of( - context, - ).colorScheme.onSecondaryContainer, + child: RadioGroup( + groupValue: locale, + onChanged: (value) { + ref + .read(generalSettingsNotifierProvider.notifier) + .setLocale(locale); + if (locale == null) { + LocaleSettings.useDeviceLocale(); + } else { + LocaleSettings.setLocale(locale); + } + }, + child: ListView( + children: [ + const SizedBox(height: 8.0), + Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 8.0), + width: maxContentWidth, + child: Card( + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Mfm( + account: Account.dummy(), + text: t.misskey.i18nInfo( + link: + '[Crowdin](https://crowdin.com/project/misskey)', + ), + style: TextStyle( + color: Theme.of( + context, + ).colorScheme.onSecondaryContainer, + ), ), ), ), ), ), - ), - const SizedBox(height: 8.0), - Center( - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 8.0), - width: maxContentWidth, - child: Card( - margin: EdgeInsets.zero, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text.rich( - t.aria.i18nInfo( - link: WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: InkWell( - onTap: () => launchUrl( - ref, - Uri.https( - 'crowdin.com', - 'project/aria-for-misskey', + const SizedBox(height: 8.0), + Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 8.0), + width: maxContentWidth, + child: Card( + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text.rich( + t.aria.i18nInfo( + link: WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: InkWell( + onTap: () => launchUrl( + ref, + Uri.https( + 'crowdin.com', + 'project/aria-for-misskey', + ), ), - ), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: 'Crowdin', - style: TextStyle(color: colors.link), - ), - WidgetSpan( - child: Builder( - builder: (context) => Icon( - Icons.open_in_new, - color: colors.link, - size: DefaultTextStyle.of( - context, - ).style.fontSize, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: 'Crowdin', + style: TextStyle(color: colors.link), + ), + WidgetSpan( + child: Builder( + builder: (context) => Icon( + Icons.open_in_new, + color: colors.link, + size: DefaultTextStyle.of( + context, + ).style.fontSize, + ), ), ), - ), - ], + ], + ), + textAlign: TextAlign.center, + textScaler: TextScaler.noScaling, ), - textAlign: TextAlign.center, - textScaler: TextScaler.noScaling, ), ), ), - ), - style: TextStyle( - color: Theme.of( - context, - ).colorScheme.onSecondaryContainer, + style: TextStyle( + color: Theme.of( + context, + ).colorScheme.onSecondaryContainer, + ), ), ), ), ), ), - ), - const SizedBox(height: 8.0), - Center( - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 8.0), - width: maxContentWidth, - child: RadioListTile( - title: Text(t.misskey.system), - value: null, - groupValue: locale, - onChanged: (_) { - ref - .read(generalSettingsNotifierProvider.notifier) - .setLocale(null); - LocaleSettings.useDeviceLocale(); - }, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(8.0), + const SizedBox(height: 8.0), + Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 8.0), + width: maxContentWidth, + child: RadioListTile( + title: Text(t.misskey.system), + value: null, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(8.0), + ), + ), + contentPadding: const EdgeInsets.symmetric( + vertical: 8.0, + horizontal: 16.0, ), - ), - contentPadding: const EdgeInsets.symmetric( - vertical: 8.0, - horizontal: 16.0, ), ), ), - ), - for (final (index, appLocale) - in AppLocaleUtils.supportedLocales - .sortedBy((locale) => locale.toLanguageTag()) - .map( - (locale) => AppLocale.values.firstWhere( - (appLocale) => - appLocale.languageTag == locale.toLanguageTag(), - ), - ) - .indexed) ...[ - const Center( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: SizedBox( - width: maxContentWidth, - child: Divider(height: 0.0), + for (final (index, appLocale) + in AppLocaleUtils.supportedLocales + .sortedBy((locale) => locale.toLanguageTag()) + .map( + (locale) => AppLocale.values.firstWhere( + (appLocale) => + appLocale.languageTag == locale.toLanguageTag(), + ), + ) + .indexed) ...[ + const Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: SizedBox( + width: maxContentWidth, + child: Divider(height: 0.0), + ), ), ), - ), - Center( - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 8.0), - width: maxContentWidth, - child: RadioListTile( - title: FutureBuilder( - future: LocaleSettings.instance.loadLocale(appLocale), - builder: (context, snapshot) => - Text(appLocale.translations.misskey.lang__), + Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 8.0), + width: maxContentWidth, + child: RadioListTile( + title: FutureBuilder( + future: LocaleSettings.instance.loadLocale(appLocale), + builder: (context, snapshot) => + Text(appLocale.translations.misskey.lang__), + ), + subtitle: Text(appLocale.languageTag), + value: appLocale, + shape: index == AppLocaleUtils.supportedLocales.length - 1 + ? const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.0), + ), + ) + : null, ), - subtitle: Text(appLocale.languageTag), - value: appLocale, - groupValue: locale, - onChanged: (locale) { - ref - .read(generalSettingsNotifierProvider.notifier) - .setLocale(locale); - if (locale == null) { - LocaleSettings.useDeviceLocale(); - } else { - LocaleSettings.setLocale(locale); - } - }, - shape: index == AppLocaleUtils.supportedLocales.length - 1 - ? const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - bottom: Radius.circular(8.0), - ), - ) - : null, ), ), - ), + ], + const SizedBox(height: 8.0), ], - const SizedBox(height: 8.0), - ], + ), ), ), selectedDestination: GeneralSettingsDestination.language, diff --git a/lib/view/widget/as_ui_widget.dart b/lib/view/widget/as_ui_widget.dart index b12d6fb6..3a270525 100644 --- a/lib/view/widget/as_ui_widget.dart +++ b/lib/view/widget/as_ui_widget.dart @@ -442,7 +442,7 @@ class AsUiWidget extends HookConsumerWidget { DropdownMenuItem(value: item.$2, child: Text(item.$1)), ) .toList(), - value: value.value, + initialValue: value.value, onChanged: (v) async { value.value = v; if (v != null) { diff --git a/lib/view/widget/mfm/sparkle.dart b/lib/view/widget/mfm/sparkle.dart index 4c61c465..927ad40c 100644 --- a/lib/view/widget/mfm/sparkle.dart +++ b/lib/view/widget/mfm/sparkle.dart @@ -133,8 +133,13 @@ class _ParticlePainter extends CustomPainter { void paint(Canvas canvas, Size size) { for (final particle in particles) { final matrix = Matrix4.identity() - ..translate(particle.position.dx, particle.position.dy) - ..scale(particle.scale, particle.scale) + ..translateByDouble( + particle.position.dx, + particle.position.dy, + 0.0, + 1.0, + ) + ..scaleByDouble(particle.scale, particle.scale, particle.scale, 1.0) ..rotateZ(particle.angle); canvas.drawPath( particle.path.transform(matrix.storage), diff --git a/pubspec.lock b/pubspec.lock index 96b16015..24c35df9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1189,26 +1189,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lint: dependency: "direct dev" description: @@ -1909,10 +1909,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" time: dependency: transitive description: @@ -2104,10 +2104,10 @@ packages: dependency: "direct main" description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" video_player: dependency: "direct main" description: