mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 20:24:55 +00:00
Refactor UI structure in curtain and light widgets
Simplify UI structure in curtain_view.dart and light_interface.dart by rearranging the widget tree for better readability and maintainability.
This commit is contained in:
@ -20,13 +20,13 @@ class CurtainView extends StatelessWidget {
|
||||
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: const CategoryViewAppBar(),
|
||||
body: Container(
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: const CategoryViewAppBar(),
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
|
||||
@ -24,31 +24,29 @@ class LightInterface extends StatelessWidget {
|
||||
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
centerTitle: true,
|
||||
title: BodyLarge(
|
||||
text: light.name ?? "",
|
||||
fontColor: ColorsManager.primaryColor,
|
||||
fontWeight: FontsManager.bold,
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
centerTitle: true,
|
||||
title: BodyLarge(
|
||||
text: light.name ?? "",
|
||||
fontColor: ColorsManager.primaryColor,
|
||||
fontWeight: FontsManager.bold,
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(top: 70, right: 20, left: 20),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
LightInterfaceSwitch(light: light),
|
||||
LightInterfaceContols(light: light),
|
||||
const LightInterfaceTimer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(top: 70, right: 20, left: 20),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
LightInterfaceSwitch(light: light),
|
||||
LightInterfaceContols(light: light),
|
||||
const LightInterfaceTimer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -34,7 +34,7 @@ class WizartSwitches extends StatelessWidget {
|
||||
itemBuilder: (_, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
DevicesCubit.getInstance().selectCategory(index);
|
||||
// DevicesCubit.getInstance().selectCategory(index);
|
||||
//Navigate to the chosen category view without animation
|
||||
|
||||
Navigator.push(context,
|
||||
|
||||
Reference in New Issue
Block a user