Skip to content

Commit

Permalink
fix: deprecatedなメンバを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
YumNumm committed Nov 26, 2024
1 parent e5c7809 commit 87acde9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/lib/core/provider/app_lifecycle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AppLifecycleState appLifeCycle(AppLifeCycleRef ref) {
..listenSelf(
(previous, next) => ref
.read(talkerProvider)
.logTyped(AppLifeCycleLog('$previous -> $next')),
.logCustom(AppLifeCycleLog('$previous -> $next')),
);
return AppLifecycleState.resumed;
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/core/provider/ntp/ntp_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Ntp extends _$Ntp {

ref
.read(talkerProvider)
.logTyped(NtpLog('NTP Time Sync: offset ${offset}ms'));
.logCustom(NtpLog('NTP Time Sync: offset ${offset}ms'));
}

DateTime? now() {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/core/router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class _NavigatorObserver extends NavigatorObserver {
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
if (route is PageRoute) {
final page = route.settings.name;
talker.logTyped(GoRouterLog('push to $page'));
talker.logCustom(GoRouterLog('push to $page'));
if (kIsWeb) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class KmoniViewModel extends _$KmoniViewModel {
const Duration(seconds: 1),
(_) => _update(),
);
talker.logTyped(
talker.logCustom(
KmoniLog('遅延調整を行いました ${diff.inMicroseconds / 1000}ms'),
);
return diff;
}()
.timeout(const Duration(seconds: 5));
// ignore: avoid_catches_without_on_clauses
} catch (e) {
talker.logTyped(
talker.logCustom(
KmoniLog('遅延調整失敗 $e'),
);
state = state.copyWith(isDelayAdjusting: false);
Expand Down
28 changes: 2 additions & 26 deletions app/lib/feature/settings/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_email_sender/flutter_email_sender.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shorebird_code_push/shorebird_code_push.dart';
import 'package:url_launcher/url_launcher_string.dart';

class SettingsScreen extends ConsumerWidget {
Expand Down Expand Up @@ -150,30 +148,8 @@ class _AppVersionInformation extends HookConsumerWidget {
final theme = Theme.of(context);
final textTheme = theme.textTheme;

final patchInfoFuture = useMemoized(
() => (
ShorebirdCodePush().currentPatchNumber(),
ShorebirdCodePush().nextPatchNumber(),
).wait,
);
final patchInfo = useFuture(patchInfoFuture);

var text = 'EQMonitor v${packageInfo.version} '
'(${packageInfo.buildNumber}';
if (patchInfo.hasData) {
final currentPatch = patchInfo.data!.$1;
final nextPatch = patchInfo.data!.$2;
text += switch ((currentPatch, nextPatch)) {
(null, null) => ')',
(null, final int next) => '+$next)\n&'
'新しいパッチが利用可能です。2回アプリケーションを再起動して適用できます。',
(final int current, null) => '+$current)',
(final int current, final int next) => '+$current->$next)\n'
'新しいパッチが利用可能です。2回アプリケーションを再起動して適用できます。',
};
} else {
text += ')';
}
final text = 'EQMonitor v${packageInfo.version} '
'(${packageInfo.buildNumber})';

return Center(
child: Padding(
Expand Down

0 comments on commit 87acde9

Please sign in to comment.