setting button

This commit is contained in:
ashraf_personal
2024-11-27 01:29:15 +03:00
parent 070fc8b78b
commit 75aa2042c1

View File

@ -16,6 +16,8 @@ class RoutineSearchAndButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocBuilder<RoutineBloc, RoutineState>(
builder: (context, state) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Wrap(
@ -59,17 +61,19 @@ class RoutineSearchAndButtons extends StatelessWidget {
width: 200,
child: Center(
child: DefaultButton(
onPressed: () async {
final result =
await SettingHelper.showSettingDialog(
onPressed: state.isAutomation ||
state.isTabToRun
? () async {
final result = await SettingHelper
.showSettingDialog(
context: context,
);
if (result != null) {
context
.read<RoutineBloc>()
.add(AddSelectedIcon(result));
context.read<RoutineBloc>().add(
AddSelectedIcon(result));
}
},
}
: null,
borderRadius: 15,
elevation: 0,
borderColor: ColorsManager.greyColor,
@ -122,7 +126,8 @@ class RoutineSearchAndButtons extends StatelessWidget {
child: Center(
child: DefaultButton(
onPressed: () {
SaveRoutineHelper.showSaveRoutineDialog(context);
SaveRoutineHelper.showSaveRoutineDialog(
context);
},
borderRadius: 15,
elevation: 0,
@ -151,8 +156,10 @@ class RoutineSearchAndButtons extends StatelessWidget {
width: 200,
child: Center(
child: DefaultButton(
onPressed: () async {
final result = await SettingHelper.showSettingDialog(
onPressed: state.isAutomation || state.isTabToRun
? () async {
final result =
await SettingHelper.showSettingDialog(
context: context,
);
if (result != null) {
@ -160,7 +167,8 @@ class RoutineSearchAndButtons extends StatelessWidget {
.read<RoutineBloc>()
.add(AddSelectedIcon(result));
}
},
}
: null,
borderRadius: 15,
elevation: 0,
borderColor: ColorsManager.greyColor,
@ -229,5 +237,7 @@ class RoutineSearchAndButtons extends StatelessWidget {
);
},
);
},
);
}
}