Compare commits
2 Commits
2f6440f78d
...
2b8e1dc2cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b8e1dc2cb | |||
| b711276674 |
@@ -103,6 +103,7 @@ class _MetadataPageState extends State<MetadataPage> {
|
|||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(left: 10)),
|
Padding(padding: EdgeInsets.only(left: 10)),
|
||||||
CookingDurationButton(
|
CookingDurationButton(
|
||||||
|
heroTag: 1,
|
||||||
selectedDuration: _recipeProvider.recipe.prepTime,
|
selectedDuration: _recipeProvider.recipe.prepTime,
|
||||||
onDurationChanged: _recipeProvider.updatePrepTime,
|
onDurationChanged: _recipeProvider.updatePrepTime,
|
||||||
),
|
),
|
||||||
@@ -117,6 +118,7 @@ class _MetadataPageState extends State<MetadataPage> {
|
|||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(left: 10)),
|
Padding(padding: EdgeInsets.only(left: 10)),
|
||||||
CookingDurationButton(
|
CookingDurationButton(
|
||||||
|
heroTag: 2,
|
||||||
selectedDuration: _recipeProvider.recipe.cookTime,
|
selectedDuration: _recipeProvider.recipe.cookTime,
|
||||||
onDurationChanged: _recipeProvider.updateCookTime,
|
onDurationChanged: _recipeProvider.updateCookTime,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ class CookingDurationButton extends StatelessWidget {
|
|||||||
required this.selectedDuration,
|
required this.selectedDuration,
|
||||||
required this.onDurationChanged,
|
required this.onDurationChanged,
|
||||||
this.label = '',
|
this.label = '',
|
||||||
|
required this.heroTag,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final void Function(Duration duration) onDurationChanged;
|
final void Function(Duration duration) onDurationChanged;
|
||||||
final Duration selectedDuration;
|
final Duration selectedDuration;
|
||||||
|
|
||||||
|
final Object heroTag;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String text = label;
|
String text = label;
|
||||||
@@ -22,6 +25,7 @@ class CookingDurationButton extends StatelessWidget {
|
|||||||
text = durationToFormattedString(selectedDuration);
|
text = durationToFormattedString(selectedDuration);
|
||||||
}
|
}
|
||||||
return FloatingActionButton.extended(
|
return FloatingActionButton.extended(
|
||||||
|
heroTag: heroTag,
|
||||||
onPressed: () => showDialog(
|
onPressed: () => showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => _getDurationDialog(
|
builder: (context) => _getDurationDialog(
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class _DurationPickerState extends State<DurationPicker> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
if (widget.initialDuration.inMinutes != 0) {
|
if (widget.initialDuration.inMinutes != 0) {
|
||||||
_timeString =
|
_timeString =
|
||||||
'${widget.initialDuration.inHours}${widget.initialDuration.inMinutes % 60}';
|
'${widget.initialDuration.inHours}${(widget.initialDuration.inMinutes % 60).toString().padLeft(2, '0')}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user