Fixed Simple Problem, that occured after migrating to new version.
Still WIP need to fix more Problems
This commit is contained in:
@ -7,7 +7,7 @@ class ColorPickerButton extends StatelessWidget {
|
||||
final Color selectedColor;
|
||||
final void Function(Color) onColorPicked;
|
||||
|
||||
ColorPickerButton({
|
||||
const ColorPickerButton({super.key,
|
||||
@required this.title,
|
||||
@required this.dialogTitle,
|
||||
@required this.selectedColor,
|
||||
@ -34,13 +34,13 @@ class ColorPickerButton extends StatelessWidget {
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text(title),
|
||||
style: TextButton.styleFrom(
|
||||
primary: useBrightBackground(selectedColor)
|
||||
? appTheme.primaryTextTheme.button.color
|
||||
: appTheme.textTheme.button.color,
|
||||
? appTheme.primaryTextTheme.labelLarge.color
|
||||
: appTheme.textTheme.labelLarge.color,
|
||||
backgroundColor: selectedColor,
|
||||
),
|
||||
child: Text(title),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -4,15 +4,17 @@ import 'package:time_progress_tracker/screens/progress_creation_screen.dart';
|
||||
class CreateProgressButton extends StatelessWidget {
|
||||
final String _heroTag = "createProgressBTN";
|
||||
|
||||
const CreateProgressButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void _onButtonPressed() =>
|
||||
void onButtonPressed() =>
|
||||
Navigator.pushNamed(context, ProgressCreationScreen.routeName);
|
||||
|
||||
return FloatingActionButton(
|
||||
heroTag: _heroTag,
|
||||
child: Icon(Icons.add),
|
||||
onPressed: _onButtonPressed,
|
||||
onPressed: onButtonPressed,
|
||||
child: const Icon(Icons.add),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ class DatePickerBtn extends StatelessWidget {
|
||||
final DateTime pickedDate;
|
||||
final void Function(DateTime) onDatePicked;
|
||||
|
||||
DatePickerBtn({
|
||||
const DatePickerBtn({super.key,
|
||||
@required this.leadingString,
|
||||
@required this.pickedDate,
|
||||
@required this.onDatePicked,
|
||||
}) : super();
|
||||
});
|
||||
|
||||
void _onButtonPressed(BuildContext context) async {
|
||||
onDatePicked(await showDatePicker(
|
||||
@ -25,12 +25,12 @@ class DatePickerBtn extends StatelessWidget {
|
||||
ThemeData appTheme = Theme.of(context);
|
||||
return TextButton(
|
||||
onPressed: () => _onButtonPressed(context),
|
||||
child: Text(
|
||||
"$leadingString ${pickedDate.toLocal().toString().split(" ")[0]}"),
|
||||
style: TextButton.styleFrom(
|
||||
primary: appTheme.primaryTextTheme.button.color,
|
||||
primary: appTheme.primaryTextTheme.labelLarge.color,
|
||||
backgroundColor: appTheme.accentColor,
|
||||
),
|
||||
child: Text(
|
||||
"$leadingString ${pickedDate.toLocal().toString().split(" ")[0]}"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,8 @@ class SelectDurationBtn extends StatelessWidget {
|
||||
final Duration duration;
|
||||
final void Function(Duration) updateDuration;
|
||||
|
||||
SelectDurationBtn({
|
||||
const SelectDurationBtn({
|
||||
super.key,
|
||||
@required this.duration,
|
||||
@required this.updateDuration,
|
||||
});
|
||||
@ -38,10 +39,10 @@ class SelectDurationBtn extends StatelessWidget {
|
||||
int days = duration.inDays - (365 * years) - (30 * months);
|
||||
return TextButton(
|
||||
onPressed: () => _onButtonPressed(context, appTheme),
|
||||
child: Text("$years Years $months Months $days Days"),
|
||||
style: TextButton.styleFrom(
|
||||
primary: appTheme.primaryTextTheme.button.color,
|
||||
primary: appTheme.primaryTextTheme.labelLarge.color,
|
||||
backgroundColor: appTheme.accentColor,
|
||||
));
|
||||
),
|
||||
child: Text("$years Years $months Months $days Days"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user