mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-27 02:37:55 +00:00
87 lines
3.5 KiB
Dart
87 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
|
import 'package:syncrow_app/features/devices/model/function_model.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/category_view_app_bar.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/lights_switches/light_switches_body.dart';
|
|
import 'package:syncrow_app/generated/assets.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
|
|
|
class LightSwitchesView extends StatelessWidget {
|
|
const LightSwitchesView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnnotatedRegion(
|
|
value: SystemUiOverlayStyle(
|
|
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
|
statusBarIconBrightness: Brightness.light,
|
|
),
|
|
child: SafeArea(
|
|
child: Scaffold(
|
|
backgroundColor: ColorsManager.backgroundColor,
|
|
extendBodyBehindAppBar: true,
|
|
extendBody: true,
|
|
appBar: const CategoryViewAppBar(),
|
|
body: BlocBuilder<NavCubit, NavState>(
|
|
builder: (context, state) {
|
|
return Container(
|
|
width: MediaQuery.sizeOf(context).width,
|
|
height: MediaQuery.sizeOf(context).height,
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage(
|
|
Assets.imagesBackground,
|
|
),
|
|
fit: BoxFit.cover,
|
|
opacity: 0.4,
|
|
),
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.only(
|
|
top: Constants.appBarHeight,
|
|
left: Constants.defaultPadding,
|
|
right: Constants.defaultPadding,
|
|
bottom: Constants.bottomNavBarHeight,
|
|
),
|
|
child: LightSwitchesBody(
|
|
device: DeviceModel(
|
|
id: 2,
|
|
name: 'Bedroom Light',
|
|
type: DeviceType.Lights,
|
|
status: true,
|
|
timer: 0,
|
|
image: '',
|
|
functions: [
|
|
FunctionModel(
|
|
code: 'switch_1',
|
|
desc: 'switch 1',
|
|
name: 'switch 1',
|
|
type: 'Boolean',
|
|
values: '{}'),
|
|
FunctionModel(
|
|
code: 'switch_2',
|
|
desc: 'switch 2',
|
|
name: 'switch 2',
|
|
type: 'Boolean',
|
|
values: '{}'),
|
|
FunctionModel(
|
|
code: 'switch_3',
|
|
desc: 'switch 3',
|
|
name: 'switch 3',
|
|
type: 'Boolean',
|
|
values: '{}'),
|
|
]),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
}
|