Refactor home widget

This commit is contained in:
Vishnu Mohandas 2020-04-27 16:43:35 +05:30
parent e800f27a60
commit 5b14f3ca6e

View file

@ -25,38 +25,34 @@ class _HomeWidgetState extends State<HomeWidget> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: widget.title,
theme: ThemeData.dark(),
home: Scaffold(
appBar: GalleryAppBarWidget(
widget.title,
_selectedPhotos,
onSelectionClear: () {
setState(() {
_selectedPhotos.clear();
});
},
),
bottomNavigationBar: _buildBottomNavigationBar(),
body: IndexedStack(
children: <Widget>[
GalleryContainer(
photoSelectionChangeCallback: (Set<Photo> selectedPhotos) {
setState(() {
_selectedPhotos = selectedPhotos;
});
},
),
ChangeNotifierBuilder(
value: photoLoader,
builder: (_, __) {
return AlbumListWidget(photoLoader.photos);
},
)
],
index: _selectedNavBarItem,
),
return Scaffold(
appBar: GalleryAppBarWidget(
widget.title,
_selectedPhotos,
onSelectionClear: () {
setState(() {
_selectedPhotos.clear();
});
},
),
bottomNavigationBar: _buildBottomNavigationBar(),
body: IndexedStack(
children: <Widget>[
GalleryContainer(
photoSelectionChangeCallback: (Set<Photo> selectedPhotos) {
setState(() {
_selectedPhotos = selectedPhotos;
});
},
),
ChangeNotifierBuilder(
value: photoLoader,
builder: (_, __) {
return AlbumListWidget(photoLoader.photos);
},
)
],
index: _selectedNavBarItem,
),
);
}