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:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class EmptyContent extends StatelessWidget {
|
class EmptyContent extends StatelessWidget {
|
||||||
final IconData? icon;
|
final IconData? icon;
|
||||||
|
@ -17,28 +19,33 @@ class EmptyContent extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
const color = Colors.blueGrey;
|
const color = Colors.blueGrey;
|
||||||
return Align(
|
return Padding(
|
||||||
alignment: alignment,
|
padding: EdgeInsets.only(
|
||||||
child: Column(
|
bottom: context.select<MediaQueryData, double>((mq) => mq.effectiveBottomPadding),
|
||||||
mainAxisSize: MainAxisSize.min,
|
),
|
||||||
children: [
|
child: Align(
|
||||||
if (icon != null) ...[
|
alignment: alignment,
|
||||||
Icon(
|
child: Column(
|
||||||
icon,
|
mainAxisSize: MainAxisSize.min,
|
||||||
size: 64,
|
children: [
|
||||||
color: color,
|
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
|
return regionCollection != null && regionCollection.isEmpty
|
||||||
? EmptyContent(
|
? EmptyContent(
|
||||||
text: context.l10n.mapEmptyRegion,
|
text: context.l10n.mapEmptyRegion,
|
||||||
|
alignment: Alignment.center,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
)
|
)
|
||||||
: const SizedBox();
|
: const SizedBox();
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:aves/services/common/services.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/empty.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';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class StorageAccessTile extends StatelessWidget {
|
class StorageAccessTile extends StatelessWidget {
|
||||||
|
@ -47,12 +48,13 @@ class _StorageAccessPageState extends State<StorageAccessPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return MediaQueryDataProvider(
|
||||||
appBar: AppBar(
|
child: Scaffold(
|
||||||
title: Text(context.l10n.settingsStorageAccessTitle),
|
appBar: AppBar(
|
||||||
),
|
title: Text(context.l10n.settingsStorageAccessTitle),
|
||||||
body: SafeArea(
|
),
|
||||||
child: FutureBuilder<List<String>>(
|
body: SafeArea(
|
||||||
|
child: FutureBuilder<List<String>>(
|
||||||
future: _pathLoader,
|
future: _pathLoader,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasError) {
|
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/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/buttons.dart';
|
import 'package:aves/widgets/common/identity/buttons.dart';
|
||||||
import 'package:aves/widgets/common/identity/empty.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:aves/widgets/settings/privacy/file_picker/crumb_line.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
@ -61,76 +62,78 @@ class _FilePickerState extends State<FilePicker> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
return SynchronousFuture(false);
|
return SynchronousFuture(false);
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: MediaQueryDataProvider(
|
||||||
appBar: AppBar(
|
child: Scaffold(
|
||||||
title: Text(_getTitle(context)),
|
appBar: AppBar(
|
||||||
actions: [
|
title: Text(_getTitle(context)),
|
||||||
MenuIconTheme(
|
actions: [
|
||||||
child: PopupMenuButton<_PickerAction>(
|
MenuIconTheme(
|
||||||
itemBuilder: (context) {
|
child: PopupMenuButton<_PickerAction>(
|
||||||
return [
|
itemBuilder: (context) {
|
||||||
PopupMenuItem(
|
return [
|
||||||
value: _PickerAction.toggleHiddenView,
|
PopupMenuItem(
|
||||||
child: MenuRow(text: showHidden ? l10n.filePickerDoNotShowHiddenFiles : l10n.filePickerShowHiddenFiles),
|
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
|
onSelected: (action) async {
|
||||||
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
|
// wait for the popup menu to hide before proceeding with the action
|
||||||
switch (action) {
|
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
|
||||||
case _PickerAction.toggleHiddenView:
|
switch (action) {
|
||||||
settings.filePickerShowHiddenFiles = !showHidden;
|
case _PickerAction.toggleHiddenView:
|
||||||
setState(() {});
|
settings.filePickerShowHiddenFiles = !showHidden;
|
||||||
break;
|
setState(() {});
|
||||||
}
|
break;
|
||||||
},
|
}
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
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/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/empty.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/embedded/embedded_data_opener.dart';
|
||||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir_tile.dart';
|
import 'package:aves/widgets/viewer/info/metadata/metadata_dir_tile.dart';
|
||||||
import 'package:aves/widgets/viewer/info/metadata/metadata_section.dart';
|
import 'package:aves/widgets/viewer/info/metadata/metadata_section.dart';
|
||||||
|
@ -54,7 +55,7 @@ class InfoSearchDelegate extends SearchDelegate {
|
||||||
final l10n = context.l10n;
|
final l10n = context.l10n;
|
||||||
final suggestions = {
|
final suggestions = {
|
||||||
l10n.viewerInfoSearchSuggestionDate: 'date or time or when -timer -uptime -exposure -timeline',
|
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.viewerInfoSearchSuggestionDimensions: 'width or height or dimension or framesize or imagelength',
|
||||||
l10n.viewerInfoSearchSuggestionResolution: 'resolution',
|
l10n.viewerInfoSearchSuggestionResolution: 'resolution',
|
||||||
l10n.viewerInfoSearchSuggestionRights: 'rights or copyright or attribution or license or artist or creator or by-line or credit -tool',
|
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,
|
showThumbnails: false,
|
||||||
))
|
))
|
||||||
.toList();
|
.toList();
|
||||||
return SafeArea(
|
return MediaQueryDataProvider(
|
||||||
child: tiles.isEmpty
|
child: SafeArea(
|
||||||
? EmptyContent(
|
child: tiles.isEmpty
|
||||||
icon: AIcons.info,
|
? EmptyContent(
|
||||||
text: context.l10n.viewerInfoSearchEmpty,
|
icon: AIcons.info,
|
||||||
)
|
text: context.l10n.viewerInfoSearchEmpty,
|
||||||
: EmbeddedDataOpener(
|
)
|
||||||
entry: entry,
|
: EmbeddedDataOpener(
|
||||||
child: ListView.builder(
|
entry: entry,
|
||||||
padding: const EdgeInsets.all(8),
|
child: ListView.builder(
|
||||||
itemBuilder: (context, index) => tiles[index],
|
padding: const EdgeInsets.all(8),
|
||||||
itemCount: tiles.length,
|
itemBuilder: (context, index) => tiles[index],
|
||||||
|
itemCount: tiles.length,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue