mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Accent color is no longer used in flutter 2.5
This commit is contained in:
parent
dfb090f02a
commit
c74d430747
12 changed files with 68 additions and 61 deletions
|
@ -222,7 +222,9 @@ class _AlbumBrowserState extends State<AlbumBrowser>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: content,
|
||||
),
|
||||
|
|
|
@ -156,16 +156,11 @@ class _AlbumImporterState extends State<AlbumImporter> {
|
|||
}
|
||||
|
||||
Widget _buildList(BuildContext context, ListImportableAlbumBlocState state) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
child: ListView.separated(
|
||||
itemBuilder: (context, index) =>
|
||||
_buildItem(context, _backingFiles[index]),
|
||||
separatorBuilder: (context, index) => const Divider(),
|
||||
itemCount: _backingFiles.length,
|
||||
),
|
||||
return ListView.separated(
|
||||
itemBuilder: (context, index) =>
|
||||
_buildItem(context, _backingFiles[index]),
|
||||
separatorBuilder: (context, index) => const Divider(),
|
||||
itemCount: _backingFiles.length,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,9 @@ class _ArchiveBrowserState extends State<ArchiveBrowser>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -12,7 +12,6 @@ import 'package:nc_photos/entity/file.dart';
|
|||
import 'package:nc_photos/exception_util.dart' as exception_util;
|
||||
import 'package:nc_photos/k.dart' as k;
|
||||
import 'package:nc_photos/snack_bar_manager.dart';
|
||||
import 'package:nc_photos/theme.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
mixin DirPickerMixin<T extends StatefulWidget> on State<T> {
|
||||
|
@ -78,47 +77,42 @@ mixin DirPickerMixin<T extends StatefulWidget> on State<T> {
|
|||
|
||||
Widget _buildList(BuildContext context, LsDirBlocState state) {
|
||||
final isTopLevel = _currentPath == getPickerRoot();
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
return AnimatedSwitcher(
|
||||
duration: k.animationDurationNormal,
|
||||
// see AnimatedSwitcher.defaultLayoutBuilder
|
||||
layoutBuilder: (currentChild, previousChildren) => Stack(
|
||||
children: <Widget>[
|
||||
...previousChildren,
|
||||
if (currentChild != null) currentChild,
|
||||
],
|
||||
alignment: Alignment.topLeft,
|
||||
),
|
||||
child: AnimatedSwitcher(
|
||||
duration: k.animationDurationNormal,
|
||||
// see AnimatedSwitcher.defaultLayoutBuilder
|
||||
layoutBuilder: (currentChild, previousChildren) => Stack(
|
||||
children: <Widget>[
|
||||
...previousChildren,
|
||||
if (currentChild != null) currentChild,
|
||||
],
|
||||
alignment: Alignment.topLeft,
|
||||
),
|
||||
child: ListView.separated(
|
||||
key: Key(_currentPath),
|
||||
itemBuilder: (context, index) {
|
||||
if (!isTopLevel && index == 0) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: const SizedBox(width: 24),
|
||||
title: Text(L10n.global().rootPickerNavigateUpItemText),
|
||||
onTap: () {
|
||||
try {
|
||||
_navigateInto(File(path: path.dirname(_currentPath)));
|
||||
} catch (e) {
|
||||
SnackBarManager().showSnackBar(SnackBar(
|
||||
content: Text(exception_util.toUserString(e)),
|
||||
duration: k.snackBarDurationNormal,
|
||||
));
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return _buildItem(
|
||||
context, state.items[index - (isTopLevel ? 0 : 1)]);
|
||||
}
|
||||
},
|
||||
separatorBuilder: (context, index) => const Divider(),
|
||||
itemCount: state.items.length + (isTopLevel ? 0 : 1),
|
||||
),
|
||||
child: ListView.separated(
|
||||
key: Key(_currentPath),
|
||||
itemBuilder: (context, index) {
|
||||
if (!isTopLevel && index == 0) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: const SizedBox(width: 24),
|
||||
title: Text(L10n.global().rootPickerNavigateUpItemText),
|
||||
onTap: () {
|
||||
try {
|
||||
_navigateInto(File(path: path.dirname(_currentPath)));
|
||||
} catch (e) {
|
||||
SnackBarManager().showSnackBar(SnackBar(
|
||||
content: Text(exception_util.toUserString(e)),
|
||||
duration: k.snackBarDurationNormal,
|
||||
));
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return _buildItem(
|
||||
context, state.items[index - (isTopLevel ? 0 : 1)]);
|
||||
}
|
||||
},
|
||||
separatorBuilder: (context, index) => const Divider(),
|
||||
itemCount: state.items.length + (isTopLevel ? 0 : 1),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -226,7 +226,9 @@ class _DynamicAlbumBrowserState extends State<DynamicAlbumBrowser>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -109,7 +109,9 @@ class _HomeAlbumsState extends State<HomeAlbums>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -119,7 +119,9 @@ class _HomePhotosState extends State<HomePhotos>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: DraggableScrollbar.semicircle(
|
||||
controller: _scrollController,
|
||||
|
|
|
@ -101,7 +101,9 @@ class _PendingAlbumsState extends State<PendingAlbums> {
|
|||
children: [
|
||||
Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -129,7 +129,9 @@ class _PeopleBrowserState extends State<PeopleBrowser> {
|
|||
children: [
|
||||
Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -128,7 +128,9 @@ class _PersonBrowserState extends State<PersonBrowser>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
|
@ -182,7 +182,7 @@ class _SettingsState extends State<Settings> {
|
|||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).accentColor,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -121,7 +121,9 @@ class _TrashbinBrowserState extends State<TrashbinBrowser>
|
|||
context,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
accentColor: AppTheme.getOverscrollIndicatorColor(context),
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: AppTheme.getOverscrollIndicatorColor(context),
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
|
|
Loading…
Reference in a new issue