minor fixes

This commit is contained in:
Thibault Deckers 2020-03-26 12:50:12 +09:00
parent 8a014888a6
commit 246e697d9d
3 changed files with 87 additions and 82 deletions

View file

@ -46,31 +46,34 @@ class FilterBar extends StatelessWidget implements PreferredSizeWidget {
final label = filter.label; final label = filter.label;
return ConstrainedBox( return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: maxChipWidth), constraints: const BoxConstraints(maxWidth: maxChipWidth),
child: OutlineButton( child: Tooltip(
onPressed: () {}, message: label,
borderSide: BorderSide( child: OutlineButton(
color: stringToColor(label), onPressed: () {},
width: NavigationButton.buttonBorderWidth, borderSide: BorderSide(
), color: stringToColor(label),
shape: RoundedRectangleBorder( width: NavigationButton.buttonBorderWidth,
borderRadius: BorderRadius.circular(42), ),
), shape: RoundedRectangleBorder(
child: Row( borderRadius: BorderRadius.circular(42),
mainAxisSize: MainAxisSize.min, ),
children: [ child: Row(
if (icon != null) ...[ mainAxisSize: MainAxisSize.min,
Icon(icon), children: [
const SizedBox(width: 8), if (icon != null) ...[
], Icon(icon),
Flexible( const SizedBox(width: 8),
child: Text( ],
label, Flexible(
softWrap: false, child: Text(
overflow: TextOverflow.fade, label,
maxLines: 1, softWrap: false,
overflow: TextOverflow.fade,
maxLines: 1,
),
), ),
), ],
], ),
), ),
), ),
); );

View file

@ -38,63 +38,65 @@ class DebugPageState extends State<DebugPage> {
return MediaQueryDataProvider( return MediaQueryDataProvider(
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Info'), title: const Text('Debug'),
), ),
body: Column( body: SafeArea(
crossAxisAlignment: CrossAxisAlignment.start, child: ListView(
children: [ padding: const EdgeInsets.all(8),
const Text('Settings'), children: [
Text('collectionGroupFactor: ${settings.collectionGroupFactor}'), const Text('Settings'),
Text('collectionSortFactor: ${settings.collectionSortFactor}'), Text('collectionGroupFactor: ${settings.collectionGroupFactor}'),
Text('infoMapZoom: ${settings.infoMapZoom}'), Text('collectionSortFactor: ${settings.collectionSortFactor}'),
const Divider(), Text('infoMapZoom: ${settings.infoMapZoom}'),
Text('Entries: ${entries.length}'), const Divider(),
Text('Catalogued: ${catalogued.length}'), Text('Entries: ${entries.length}'),
Text('With GPS: ${withGps.length}'), Text('Catalogued: ${catalogued.length}'),
Text('With address: ${located.length}'), Text('With GPS: ${withGps.length}'),
const Divider(), Text('With address: ${located.length}'),
RaisedButton( const Divider(),
onPressed: () async { RaisedButton(
await metadataDb.reset(); onPressed: () async {
_startDbReport(); await metadataDb.reset();
}, _startDbReport();
child: const Text('Reset DB'), },
), child: const Text('Reset DB'),
FutureBuilder( ),
future: _dbFileSizeLoader, FutureBuilder(
builder: (context, AsyncSnapshot<int> snapshot) { future: _dbFileSizeLoader,
if (snapshot.hasError) return Text(snapshot.error.toString()); builder: (context, AsyncSnapshot<int> snapshot) {
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.hasError) return Text(snapshot.error.toString());
return Text('DB file size: ${formatFilesize(snapshot.data)}'); if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
}, return Text('DB file size: ${formatFilesize(snapshot.data)}');
), },
FutureBuilder( ),
future: _dbMetadataLoader, FutureBuilder(
builder: (context, AsyncSnapshot<List<CatalogMetadata>> snapshot) { future: _dbMetadataLoader,
if (snapshot.hasError) return Text(snapshot.error.toString()); builder: (context, AsyncSnapshot<List<CatalogMetadata>> snapshot) {
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.hasError) return Text(snapshot.error.toString());
return Text('DB metadata rows: ${snapshot.data.length}'); if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
}, return Text('DB metadata rows: ${snapshot.data.length}');
), },
FutureBuilder( ),
future: _dbAddressLoader, FutureBuilder(
builder: (context, AsyncSnapshot<List<AddressDetails>> snapshot) { future: _dbAddressLoader,
if (snapshot.hasError) return Text(snapshot.error.toString()); builder: (context, AsyncSnapshot<List<AddressDetails>> snapshot) {
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.hasError) return Text(snapshot.error.toString());
return Text('DB address rows: ${snapshot.data.length}'); if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
}, return Text('DB address rows: ${snapshot.data.length}');
), },
const Divider(), ),
const Text('Time dilation'), const Divider(),
Slider( const Text('Time dilation'),
value: timeDilation, Slider(
onChanged: (v) => setState(() => timeDilation = v), value: timeDilation,
min: 1.0, onChanged: (v) => setState(() => timeDilation = v),
max: 10.0, min: 1.0,
divisions: 9, max: 10.0,
label: '$timeDilation', divisions: 9,
), label: '$timeDilation',
], ),
],
),
), ),
), ),
); );

View file

@ -40,7 +40,7 @@ class FullscreenTopOverlay extends StatelessWidget {
OverlayButton( OverlayButton(
scale: scale, scale: scale,
child: IconButton( child: IconButton(
icon: Icon(OMIcons.share), icon: const Icon(OMIcons.share),
onPressed: () => onActionSelected?.call(FullscreenAction.share), onPressed: () => onActionSelected?.call(FullscreenAction.share),
tooltip: 'Share', tooltip: 'Share',
), ),
@ -50,7 +50,7 @@ class FullscreenTopOverlay extends StatelessWidget {
OverlayButton( OverlayButton(
scale: scale, scale: scale,
child: IconButton( child: IconButton(
icon: Icon(OMIcons.delete), icon: const Icon(OMIcons.delete),
onPressed: () => onActionSelected?.call(FullscreenAction.delete), onPressed: () => onActionSelected?.call(FullscreenAction.delete),
tooltip: 'Delete', tooltip: 'Delete',
), ),