Refactor: Remove redundant shift assignment and update clock-in button to be full width.
This commit is contained in:
@@ -117,9 +117,7 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
|
||||
);
|
||||
}
|
||||
|
||||
final Shift displayShift = state is ShiftDetailsLoaded
|
||||
? widget.shift
|
||||
: widget.shift;
|
||||
final Shift displayShift = widget.shift;
|
||||
final i18n = Translations.of(context).staff_shifts.shift_details;
|
||||
|
||||
final duration = _calculateDuration(displayShift);
|
||||
|
||||
@@ -57,11 +57,10 @@ class ShiftDetailsBottomBar extends StatelessWidget {
|
||||
|
||||
Widget _buildButtons(String status, dynamic i18n, BuildContext context) {
|
||||
if (status == 'confirmed') {
|
||||
return Expanded(
|
||||
child: UiButton.primary(
|
||||
onPressed: () => Modular.to.toClockIn(),
|
||||
child: Text(i18n.clock_in, style: UiTypography.body2b.white),
|
||||
),
|
||||
return UiButton.primary(
|
||||
onPressed: () => Modular.to.toClockIn(),
|
||||
fullWidth: true,
|
||||
child: Text(i18n.clock_in, style: UiTypography.body2b.white),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user