Minor refactor

This commit is contained in:
Vishnu Mohandas 2020-06-06 19:54:00 +05:30
parent 8c92ac15bb
commit 526f755875

View file

@ -69,16 +69,7 @@ class _HomeWidgetState extends State<HomeWidget> {
if (snapshot.hasData) {
return IndexedStack(
children: <Widget>[
Gallery(
_getFilteredPhotos(PhotoRepository.instance.photos),
_selectedPhotos,
photoSelectionChangeCallback: (Set<Photo> selectedPhotos) {
setState(() {
_selectedPhotos = selectedPhotos;
});
},
enablePullToSync: true,
),
_getMainGalleryWidget(),
_deviceFolderGalleryWidget,
_remoteFolderGalleryWidget,
],
@ -112,6 +103,19 @@ class _HomeWidgetState extends State<HomeWidget> {
);
}
Gallery _getMainGalleryWidget() {
return Gallery(
_getFilteredPhotos(PhotoRepository.instance.photos),
_selectedPhotos,
photoSelectionChangeCallback: (Set<Photo> selectedPhotos) {
setState(() {
_selectedPhotos = selectedPhotos;
});
},
enablePullToSync: true,
);
}
BottomNavigationBar _buildBottomNavigationBar() {
return BottomNavigationBar(
items: const <BottomNavigationBarItem>[