Added delete scene function

This commit is contained in:
Abdullah Alassaf
2024-11-30 20:45:25 +03:00
parent 8d388ac482
commit fb6b922df4
5 changed files with 172 additions and 154 deletions

View File

@ -301,7 +301,7 @@ class RoutineSearchAndButtons extends StatelessWidget {
width: 200,
child: Center(
child: DefaultButton(
onPressed: () {
onPressed: () async {
if (state.routineName == null || state.routineName!.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
@ -335,7 +335,15 @@ class RoutineSearchAndButtons extends StatelessWidget {
);
return;
}
SaveRoutineHelper.showSaveRoutineDialog(context);
final result = await SaveRoutineHelper.showSaveRoutineDialog(context);
if (result != null && result) {
BlocProvider.of<SwitchTabsBloc>(context).add(
const CreateNewRoutineViewEvent(false),
);
BlocProvider.of<SwitchTabsBloc>(context).add(
const TriggerSwitchTabsEvent(true),
);
}
},
borderRadius: 15,
elevation: 0,