mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 05:47:54 +00:00
initialized Routine Page
This commit is contained in:
+6
-6
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/navigation/view/widgets/app_body.dart';
|
||||
import 'package:syncrow_app/features/navigation/view/widgets/default_app_bar.dart';
|
||||
import 'package:syncrow_app/features/navigation/view/widgets/default_nav_bar.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/app_layout/view/widgets/app_body.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/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class NavigationView extends StatelessWidget {
|
||||
const NavigationView({super.key});
|
||||
class AppLayout extends StatelessWidget {
|
||||
const AppLayout({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
+7
-2
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
import '../../../shared_widgets/text_widgets/body_large.dart';
|
||||
|
||||
@@ -22,8 +23,12 @@ class AppBarHomeDropdown extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
SvgPicture.asset(
|
||||
IconsManager.home,
|
||||
width: 30,
|
||||
height: 30,
|
||||
width: 25,
|
||||
height: 25,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
ColorsManager.textPrimaryColor,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const Gap(5),
|
||||
const BodyLarge(text: 'Home'),
|
||||
+6
-2
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
|
||||
class AppBody extends StatelessWidget {
|
||||
@@ -24,7 +24,11 @@ class AppBody extends StatelessWidget {
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
child: NavCubit.of(context).currentPage,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 60, right: 15, left: 15, bottom: 100),
|
||||
child: NavCubit.of(context).currentPage,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/navigation/view/widgets/app_bar_home_dropdown.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart';
|
||||
|
||||
class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
const DefaultAppBar({super.key});
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class DefaultNavBar extends StatelessWidget {
|
||||
@@ -1,49 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/carbon_emission.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/consumption.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/live_monitor_tab.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/carbon_emission.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/consumption.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_tab.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
import 'energy_usage.dart';
|
||||
import 'widgets/energy_usage.dart';
|
||||
|
||||
class DashboardView extends StatelessWidget {
|
||||
const DashboardView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.only(top: 60, right: 15, left: 15, bottom: 100),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TitleMedium(
|
||||
text: StringsManager.dashboard,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TitleMedium(
|
||||
text: StringsManager.dashboard,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
LiveMonitorTab(),
|
||||
Gap(10),
|
||||
EnergyUsage(),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Consumption(),
|
||||
Gap(20),
|
||||
CarbonEmission(),
|
||||
],
|
||||
),
|
||||
),
|
||||
LiveMonitorTab(),
|
||||
Gap(10),
|
||||
EnergyUsage(),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Consumption(),
|
||||
Gap(20),
|
||||
CarbonEmission(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/card_title.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/united_text.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/card_title.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/united_text.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/energy_usage_header.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/energy_usage_header.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
|
||||
class EnergyUsage extends StatelessWidget {
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/card_title.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/united_text.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/live_monitor_widget.dart';
|
||||
import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_widget.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
@@ -18,5 +18,5 @@ class SceneCubit extends Cubit<SceneState> {
|
||||
});
|
||||
}
|
||||
|
||||
var scenes = <SceneModel>[];
|
||||
List<SceneModel> scenes = [];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_cubit.dart';
|
||||
import 'package:syncrow_app/features/scene/view/widgets/scene_view_no_scenes.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/assets_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||
|
||||
class SceneView extends StatelessWidget {
|
||||
const SceneView({super.key});
|
||||
@@ -12,9 +18,99 @@ class SceneView extends StatelessWidget {
|
||||
create: (BuildContext context) => SceneCubit(),
|
||||
child: BlocBuilder<SceneCubit, SceneState>(
|
||||
builder: (context, state) {
|
||||
return state is SceneLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: const SceneViewNoScenes();
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const TitleMedium(
|
||||
text: StringsManager.routine,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
const BodySmall(
|
||||
text: StringsManager.tapToRunRoutine,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
IconsManager.summerMode,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.summerMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Gap(10),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
child: DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
height: 50,
|
||||
width: 50,
|
||||
IconsManager.winterMode,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const Icon(
|
||||
Icons.play_circle,
|
||||
size: 40,
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
const BodyMedium(
|
||||
text: StringsManager.winterMode,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -10,6 +10,9 @@ class BodyMedium extends StatelessWidget {
|
||||
this.maxLines,
|
||||
this.overflow,
|
||||
this.textAlign,
|
||||
this.fontSize,
|
||||
this.fontColor,
|
||||
this.fontWeight,
|
||||
});
|
||||
|
||||
final String text;
|
||||
@@ -18,11 +21,17 @@ class BodyMedium extends StatelessWidget {
|
||||
final TextOverflow? overflow;
|
||||
|
||||
final TextAlign? textAlign;
|
||||
final double? fontSize;
|
||||
|
||||
final Color? fontColor;
|
||||
final FontWeight? fontWeight;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => CustomText(
|
||||
text,
|
||||
style: style ?? context.bodyMedium,
|
||||
style: style ??
|
||||
context.bodyMedium.copyWith(
|
||||
fontSize: fontSize, color: fontColor, fontWeight: fontWeight),
|
||||
// softWrap: true,
|
||||
maxLines: maxLines,
|
||||
// overflow: overflow,
|
||||
|
||||
Reference in New Issue
Block a user