mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(mobile): Upgrade to Flutter 3.7 (#1416)
This commit is contained in:
parent
ad9373312b
commit
09ab06ae6c
29 changed files with 1307 additions and 706 deletions
|
|
@ -92,11 +92,10 @@ class ImmichAssetGridState extends State<ImmichAssetGrid> {
|
|||
RenderAssetGridRow row,
|
||||
bool scrolling,
|
||||
) {
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final size = constraints.maxWidth / widget.assetsPerRow -
|
||||
widget.margin * (widget.assetsPerRow - 1) / widget.assetsPerRow;
|
||||
widget.margin * (widget.assetsPerRow - 1) / widget.assetsPerRow;
|
||||
return Row(
|
||||
key: Key("asset-row-${row.assets.first.id}"),
|
||||
children: row.assets.mapIndexed((int index, Asset asset) {
|
||||
|
|
@ -141,7 +140,7 @@ class ImmichAssetGridState extends State<ImmichAssetGrid> {
|
|||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).textTheme.headline1?.color,
|
||||
color: Theme.of(context).textTheme.displayLarge?.color,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class MonthlyTitleText extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).textTheme.headline1?.color,
|
||||
color: Theme.of(context).textTheme.displayLarge?.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/album/ui/add_to_album_sliverlist.dart';
|
||||
import 'package:immich_mobile/modules/home/ui/delete_diaglog.dart';
|
||||
import 'package:immich_mobile/modules/home/ui/delete_dialog.dart';
|
||||
import 'package:immich_mobile/shared/ui/drag_sheet.dart';
|
||||
import 'package:immich_mobile/shared/models/album.dart';
|
||||
|
||||
|
|
@ -29,6 +29,8 @@ class ControlBottomAppBar extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
var isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
Widget renderActionButtons() {
|
||||
return Row(
|
||||
children: [
|
||||
|
|
@ -60,7 +62,6 @@ class ControlBottomAppBar extends ConsumerWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
@ -75,7 +76,9 @@ class ControlBottomAppBar extends ConsumerWidget {
|
|||
ScrollController scrollController,
|
||||
) {
|
||||
return Card(
|
||||
elevation: 12.0,
|
||||
color: isDarkMode ? Colors.grey[900] : Colors.grey[100],
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 18.0,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
|
|
@ -83,45 +86,37 @@ class ControlBottomAppBar extends ConsumerWidget {
|
|||
),
|
||||
),
|
||||
margin: const EdgeInsets.all(0),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
child: CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 12),
|
||||
const CustomDraggingHandle(),
|
||||
const SizedBox(height: 12),
|
||||
renderActionButtons(),
|
||||
const Divider(
|
||||
indent: 16,
|
||||
endIndent: 16,
|
||||
thickness: 1,
|
||||
),
|
||||
AddToAlbumTitleRow(onCreateNewAlbum: onCreateNewAlbum),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 12),
|
||||
const CustomDraggingHandle(),
|
||||
const SizedBox(height: 12),
|
||||
renderActionButtons(),
|
||||
const Divider(
|
||||
indent: 16,
|
||||
endIndent: 16,
|
||||
thickness: 1,
|
||||
),
|
||||
AddToAlbumTitleRow(onCreateNewAlbum: onCreateNewAlbum),
|
||||
],
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: AddToAlbumSliverList(
|
||||
albums: albums,
|
||||
sharedAlbums: sharedAlbums,
|
||||
onAddToAlbum: onAddToAlbum,
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: AddToAlbumSliverList(
|
||||
albums: albums,
|
||||
sharedAlbums: sharedAlbums,
|
||||
onAddToAlbum: onAddToAlbum,
|
||||
),
|
||||
),
|
||||
const SliverToBoxAdapter(
|
||||
child: SizedBox(height: 200),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SliverToBoxAdapter(
|
||||
child: SizedBox(height: 200),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/login/providers/authentication.provider.dart';
|
||||
|
|
@ -29,7 +28,6 @@ class HomePageAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|||
final ServerInfoState serverInfoState = ref.watch(serverInfoProvider);
|
||||
|
||||
return AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
|
|
@ -44,10 +42,9 @@ class HomePageAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|||
top: 5,
|
||||
child: IconButton(
|
||||
splashRadius: 25,
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.face_outlined,
|
||||
size: 30,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).openDrawer();
|
||||
|
|
@ -112,16 +109,13 @@ class HomePageAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|||
splashRadius: 25,
|
||||
iconSize: 30,
|
||||
icon: isEnableAutoBackup
|
||||
? Icon(
|
||||
? const Icon(
|
||||
Icons.backup_rounded,
|
||||
color: Theme.of(context).primaryColor,
|
||||
)
|
||||
: Badge(
|
||||
padding: const EdgeInsets.all(4),
|
||||
elevation: 3,
|
||||
position: BadgePosition.bottomEnd(bottom: -4, end: -4),
|
||||
badgeColor: Colors.white,
|
||||
badgeContent: const Icon(
|
||||
backgroundColor: Colors.white,
|
||||
label: const Icon(
|
||||
Icons.cloud_off_rounded,
|
||||
size: 8,
|
||||
color: Colors.indigo,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class ProfileDrawer extends HookConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
buildSignoutButton() {
|
||||
buildSignOutButton() {
|
||||
return ListTile(
|
||||
horizontalTitleGap: 0,
|
||||
leading: SizedBox(
|
||||
|
|
@ -95,6 +95,9 @@ class ProfileDrawer extends HookConsumerWidget {
|
|||
}
|
||||
|
||||
return Drawer(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.zero,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
|
@ -105,7 +108,7 @@ class ProfileDrawer extends HookConsumerWidget {
|
|||
const ProfileDrawerHeader(),
|
||||
buildSettingButton(),
|
||||
buildAppLogButton(),
|
||||
buildSignoutButton(),
|
||||
buildSignOutButton(),
|
||||
],
|
||||
),
|
||||
const ServerInfoBox()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class ProfileDrawerHeader extends HookConsumerWidget {
|
|||
AuthenticationState authState = ref.watch(authenticationProvider);
|
||||
final uploadProfileImageStatus =
|
||||
ref.watch(uploadProfileImageProvider).status;
|
||||
var dummmy = Random().nextInt(1024);
|
||||
var dummy = Random().nextInt(1024);
|
||||
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
buildUserProfileImage() {
|
||||
|
|
@ -39,7 +39,7 @@ class ProfileDrawerHeader extends HookConsumerWidget {
|
|||
return CircleAvatar(
|
||||
radius: 35,
|
||||
backgroundImage: NetworkImage(
|
||||
'$endpoint/user/profile-image/${authState.userId}?d=${dummmy++}',
|
||||
'$endpoint/user/profile-image/${authState.userId}?d=${dummy++}',
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
|
|
@ -56,7 +56,7 @@ class ProfileDrawerHeader extends HookConsumerWidget {
|
|||
return CircleAvatar(
|
||||
radius: 35,
|
||||
backgroundImage: NetworkImage(
|
||||
'$endpoint/user/profile-image/${authState.userId}?d=${dummmy++}',
|
||||
'$endpoint/user/profile-image/${authState.userId}?d=${dummy++}',
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue