mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 16:34:56 +00:00
merge and push
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routiens/bloc/effective_period/effect_period_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routiens/bloc/effective_period/effect_period_event.dart';
|
||||
import 'package:syncrow_web/pages/routiens/bloc/effective_period/effect_period_state.dart';
|
||||
import 'package:syncrow_web/pages/routiens/bloc/routine_bloc/routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routiens/bloc/setting_bloc/setting_bloc.dart';
|
||||
@ -23,11 +24,18 @@ class SettingHelper {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
final isAutomation = context.read<RoutineBloc>().state.isAutomation;
|
||||
final effectiveTime = context.read<RoutineBloc>().state.effectiveTime;
|
||||
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider(
|
||||
create: (_) => EffectPeriodBloc(),
|
||||
),
|
||||
if (effectiveTime != null)
|
||||
BlocProvider(
|
||||
create: (_) => EffectPeriodBloc()..add(InitialEffectPeriodEvent(effectiveTime)),
|
||||
),
|
||||
if (effectiveTime == null)
|
||||
BlocProvider(
|
||||
create: (_) => EffectPeriodBloc(),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (_) => SettingBloc()..add(InitialEvent(selectedIcon: iconId ?? ''))),
|
||||
],
|
||||
|
||||
@ -136,7 +136,8 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
||||
final result = await SettingHelper
|
||||
.showSettingDialog(
|
||||
context: context,
|
||||
iconId: state.selectedIcon,
|
||||
iconId:
|
||||
state.selectedIcon ?? '',
|
||||
);
|
||||
if (result != null) {
|
||||
context.read<RoutineBloc>().add(
|
||||
@ -277,9 +278,8 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
||||
? () async {
|
||||
final result =
|
||||
await SettingHelper.showSettingDialog(
|
||||
context: context,
|
||||
iconId: state.selectedIcon,
|
||||
);
|
||||
context: context,
|
||||
iconId: state.selectedIcon ?? '');
|
||||
if (result != null) {
|
||||
context
|
||||
.read<RoutineBloc>()
|
||||
|
||||
Reference in New Issue
Block a user