mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 11:14:55 +00:00
66 lines
2.5 KiB
Dart
66 lines
2.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/view/widgets/default_app_bar.dart';
|
|
import 'package:syncrow_app/features/app_layout/view/widgets/default_nav_bar.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/AC/ac_cubit.dart';
|
|
import 'package:syncrow_app/features/devices/model/ac_model.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface.dart';
|
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_list.dart';
|
|
|
|
import '../../../../../generated/assets.dart';
|
|
import '../../../../../utils/resource_manager/color_manager.dart';
|
|
|
|
class ACsView extends StatelessWidget {
|
|
const ACsView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocProvider(
|
|
create: (context) => AcCubit(),
|
|
child: BlocBuilder<AcCubit, AcState>(
|
|
builder: (context, state) {
|
|
ACModel? selectedAC = AcCubit.get(context).getSelectedAC();
|
|
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 DefaultAppBar(),
|
|
body: 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: const EdgeInsets.only(
|
|
top: 60, right: 15, left: 15, bottom: 80),
|
|
child: SizedBox.expand(
|
|
child: selectedAC != null
|
|
? AcInterface(acModel: selectedAC)
|
|
: const ACsList(),
|
|
),
|
|
),
|
|
),
|
|
bottomNavigationBar: const DefaultNavBar(),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|