diff --git a/lib/repository/account_settings_repository.dart b/lib/repository/account_settings_repository.dart index 249e12eab..4d27aa318 100644 --- a/lib/repository/account_settings_repository.dart +++ b/lib/repository/account_settings_repository.dart @@ -34,7 +34,9 @@ class AccountSettingsRepository extends ChangeNotifier { } else { if (defaultTargetPlatform == TargetPlatform.iOS) { await SharedPreferenceAppGroup.setString( - "account_settings", storedData); + "account_settings", + storedData, + ); } } try { diff --git a/lib/state_notifier/common/misskey_notes/misskey_note_notifier.dart b/lib/state_notifier/common/misskey_notes/misskey_note_notifier.dart index 54b5304cd..f13f34416 100644 --- a/lib/state_notifier/common/misskey_notes/misskey_note_notifier.dart +++ b/lib/state_notifier/common/misskey_notes/misskey_note_notifier.dart @@ -1,6 +1,5 @@ import "package:flutter/foundation.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; -import "package:miria/extensions/user_extension.dart"; import "package:miria/model/account.dart"; import "package:miria/providers.dart"; import "package:miria/router/app_router.dart"; diff --git a/lib/state_notifier/note_create_page/note_create_state_notifier.dart b/lib/state_notifier/note_create_page/note_create_state_notifier.dart index 0f804f7f0..a58f41715 100644 --- a/lib/state_notifier/note_create_page/note_create_state_notifier.dart +++ b/lib/state_notifier/note_create_page/note_create_state_notifier.dart @@ -92,11 +92,13 @@ class NoteCreateChannel with _$NoteCreateChannel { }) = _NoteCreateChannel; } -@Riverpod(dependencies: [ - misskeyPostContext, - notesWith, - accountContext, -]) +@Riverpod( + dependencies: [ + misskeyPostContext, + notesWith, + accountContext, + ], +) class NoteCreateNotifier extends _$NoteCreateNotifier { late final _fileSystem = ref.read(fileSystemProvider); late final _dio = ref.read(dioProvider); diff --git a/lib/view/clip_modal_sheet/clip_modal_sheet.dart b/lib/view/clip_modal_sheet/clip_modal_sheet.dart index 2dddb5239..d86b08a04 100644 --- a/lib/view/clip_modal_sheet/clip_modal_sheet.dart +++ b/lib/view/clip_modal_sheet/clip_modal_sheet.dart @@ -38,11 +38,14 @@ class _NotesClipsNotifier extends _$NotesClipsNotifier { } } -@Riverpod(keepAlive: false, dependencies: [ - ClipsNotifier, - _NotesClipsNotifier, - misskeyPostContext, -]) +@Riverpod( + keepAlive: false, + dependencies: [ + ClipsNotifier, + _NotesClipsNotifier, + misskeyPostContext, + ], +) class _ClipModalSheetNotifier extends _$ClipModalSheetNotifier { @override Future> build(String noteId) async { diff --git a/lib/view/common/interactive_viewer.dart b/lib/view/common/interactive_viewer.dart index 119c9e659..79183f487 100644 --- a/lib/view/common/interactive_viewer.dart +++ b/lib/view/common/interactive_viewer.dart @@ -24,7 +24,9 @@ import "package:vector_math/vector_math_64.dart" show Matrix4, Quad, Vector3; /// * [InteractiveViewer.builder], whose builder is of this type. /// * [WidgetBuilder], which is similar, but takes no viewport. typedef InteractiveViewerWidgetBuilder = Widget Function( - BuildContext context, Quad viewport); + BuildContext context, + Quad viewport, +); /// A widget that enables pan and zoom interactions with its child. /// @@ -974,8 +976,10 @@ class _InteractiveViewerState extends State details.scaleVelocity / 10, ); final tFinal = _getFinalTime( - details.scaleVelocity.abs(), widget.interactionEndFrictionCoefficient, - effectivelyMotionless: 0.1); + details.scaleVelocity.abs(), + widget.interactionEndFrictionCoefficient, + effectivelyMotionless: 0.1, + ); _scaleAnimation = Tween( begin: scale, end: frictionSimulation.x(tFinal), @@ -1342,8 +1346,11 @@ enum _GestureType { // Given a velocity and drag, calculate the time at which motion will come to // a stop, within the margin of effectivelyMotionless. -double _getFinalTime(double velocity, double drag, - {double effectivelyMotionless = 10}) { +double _getFinalTime( + double velocity, + double drag, { + double effectivelyMotionless = 10, +}) { return math.log(effectivelyMotionless / velocity) / math.log(drag / 100); } diff --git a/lib/view/common/misskey_notes/misskey_note.dart b/lib/view/common/misskey_notes/misskey_note.dart index fe412539b..912f5bc98 100644 --- a/lib/view/common/misskey_notes/misskey_note.dart +++ b/lib/view/common/misskey_notes/misskey_note.dart @@ -320,8 +320,9 @@ class MisskeyNote extends HookConsumerWidget { ); final reactionControl = - useCallback Function({MisskeyEmojiData? requestEmoji})>(( - {requestEmoji}) async { + useCallback Function({MisskeyEmojiData? requestEmoji})>(({ + requestEmoji, + }) async { // 他のサーバーからログインしている場合は不可 if (!ref.read(accountContextProvider).isSame) return; diff --git a/lib/view/common/misskey_notes/reaction_button.dart b/lib/view/common/misskey_notes/reaction_button.dart index 70a49b349..47bde0ccb 100644 --- a/lib/view/common/misskey_notes/reaction_button.dart +++ b/lib/view/common/misskey_notes/reaction_button.dart @@ -11,7 +11,6 @@ import "package:miria/providers.dart"; import "package:miria/router/app_router.dart"; import "package:miria/view/common/dialog/dialog_state.dart"; import "package:miria/view/common/misskey_notes/custom_emoji.dart"; -import "package:miria/view/dialogs/simple_confirm_dialog.dart"; import "package:miria/view/themes/app_theme.dart"; import "package:misskey_dart/misskey_dart.dart"; diff --git a/lib/view/federation_page/federation_announcements.dart b/lib/view/federation_page/federation_announcements.dart index 9b5571011..df309ffa6 100644 --- a/lib/view/federation_page/federation_announcements.dart +++ b/lib/view/federation_page/federation_announcements.dart @@ -9,7 +9,6 @@ import "package:miria/view/common/dialog/dialog_state.dart"; import "package:miria/view/common/misskey_notes/mfm_text.dart"; import "package:miria/view/common/misskey_notes/network_image.dart"; import "package:miria/view/common/pushable_listview.dart"; -import "package:miria/view/common/sending_elevated_button.dart"; import "package:misskey_dart/misskey_dart.dart"; class FederationAnnouncements extends HookConsumerWidget { @@ -113,7 +112,7 @@ class Announcement extends HookConsumerWidget { S.of(context).confirmAnnouncementsRead(data.value.title), actions: (context) => [ S.of(context).readAnnouncement, - S.of(context).didNotReadAnnouncement + S.of(context).didNotReadAnnouncement, ], ); if (isConfirmed != 0) return; diff --git a/lib/view/federation_page/federation_custom_emojis.dart b/lib/view/federation_page/federation_custom_emojis.dart index 92f36128c..ba204eb39 100644 --- a/lib/view/federation_page/federation_custom_emojis.dart +++ b/lib/view/federation_page/federation_custom_emojis.dart @@ -1,7 +1,6 @@ import "package:collection/collection.dart"; import "package:flutter/material.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; -import "package:flutter_hooks/flutter_hooks.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "package:miria/model/misskey_emoji_data.dart"; import "package:miria/providers.dart"; diff --git a/lib/view/settings_page/account_settings_page/account_list.dart b/lib/view/settings_page/account_settings_page/account_list.dart index 2f3d845a0..8308a3431 100644 --- a/lib/view/settings_page/account_settings_page/account_list.dart +++ b/lib/view/settings_page/account_settings_page/account_list.dart @@ -97,7 +97,8 @@ class AccountListItem extends ConsumerWidget { icon: const Icon(Icons.settings), onPressed: () { context.pushRoute( - SeveralAccountGeneralSettingsRoute(account: account)); + SeveralAccountGeneralSettingsRoute(account: account), + ); }, ), IconButton( diff --git a/lib/view/settings_page/tab_settings_page/antenna_select_dialog.dart b/lib/view/settings_page/tab_settings_page/antenna_select_dialog.dart index 98184615c..4de7c3388 100644 --- a/lib/view/settings_page/tab_settings_page/antenna_select_dialog.dart +++ b/lib/view/settings_page/tab_settings_page/antenna_select_dialog.dart @@ -1,4 +1,3 @@ -import "package:auto_route/annotations.dart"; import "package:auto_route/auto_route.dart"; import "package:flutter/material.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; diff --git a/lib/view/settings_page/tab_settings_page/role_select_dialog.dart b/lib/view/settings_page/tab_settings_page/role_select_dialog.dart index 1e9965eee..2161433fd 100644 --- a/lib/view/settings_page/tab_settings_page/role_select_dialog.dart +++ b/lib/view/settings_page/tab_settings_page/role_select_dialog.dart @@ -1,4 +1,3 @@ -import "package:auto_route/annotations.dart"; import "package:auto_route/auto_route.dart"; import "package:flutter/material.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; @@ -61,7 +60,7 @@ class RoleSelectDialog extends ConsumerWidget implements AutoRouteWrapper { ); }, ), - } + }, ], ), ), diff --git a/lib/view/settings_page/tab_settings_page/tab_settings_page.dart b/lib/view/settings_page/tab_settings_page/tab_settings_page.dart index f58e2eecf..66d5b3db2 100644 --- a/lib/view/settings_page/tab_settings_page/tab_settings_page.dart +++ b/lib/view/settings_page/tab_settings_page/tab_settings_page.dart @@ -222,7 +222,8 @@ class TabSettingsPage extends HookConsumerWidget { AsyncData() => Row( children: [ Expanded( - child: Text(selectedChannel.value?.name ?? "")), + child: Text(selectedChannel.value?.name ?? ""), + ), IconButton( onPressed: () async { final selected = selectedAccount.value; @@ -247,7 +248,8 @@ class TabSettingsPage extends HookConsumerWidget { AsyncData() => Row( children: [ Expanded( - child: Text(selectedUserList.value?.name ?? "")), + child: Text(selectedUserList.value?.name ?? ""), + ), IconButton( onPressed: () async { final selected = selectedAccount.value; @@ -279,7 +281,8 @@ class TabSettingsPage extends HookConsumerWidget { if (selected == null) return; selectedAntenna.value = await context.pushRoute( - AntennaSelectRoute(account: selected)); + AntennaSelectRoute(account: selected), + ); nameController.text = selectedAntenna.value?.name ?? nameController.text; }, diff --git a/lib/view/settings_page/tab_settings_page/user_list_select_dialog.dart b/lib/view/settings_page/tab_settings_page/user_list_select_dialog.dart index cd7296eb7..9687d7737 100644 --- a/lib/view/settings_page/tab_settings_page/user_list_select_dialog.dart +++ b/lib/view/settings_page/tab_settings_page/user_list_select_dialog.dart @@ -35,33 +35,34 @@ class UserListSelectDialog extends ConsumerWidget implements AutoRouteWrapper { width: MediaQuery.of(context).size.width * 0.8, height: MediaQuery.of(context).size.height * 0.8, child: SingleChildScrollView( - child: switch (usersList) { - AsyncLoading() => const Center(child: CircularProgressIndicator()), - AsyncError(:final error, :final stackTrace) => - ErrorDetail(error: error, stackTrace: stackTrace), - AsyncData(:final value) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).list, - style: Theme.of(context).textTheme.titleMedium, - ), - ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: value.length, - itemBuilder: (context, index) { - return ListTile( - onTap: () { - Navigator.of(context).pop(value[index]); - }, - title: Text(value[index].name ?? ""), - ); - }, - ), - ], - ), - }), + child: switch (usersList) { + AsyncLoading() => const Center(child: CircularProgressIndicator()), + AsyncError(:final error, :final stackTrace) => + ErrorDetail(error: error, stackTrace: stackTrace), + AsyncData(:final value) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).list, + style: Theme.of(context).textTheme.titleMedium, + ), + ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: value.length, + itemBuilder: (context, index) { + return ListTile( + onTap: () { + Navigator.of(context).pop(value[index]); + }, + title: Text(value[index].name ?? ""), + ); + }, + ), + ], + ), + }, + ), ), ); } diff --git a/lib/view/several_account_settings_page/instance_mute_page/instance_mute_page.dart b/lib/view/several_account_settings_page/instance_mute_page/instance_mute_page.dart index 55a10692f..40ac4e64d 100644 --- a/lib/view/several_account_settings_page/instance_mute_page/instance_mute_page.dart +++ b/lib/view/several_account_settings_page/instance_mute_page/instance_mute_page.dart @@ -65,49 +65,49 @@ class InstanceMutePage extends HookConsumerWidget { appBar: AppBar(title: Text(S.of(context).instanceMute)), body: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.all(10), - child: switch (state) { - AsyncLoading() => - const Center(child: CircularProgressIndicator()), - AsyncError(:final error, :final stackTrace) => - ErrorDetail(error: error, stackTrace: stackTrace), - AsyncValue() => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Card( - child: Padding( - padding: const EdgeInsets.all(10), - child: Align( - alignment: Alignment.topLeft, - child: Text(S.of(context).instanceMuteDescription1), - ), + padding: const EdgeInsets.all(10), + child: switch (state) { + AsyncLoading() => const Center(child: CircularProgressIndicator()), + AsyncError(:final error, :final stackTrace) => + ErrorDetail(error: error, stackTrace: stackTrace), + AsyncValue() => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Card( + child: Padding( + padding: const EdgeInsets.all(10), + child: Align( + alignment: Alignment.topLeft, + child: Text(S.of(context).instanceMuteDescription1), ), ), - const Padding( - padding: EdgeInsets.only(top: 10), - ), - TextField( - maxLines: null, - minLines: 5, - controller: controller, - autofocus: true, - textCapitalization: TextCapitalization.none, - ), - Text( - S.of(context).instanceMuteDescription2, - style: Theme.of(context).textTheme.bodySmall, - ), - ElevatedButton.icon( - onPressed: () async => ref - .read(instanceMutePageNotifierProvider.notifier) - .save(controller.text), - icon: const Icon(Icons.save), - label: Text(S.of(context).save), - ), - ], - ), - }), + ), + const Padding( + padding: EdgeInsets.only(top: 10), + ), + TextField( + maxLines: null, + minLines: 5, + controller: controller, + autofocus: true, + textCapitalization: TextCapitalization.none, + ), + Text( + S.of(context).instanceMuteDescription2, + style: Theme.of(context).textTheme.bodySmall, + ), + ElevatedButton.icon( + onPressed: () async => ref + .read(instanceMutePageNotifierProvider.notifier) + .save(controller.text), + icon: const Icon(Icons.save), + label: Text(S.of(context).save), + ), + ], + ), + }, + ), ), ); } diff --git a/lib/view/time_line_page/timeline_tablet_ui.dart b/lib/view/time_line_page/timeline_tablet_ui.dart index 536c3019f..d35919bd7 100644 --- a/lib/view/time_line_page/timeline_tablet_ui.dart +++ b/lib/view/time_line_page/timeline_tablet_ui.dart @@ -112,7 +112,7 @@ class Timeline extends HookConsumerWidget { tabSetting: tabSetting, controller: scrollController, ), - ) + ), ], ), ); @@ -267,15 +267,17 @@ class EmojiInputComplement extends HookWidget { Widget build(BuildContext context) { final overlayEntry = useState(null); final layerLink = useMemoized(() => LayerLink()); - final options = useMemoized(() => [ - "apple", - "banana", - "grape", - "orange", - "pineapple", - "strawberry", - "watermelon" - ]); + final options = useMemoized( + () => [ + "apple", + "banana", + "grape", + "orange", + "pineapple", + "strawberry", + "watermelon", + ], + ); final hideOverlay = useCallback( () { diff --git a/lib/view/user_page/update_memo_dialog.dart b/lib/view/user_page/update_memo_dialog.dart index d68f98ba4..c766cc33d 100644 --- a/lib/view/user_page/update_memo_dialog.dart +++ b/lib/view/user_page/update_memo_dialog.dart @@ -58,7 +58,7 @@ class UpdateMemoDialog extends HookConsumerWidget implements AutoRouteWrapper { onPressed: () async => updateMemo.execute(), child: Text(S.of(context).save), ), - } + }, ], ); } diff --git a/lib/view/user_page/user_detail.dart b/lib/view/user_page/user_detail.dart index 645259f8d..cb1ab5178 100644 --- a/lib/view/user_page/user_detail.dart +++ b/lib/view/user_page/user_detail.dart @@ -106,7 +106,7 @@ class UserDetail extends ConsumerWidget { ? S.of(context).followRequest : S.of(context).createFollow, ), - ) + ), /*else Align( alignment: Alignment.centerRight, diff --git a/lib/view/user_page/user_notes.dart b/lib/view/user_page/user_notes.dart index d4ee64618..5a096e1ec 100644 --- a/lib/view/user_page/user_notes.dart +++ b/lib/view/user_page/user_notes.dart @@ -131,7 +131,7 @@ class UserNotes extends HookConsumerWidget { withReply.value, renote.value, untilDate.value, - highlight.value + highlight.value, ], ), additionalErrorInfo: highlight.value diff --git a/lib/view/user_page/user_page.dart b/lib/view/user_page/user_page.dart index fec3c1ade..714bc60f8 100644 --- a/lib/view/user_page/user_page.dart +++ b/lib/view/user_page/user_page.dart @@ -1,9 +1,6 @@ -import "dart:async"; - import "package:auto_route/auto_route.dart"; import "package:flutter/material.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; -import "package:flutter_hooks/flutter_hooks.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "package:miria/model/account.dart"; import "package:miria/providers.dart";