Cleaned up the repo
Singed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
56
lib/ui/settings/color_settings_widget.dart
Normal file
56
lib/ui/settings/color_settings_widget.dart
Normal file
@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:time_progress_tracker/ui/buttons/color_picker_btn.dart';
|
||||
|
||||
class ColorSettingsWidget extends StatelessWidget {
|
||||
final Color doneColor, leftColor;
|
||||
final void Function(Color) updateDoneColor, updateLeftColor;
|
||||
|
||||
ColorSettingsWidget({
|
||||
@required this.doneColor,
|
||||
@required this.leftColor,
|
||||
@required this.updateDoneColor,
|
||||
@required this.updateLeftColor,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ThemeData appTheme = Theme.of(context);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Color Settings",
|
||||
style: appTheme.textTheme.headline6,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
child: ColorPickerButton(
|
||||
title: "Done Color",
|
||||
dialogTitle: "Select Done Color",
|
||||
selectedColor: doneColor,
|
||||
onColorPicked: updateDoneColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: ColorPickerButton(
|
||||
title: "Left Color",
|
||||
dialogTitle: "Select Left Color",
|
||||
selectedColor: leftColor,
|
||||
onColorPicked: updateLeftColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
41
lib/ui/settings/duration_settings_widget.dart
Normal file
41
lib/ui/settings/duration_settings_widget.dart
Normal file
@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:time_progress_tracker/ui/buttons/select_duration_btn.dart';
|
||||
|
||||
class DurationSettingsWidget extends StatelessWidget {
|
||||
final Duration duration;
|
||||
final void Function(Duration) updateDuration;
|
||||
|
||||
DurationSettingsWidget({
|
||||
@required this.duration,
|
||||
@required this.updateDuration,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ThemeData appTheme = Theme.of(context);
|
||||
|
||||
int years = duration.inDays ~/ 365;
|
||||
int months = (duration.inDays - (365 * years)) ~/ 30;
|
||||
int days = duration.inDays - (365 * years) - (30 * months);
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Duration Settings",
|
||||
style: appTheme.textTheme.headline6,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SelectDurationBtn(
|
||||
duration: duration,
|
||||
updateDuration: updateDuration,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user