mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
SP-1435
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/create_routine_bloc/create_routine_event.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/create_routine_bloc/create_routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/create_routine_bloc/create_routine_event.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/routine_bloc/routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/create_new_routines/create_new_routines.dart';
|
||||
import 'package:syncrow_web/pages/routines/view/create_new_routine_view.dart';
|
||||
@ -9,6 +9,7 @@ import 'package:syncrow_web/pages/routines/widgets/main_routine_view/fetch_routi
|
||||
import 'package:syncrow_web/pages/routines/widgets/main_routine_view/routine_view_card.dart';
|
||||
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
class RoutinesView extends StatefulWidget {
|
||||
const RoutinesView({super.key});
|
||||
@ -27,9 +28,10 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
if (result == null) return;
|
||||
final communityId = result['community'];
|
||||
final spaceId = result['space'];
|
||||
final _bloc = BlocProvider.of<CreateRoutineBloc>(context);
|
||||
final bloc = BlocProvider.of<CreateRoutineBloc>(context);
|
||||
final routineBloc = context.read<RoutineBloc>();
|
||||
_bloc.add(SaveCommunityIdAndSpaceIdEvent(communityID: communityId, spaceID: spaceId));
|
||||
bloc.add(
|
||||
SaveCommunityIdAndSpaceIdEvent(communityID: communityId, spaceID: spaceId));
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
routineBloc.add(const CreateNewRoutineViewEvent(createRoutineView: true));
|
||||
}
|
||||
@ -54,43 +56,41 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Create New Routines",
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
RoutineViewCard(
|
||||
isLoading: false,
|
||||
onChanged: (v) {},
|
||||
status: '',
|
||||
spaceId: '',
|
||||
automationId: '',
|
||||
communityId: '',
|
||||
sceneId: '',
|
||||
cardType: '',
|
||||
spaceName: '',
|
||||
onTap: () => _handleRoutineCreation(context),
|
||||
icon: Icons.add,
|
||||
textString: '',
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Expanded(child: FetchRoutineScenesAutomation()),
|
||||
],
|
||||
),
|
||||
child: SizedBox(
|
||||
height: context.screenHeight,
|
||||
width: context.screenWidth,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsetsDirectional.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
"Create New Routines",
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
RoutineViewCard(
|
||||
isLoading: false,
|
||||
onChanged: (v) {},
|
||||
status: '',
|
||||
spaceId: '',
|
||||
automationId: '',
|
||||
communityId: '',
|
||||
sceneId: '',
|
||||
cardType: '',
|
||||
spaceName: '',
|
||||
onTap: () => _handleRoutineCreation(context),
|
||||
icon: Icons.add,
|
||||
textString: '',
|
||||
),
|
||||
const FetchRoutineScenesAutomation(),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 50),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
Reference in New Issue
Block a user