diff --git a/lib/app.dart b/lib/app.dart index d0df0788..3ba199be 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -73,7 +73,9 @@ class _MimirAppState extends ConsumerState { if (UniversalPlatform.isIOS || UniversalPlatform.isAndroid) { // Listen to media sharing coming from outside the app while the app is in the memory. intentSub = ReceiveSharingIntent.instance.getMediaStream().listen((list) async { - ref.read($intentFiles.notifier).state = [ + ref + .read($intentFiles.notifier) + .state = [ ...ref.read($intentFiles), ...list, ]; @@ -84,7 +86,9 @@ class _MimirAppState extends ConsumerState { // Get the media sharing coming from outside the app while the app is closed. ReceiveSharingIntent.instance.getInitialMedia().then((list) async { - ref.read($intentFiles.notifier).state = [ + ref + .read($intentFiles.notifier) + .state = [ ...ref.read($intentFiles), ...list, ]; @@ -136,9 +140,9 @@ class _MimirAppState extends ConsumerState { colorScheme: themeColor == null ? null : ColorScheme.fromSeed( - seedColor: themeColor, - brightness: origin.brightness, - ), + seedColor: themeColor, + brightness: origin.brightness, + ), visualDensity: VisualDensity.comfortable, splashFactory: kIsWeb ? null : InkSparkle.splashFactory, navigationBarTheme: const NavigationBarThemeData( @@ -170,10 +174,11 @@ class _MimirAppState extends ConsumerState { themeMode: ref.watch(Settings.theme.$themeMode), theme: bakeTheme(ThemeData.light()), darkTheme: bakeTheme(ThemeData.dark()), - builder: (ctx, child) => _PostServiceRunner( - key: const ValueKey("Post service runner"), - child: child ?? const SizedBox.shrink(), - ), + builder: (ctx, child) => + _PostServiceRunner( + key: const ValueKey("Post service runner"), + child: child ?? const SizedBox.shrink(), + ), scrollBehavior: const MaterialScrollBehavior().copyWith( dragDevices: { PointerDeviceKind.mouse, @@ -187,7 +192,9 @@ class _MimirAppState extends ConsumerState { } Future handleUriLink(Uri uri) async { - ref.read($appLinks.notifier).state = [...ref.read($appLinks), (uri: uri, ts: DateTime.now())]; + ref + .read($appLinks.notifier) + .state = [...ref.read($appLinks), (uri: uri, ts: DateTime.now())]; final navigateCtx = $key.currentContext; if (navigateCtx == null) return; if (!kIsWeb) { @@ -253,7 +260,7 @@ class _PostServiceRunnerState extends ConsumerState<_PostServiceRunner> { initQuickActions(); } WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { - if (Admin.isAvailable()) { + if (kDebugMode && Admin.isAvailable()) { final admin = Admin(ObjectBoxInit.store); ObjectBoxInit.objectBoxAdmin = admin; debugPrint("ObjectBox Admin running at port ${admin.port}."); diff --git a/lib/settings/page/developer.dart b/lib/settings/page/developer.dart index 557a3824..3edd89f0 100644 --- a/lib/settings/page/developer.dart +++ b/lib/settings/page/developer.dart @@ -123,7 +123,7 @@ class _DeveloperOptionsPageState extends ConsumerState { context.go("/"); }, ), - if (Admin.isAvailable() && objectboxAdmin != null && !objectboxAdmin.isClosed()) + if (kDebugMode && Admin.isAvailable() && objectboxAdmin != null && !objectboxAdmin.isClosed()) ListTile( title: "Open Objectbox Admin".text(), subtitle: "http://localhost:${objectboxAdmin.port}/index.html".text(),