Created SettingsScreen
Signed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
parent
32432bb138
commit
ddf9e981fd
89
lib/screens/settings_screen.dart
Normal file
89
lib/screens/settings_screen.dart
Normal file
@ -0,0 +1,89 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||
import 'package:time_progress_tracker/app.dart';
|
||||
import 'package:time_progress_tracker/widgets/buttons/color_picker_btn.dart';
|
||||
import 'package:time_progress_tracker/widgets/home/tabs/settings/duration_settings_widget.dart';
|
||||
import 'package:time_progress_tracker/widgets/store_connectors/settings_store_connector.dart';
|
||||
|
||||
class SettingsScreen extends StatelessWidget {
|
||||
Widget _renderColorSettings(
|
||||
BuildContext context, SettingsViewModel settingsVm) {
|
||||
ThemeData appTheme = Theme.of(context);
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: PlatformText(
|
||||
"Color Settings",
|
||||
style: appTheme.primaryTextTheme.caption,
|
||||
)),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
child: ColorPickerButton(
|
||||
title: "Done Color",
|
||||
dialogTitle: "Select Done Color",
|
||||
selectedColor: settingsVm.appSettings.doneColor,
|
||||
onColorPicked: settingsVm.updateDoneColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: ColorPickerButton(
|
||||
title: "Left Color",
|
||||
dialogTitle: "Select Left Color",
|
||||
selectedColor: settingsVm.appSettings.leftColor,
|
||||
onColorPicked: settingsVm.updateLeftColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsStoreConnector(loadedBuilder: (context, settingsVm) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _renderColorSettings(context, settingsVm),
|
||||
),
|
||||
Expanded(
|
||||
child: DurationSettingsWidget(
|
||||
duration: settingsVm.appSettings.duration,
|
||||
updateDuration: settingsVm.updateDuration,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Expanded(
|
||||
child: PlatformButton(
|
||||
onPressed: () {
|
||||
showAboutDialog(
|
||||
context: context,
|
||||
applicationName: TimeProgressTrackerApp.name,
|
||||
applicationVersion: "Beta",
|
||||
applicationLegalese:
|
||||
'\u00a9Andreas Fahrecker 2020-2021');
|
||||
},
|
||||
child: Text("About"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user