push calling create scene

This commit is contained in:
ashrafzarkanisala
2024-11-24 11:17:54 +03:00
parent 5a9729fe10
commit 87c47a74ce
13 changed files with 759 additions and 131 deletions

View File

@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/main.dart';
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
import 'package:syncrow_web/pages/common/text_field/custom_text_field.dart';
import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart';
import 'package:syncrow_web/pages/routiens/helper/save_routine_helper.dart';
import 'package:syncrow_web/pages/routiens/helper/setting_helper.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/style.dart';
@ -28,7 +32,9 @@ class RoutineSearchAndButtons extends StatelessWidget {
children: [
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth > 700 ? 450 : constraints.maxWidth - 32),
maxWidth: constraints.maxWidth > 700
? 450
: constraints.maxWidth - 32),
child: StatefulTextField(
title: 'Routine Name',
height: 40,
@ -38,6 +44,11 @@ class RoutineSearchAndButtons extends StatelessWidget {
elevation: 0,
borderRadius: 15,
width: 450,
onChanged: (value) {
context
.read<RoutineBloc>()
.add(SearchRoutines(value));
},
),
),
(constraints.maxWidth <= 1000)
@ -48,8 +59,17 @@ class RoutineSearchAndButtons extends StatelessWidget {
child: Center(
child: DefaultButton(
onPressed: () async {
final result = await SettingHelper.showSettingDialog(
context: context, isAutomation: true);
final result =
await SettingHelper.showSettingDialog(
context: context,
isAutomation: context
.read<RoutineBloc>()
.isAutomation);
if (result != null) {
context
.read<RoutineBloc>()
.add(AddSelectedIcon(result));
}
},
borderRadius: 15,
elevation: 0,
@ -100,7 +120,9 @@ class RoutineSearchAndButtons extends StatelessWidget {
width: 200,
child: Center(
child: DefaultButton(
onPressed: () {},
onPressed: () {
SaveRoutineHelper.showSaveRoutineDialog(context);
},
borderRadius: 15,
elevation: 0,
backgroundColor: ColorsManager.primaryColor,