mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(mobile): Home page app bar icons don't conform to theme change (#1409)
* fix(mobile): Home page app bar icons don't conform to theme change * Remove unsued code
This commit is contained in:
parent
0f1afff4c3
commit
8b7d7f1666
@ -3,7 +3,6 @@ import 'dart:io';
|
|||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||||
import 'package:hive_flutter/hive_flutter.dart';
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -57,12 +56,6 @@ Future<void> initApp() async {
|
|||||||
|
|
||||||
await openBoxes();
|
await openBoxes();
|
||||||
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
|
||||||
const SystemUiOverlayStyle(
|
|
||||||
statusBarIconBrightness: Brightness.light,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (kReleaseMode && Platform.isAndroid) {
|
if (kReleaseMode && Platform.isAndroid) {
|
||||||
try {
|
try {
|
||||||
await FlutterDisplayMode.setHighRefreshRate();
|
await FlutterDisplayMode.setHighRefreshRate();
|
||||||
|
@ -10,8 +10,11 @@ import 'package:immich_mobile/shared/models/server_info_state.model.dart';
|
|||||||
import 'package:immich_mobile/modules/backup/providers/backup.provider.dart';
|
import 'package:immich_mobile/modules/backup/providers/backup.provider.dart';
|
||||||
import 'package:immich_mobile/shared/providers/server_info.provider.dart';
|
import 'package:immich_mobile/shared/providers/server_info.provider.dart';
|
||||||
|
|
||||||
class ImmichSliverAppBar extends ConsumerWidget {
|
class HomePageAppBar extends ConsumerWidget with PreferredSizeWidget {
|
||||||
const ImmichSliverAppBar({
|
@override
|
||||||
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
||||||
|
|
||||||
|
const HomePageAppBar({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.onPopBack,
|
this.onPopBack,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -25,11 +28,8 @@ class ImmichSliverAppBar extends ConsumerWidget {
|
|||||||
ref.watch(authenticationProvider).deviceInfo.isAutoBackup;
|
ref.watch(authenticationProvider).deviceInfo.isAutoBackup;
|
||||||
final ServerInfoState serverInfoState = ref.watch(serverInfoProvider);
|
final ServerInfoState serverInfoState = ref.watch(serverInfoProvider);
|
||||||
|
|
||||||
return SliverAppBar(
|
return AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
floating: true,
|
|
||||||
pinned: false,
|
|
||||||
snap: false,
|
|
||||||
backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
|
backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
@ -11,7 +11,7 @@ import 'package:immich_mobile/modules/album/services/album.service.dart';
|
|||||||
import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart';
|
import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart';
|
||||||
import 'package:immich_mobile/modules/home/ui/asset_grid/immich_asset_grid.dart';
|
import 'package:immich_mobile/modules/home/ui/asset_grid/immich_asset_grid.dart';
|
||||||
import 'package:immich_mobile/modules/home/ui/control_bottom_app_bar.dart';
|
import 'package:immich_mobile/modules/home/ui/control_bottom_app_bar.dart';
|
||||||
import 'package:immich_mobile/modules/home/ui/immich_sliver_appbar.dart';
|
import 'package:immich_mobile/modules/home/ui/home_page_app_bar.dart';
|
||||||
import 'package:immich_mobile/modules/home/ui/profile_drawer/profile_drawer.dart';
|
import 'package:immich_mobile/modules/home/ui/profile_drawer/profile_drawer.dart';
|
||||||
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
|
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
|
||||||
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
|
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
|
||||||
@ -197,33 +197,19 @@ class HomePage extends HookConsumerWidget {
|
|||||||
top: true,
|
top: true,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
CustomScrollView(
|
ref.watch(assetProvider).renderList == null ||
|
||||||
slivers: [
|
ref.watch(assetProvider).allAssets.isEmpty
|
||||||
if (!multiselectEnabled.state)
|
? buildLoadingIndicator()
|
||||||
ImmichSliverAppBar(
|
: ImmichAssetGrid(
|
||||||
onPopBack: reloadAllAsset,
|
renderList: ref.watch(assetProvider).renderList!,
|
||||||
|
allAssets: ref.watch(assetProvider).allAssets,
|
||||||
|
assetsPerRow: appSettingService
|
||||||
|
.getSetting(AppSettingsEnum.tilesPerRow),
|
||||||
|
showStorageIndicator: appSettingService
|
||||||
|
.getSetting(AppSettingsEnum.storageIndicator),
|
||||||
|
listener: selectionListener,
|
||||||
|
selectionActive: selectionEnabledHook.value,
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: selectionEnabledHook.value ? 0 : 60,
|
|
||||||
bottom: 0.0,
|
|
||||||
),
|
|
||||||
child: ref.watch(assetProvider).renderList == null ||
|
|
||||||
ref.watch(assetProvider).allAssets.isEmpty
|
|
||||||
? buildLoadingIndicator()
|
|
||||||
: ImmichAssetGrid(
|
|
||||||
renderList: ref.watch(assetProvider).renderList!,
|
|
||||||
allAssets: ref.watch(assetProvider).allAssets,
|
|
||||||
assetsPerRow: appSettingService
|
|
||||||
.getSetting(AppSettingsEnum.tilesPerRow),
|
|
||||||
showStorageIndicator: appSettingService
|
|
||||||
.getSetting(AppSettingsEnum.storageIndicator),
|
|
||||||
listener: selectionListener,
|
|
||||||
selectionActive: selectionEnabledHook.value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (selectionEnabledHook.value)
|
if (selectionEnabledHook.value)
|
||||||
ControlBottomAppBar(
|
ControlBottomAppBar(
|
||||||
onShare: onShareAssets,
|
onShare: onShareAssets,
|
||||||
@ -238,6 +224,11 @@ class HomePage extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: multiselectEnabled.state
|
||||||
|
? null
|
||||||
|
: HomePageAppBar(
|
||||||
|
onPopBack: reloadAllAsset,
|
||||||
|
),
|
||||||
drawer: const ProfileDrawer(),
|
drawer: const ProfileDrawer(),
|
||||||
body: buildBody(),
|
body: buildBody(),
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/constants/immich_colors.dart';
|
import 'package:immich_mobile/constants/immich_colors.dart';
|
||||||
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
|
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
|
||||||
@ -41,7 +40,6 @@ ThemeData immichDarkTheme = ThemeData(
|
|||||||
foregroundColor: immichDarkThemePrimaryColor,
|
foregroundColor: immichDarkThemePrimaryColor,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.light,
|
|
||||||
),
|
),
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
type: BottomNavigationBarType.fixed,
|
type: BottomNavigationBarType.fixed,
|
||||||
@ -97,7 +95,6 @@ ThemeData immichLightTheme = ThemeData(
|
|||||||
foregroundColor: Colors.indigo,
|
foregroundColor: Colors.indigo,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
|
||||||
),
|
),
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
type: BottomNavigationBarType.fixed,
|
type: BottomNavigationBarType.fixed,
|
||||||
|
Loading…
Reference in New Issue
Block a user