Files
eatvio_app/lib/features/consultations_archive/presentation/status_widget.dart

65 lines
2.0 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/plans/enums/chosen_plan_state_enum.dart';
import 'package:flutter/material.dart';
class StatusWidget extends StatelessWidget {
const StatusWidget({super.key, required this.status});
final ChosenPlanStateEnum status;
@override
Widget build(BuildContext context) {
final activeStates = ChosenPlanStateEnum.getActiveStates();
if (status == ChosenPlanStateEnum.stateCanceledByTheInitiator) {
return Material(
color: appTheme.lightRed,
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
'Отменён',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: appTheme.strongRed,
height: 1,
),
),
),
);
} else if (status == ChosenPlanStateEnum.stateChargeWasCollected) {
return Material(
color: const Color(0xFF0BB450).withAlpha(11),
borderRadius: BorderRadius.circular(8),
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
'Успешно',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF0BB450),
height: 1,
),
),
),
);
}
return Material(
color: appTheme.transparentBlue,
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
'В процессе',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: appTheme.blueA400,
height: 1,
),
),
),
);
}
}