Move location of the settings button

This commit is contained in:
Vishnu Mohandas 2021-02-05 21:37:03 +05:30
parent 9ca222300e
commit 5c019c8db0
2 changed files with 18 additions and 9 deletions

View file

@ -156,15 +156,23 @@ class _HomeWidgetState extends State<HomeWidget> {
builder: (context, snapshot) {
if (snapshot.hasData) {
final headerWidgets = List<Widget>();
if (_selectedFiles.files.isEmpty &&
Configuration.instance.hasConfiguredAccount()) {
headerWidgets.add(_settingsButton);
}
headerWidgets.addAll([
_syncIndicator,
_signInHeader,
_memoriesWidget,
]);
var header;
if (_selectedFiles.files.isEmpty &&
Configuration.instance.hasConfiguredAccount()) {
header = Container(
margin: EdgeInsets.only(top: 12),
child: Stack(
children: [_settingsButton, Column(children: headerWidgets)],
),
);
} else {
header = Column(children: headerWidgets);
}
return Gallery(
syncLoader: () {
return _getFilteredPhotos(FileRepository.instance.files);
@ -172,9 +180,7 @@ class _HomeWidgetState extends State<HomeWidget> {
reloadEvent: Bus.instance.on<LocalPhotosUpdatedEvent>(),
tagPrefix: "home_gallery",
selectedFiles: _selectedFiles,
headerWidget: Column(
children: headerWidgets,
),
headerWidget: header,
);
} else if (snapshot.hasError) {
return Center(child: Text(snapshot.error.toString()));

View file

@ -10,8 +10,11 @@ class SettingsButton extends StatelessWidget {
return Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(Icons.settings),
padding: EdgeInsets.fromLTRB(16, 18, 16, 18),
icon: Icon(
Icons.settings,
color: Colors.white60,
),
padding: EdgeInsets.fromLTRB(16, 4, 16, 18),
onPressed: () async {
Navigator.of(context).push(
MaterialPageRoute(