aves/lib/widgets/album/collection_page.dart
Thibault Deckers 67f873b3f5 navigation: tap back twice to exit
refactored selection dialogs
2020-09-01 14:48:56 +09:00

42 lines
1.3 KiB
Dart

import 'package:aves/model/source/collection_lens.dart';
import 'package:aves/widgets/album/thumbnail_collection.dart';
import 'package:aves/widgets/app_drawer.dart';
import 'package:aves/widgets/common/data_providers/media_query_data_provider.dart';
import 'package:aves/widgets/common/double_back_pop.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class CollectionPage extends StatelessWidget {
final CollectionLens collection;
const CollectionPage(this.collection);
@override
Widget build(BuildContext context) {
return MediaQueryDataProvider(
child: ChangeNotifierProvider<CollectionLens>.value(
value: collection,
child: Scaffold(
body: WillPopScope(
onWillPop: () {
if (collection.isSelecting) {
collection.clearSelection();
collection.browse();
return SynchronousFuture(false);
}
return SynchronousFuture(true);
},
child: DoubleBackPopScope(
child: ThumbnailCollection(),
),
),
drawer: AppDrawer(
source: collection.source,
),
resizeToAvoidBottomInset: false,
),
),
);
}
}