minor fixes
This commit is contained in:
parent
51ff287dcd
commit
ea082ea9e6
5 changed files with 124 additions and 106 deletions
|
@ -1,4 +1,6 @@
|
|||
import 'package:aves/widgets/common/extensions/media_query.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class EmptyContent extends StatelessWidget {
|
||||
final IconData? icon;
|
||||
|
@ -17,28 +19,33 @@ class EmptyContent extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const color = Colors.blueGrey;
|
||||
return Align(
|
||||
alignment: alignment,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(
|
||||
icon,
|
||||
size: 64,
|
||||
color: color,
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: context.select<MediaQueryData, double>((mq) => mq.effectiveBottomPadding),
|
||||
),
|
||||
child: Align(
|
||||
alignment: alignment,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(
|
||||
icon,
|
||||
size: 64,
|
||||
color: color,
|
||||
),
|
||||
const SizedBox(height: 16)
|
||||
],
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16)
|
||||
],
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -284,6 +284,7 @@ class _MapPageContentState extends State<MapPageContent> with SingleTickerProvid
|
|||
return regionCollection != null && regionCollection.isEmpty
|
||||
? EmptyContent(
|
||||
text: context.l10n.mapEmptyRegion,
|
||||
alignment: Alignment.center,
|
||||
fontSize: 18,
|
||||
)
|
||||
: const SizedBox();
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:aves/services/common/services.dart';
|
|||
import 'package:aves/theme/icons.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StorageAccessTile extends StatelessWidget {
|
||||
|
@ -47,12 +48,13 @@ class _StorageAccessPageState extends State<StorageAccessPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(context.l10n.settingsStorageAccessTitle),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: FutureBuilder<List<String>>(
|
||||
return MediaQueryDataProvider(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(context.l10n.settingsStorageAccessTitle),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: FutureBuilder<List<String>>(
|
||||
future: _pathLoader,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
|
@ -99,7 +101,9 @@ class _StorageAccessPageState extends State<StorageAccessPage> {
|
|||
)),
|
||||
],
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:aves/widgets/common/basic/menu.dart';
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||
import 'package:aves/widgets/settings/privacy/file_picker/crumb_line.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
@ -61,76 +62,78 @@ class _FilePickerState extends State<FilePicker> {
|
|||
setState(() {});
|
||||
return SynchronousFuture(false);
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(_getTitle(context)),
|
||||
actions: [
|
||||
MenuIconTheme(
|
||||
child: PopupMenuButton<_PickerAction>(
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
value: _PickerAction.toggleHiddenView,
|
||||
child: MenuRow(text: showHidden ? l10n.filePickerDoNotShowHiddenFiles : l10n.filePickerShowHiddenFiles),
|
||||
),
|
||||
];
|
||||
},
|
||||
onSelected: (action) async {
|
||||
// wait for the popup menu to hide before proceeding with the action
|
||||
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
|
||||
switch (action) {
|
||||
case _PickerAction.toggleHiddenView:
|
||||
settings.filePickerShowHiddenFiles = !showHidden;
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
drawer: _buildDrawer(context),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: kMinInteractiveDimension,
|
||||
child: CrumbLine(
|
||||
directory: _directory,
|
||||
onTap: (path) {
|
||||
_goTo(path);
|
||||
setState(() {});
|
||||
child: MediaQueryDataProvider(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(_getTitle(context)),
|
||||
actions: [
|
||||
MenuIconTheme(
|
||||
child: PopupMenuButton<_PickerAction>(
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
value: _PickerAction.toggleHiddenView,
|
||||
child: MenuRow(text: showHidden ? l10n.filePickerDoNotShowHiddenFiles : l10n.filePickerShowHiddenFiles),
|
||||
),
|
||||
];
|
||||
},
|
||||
onSelected: (action) async {
|
||||
// wait for the popup menu to hide before proceeding with the action
|
||||
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
|
||||
switch (action) {
|
||||
case _PickerAction.toggleHiddenView:
|
||||
settings.filePickerShowHiddenFiles = !showHidden;
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
Expanded(
|
||||
child: visibleContents == null
|
||||
? const SizedBox()
|
||||
: visibleContents.isEmpty
|
||||
? Center(
|
||||
child: EmptyContent(
|
||||
icon: AIcons.folder,
|
||||
text: l10n.filePickerNoItems,
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: visibleContents.length,
|
||||
itemBuilder: (context, index) {
|
||||
return index < visibleContents.length ? _buildContentLine(context, visibleContents[index]) : const SizedBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: AvesOutlinedButton(
|
||||
label: l10n.filePickerUseThisFolder,
|
||||
onPressed: () => Navigator.pop(context, currentDirectoryPath),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
drawer: _buildDrawer(context),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: kMinInteractiveDimension,
|
||||
child: CrumbLine(
|
||||
directory: _directory,
|
||||
onTap: (path) {
|
||||
_goTo(path);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
Expanded(
|
||||
child: visibleContents == null
|
||||
? const SizedBox()
|
||||
: visibleContents.isEmpty
|
||||
? Center(
|
||||
child: EmptyContent(
|
||||
icon: AIcons.folder,
|
||||
text: l10n.filePickerNoItems,
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: visibleContents.length,
|
||||
itemBuilder: (context, index) {
|
||||
return index < visibleContents.length ? _buildContentLine(context, visibleContents[index]) : const SizedBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: AvesOutlinedButton(
|
||||
label: l10n.filePickerUseThisFolder,
|
||||
onPressed: () => Navigator.pop(context, currentDirectoryPath),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:aves/model/entry.dart';
|
|||
import 'package:aves/theme/icons.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/embedded_data_opener.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir_tile.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_section.dart';
|
||||
|
@ -54,7 +55,7 @@ class InfoSearchDelegate extends SearchDelegate {
|
|||
final l10n = context.l10n;
|
||||
final suggestions = {
|
||||
l10n.viewerInfoSearchSuggestionDate: 'date or time or when -timer -uptime -exposure -timeline',
|
||||
l10n.viewerInfoSearchSuggestionDescription: 'abstract or description or comment or textual',
|
||||
l10n.viewerInfoSearchSuggestionDescription: 'abstract or description or comment or textual or title',
|
||||
l10n.viewerInfoSearchSuggestionDimensions: 'width or height or dimension or framesize or imagelength',
|
||||
l10n.viewerInfoSearchSuggestionResolution: 'resolution',
|
||||
l10n.viewerInfoSearchSuggestionRights: 'rights or copyright or attribution or license or artist or creator or by-line or credit -tool',
|
||||
|
@ -104,20 +105,22 @@ class InfoSearchDelegate extends SearchDelegate {
|
|||
showThumbnails: false,
|
||||
))
|
||||
.toList();
|
||||
return SafeArea(
|
||||
child: tiles.isEmpty
|
||||
? EmptyContent(
|
||||
icon: AIcons.info,
|
||||
text: context.l10n.viewerInfoSearchEmpty,
|
||||
)
|
||||
: EmbeddedDataOpener(
|
||||
entry: entry,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(8),
|
||||
itemBuilder: (context, index) => tiles[index],
|
||||
itemCount: tiles.length,
|
||||
return MediaQueryDataProvider(
|
||||
child: SafeArea(
|
||||
child: tiles.isEmpty
|
||||
? EmptyContent(
|
||||
icon: AIcons.info,
|
||||
text: context.l10n.viewerInfoSearchEmpty,
|
||||
)
|
||||
: EmbeddedDataOpener(
|
||||
entry: entry,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(8),
|
||||
itemBuilder: (context, index) => tiles[index],
|
||||
itemCount: tiles.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue