mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
modified UI padding handling approach
added auth API endpoints initialized curtains view for further development
This commit is contained in:
@ -19,14 +19,14 @@ class AppLayout extends StatelessWidget {
|
|||||||
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
statusBarColor: ColorsManager.primaryColor.withOpacity(0.5),
|
||||||
statusBarIconBrightness: Brightness.light,
|
statusBarIconBrightness: Brightness.light,
|
||||||
),
|
),
|
||||||
child: const SafeArea(
|
child: SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: ColorsManager.backgroundColor,
|
backgroundColor: ColorsManager.backgroundColor,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
appBar: DefaultAppBar(),
|
appBar: DefaultAppBar(context),
|
||||||
body: AppBody(),
|
body: const AppBody(),
|
||||||
bottomNavigationBar: DefaultNavBar(),
|
bottomNavigationBar: const DefaultNavBar(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -25,11 +25,7 @@ class AppBody extends StatelessWidget {
|
|||||||
opacity: 0.4,
|
opacity: 0.4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: NavCubit.of(context).currentPage,
|
||||||
padding:
|
|
||||||
const EdgeInsets.only(top: 60, right: 15, left: 15, bottom: 80),
|
|
||||||
child: NavCubit.of(context).currentPage,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -2,9 +2,12 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.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';
|
import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||||
const DefaultAppBar({super.key});
|
const DefaultAppBar(this.context, {super.key});
|
||||||
|
|
||||||
|
final BuildContext context;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -34,5 +37,5 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => const Size.fromHeight(100);
|
Size get preferredSize => Size.fromHeight(Constants.appBarHeight);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
class DefaultNavBar extends StatelessWidget {
|
class DefaultNavBar extends StatelessWidget {
|
||||||
const DefaultNavBar({
|
const DefaultNavBar({
|
||||||
@ -14,8 +15,8 @@ class DefaultNavBar extends StatelessWidget {
|
|||||||
return BlocBuilder<NavCubit, NavState>(
|
return BlocBuilder<NavCubit, NavState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
var cubit = NavCubit.of(context);
|
var cubit = NavCubit.of(context);
|
||||||
return Padding(
|
return SizedBox(
|
||||||
padding: const EdgeInsets.only(bottom: 27),
|
height: Constants.bottomNavBarHeight,
|
||||||
child: BottomNavigationBar(
|
child: BottomNavigationBar(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
onTap: (int index) {
|
onTap: (int index) {
|
||||||
|
@ -5,6 +5,7 @@ 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/consumption.dart';
|
||||||
import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_tab.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/features/shared_widgets/text_widgets/title_medium.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||||
|
|
||||||
import 'widgets/energy_usage.dart';
|
import 'widgets/energy_usage.dart';
|
||||||
@ -14,37 +15,45 @@ class DashboardView extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
return Padding(
|
||||||
child: Column(
|
padding: EdgeInsets.only(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
top: Constants.appBarHeight,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
left: Constants.defaultPadding,
|
||||||
children: [
|
right: Constants.defaultPadding,
|
||||||
const TitleMedium(
|
bottom: Constants.bottomNavBarHeight,
|
||||||
text: StringsManager.dashboard,
|
),
|
||||||
style: TextStyle(
|
child: SingleChildScrollView(
|
||||||
fontSize: 32,
|
child: Column(
|
||||||
fontWeight: FontWeight.bold,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
const TitleMedium(
|
||||||
|
text: StringsManager.dashboard,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const LiveMonitorTab(),
|
||||||
const LiveMonitorTab(),
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 10),
|
const EnergyUsage(),
|
||||||
const EnergyUsage(),
|
Container(
|
||||||
Container(
|
padding: const EdgeInsets.only(top: 20),
|
||||||
padding: const EdgeInsets.only(top: 20),
|
constraints: const BoxConstraints(
|
||||||
constraints: const BoxConstraints(
|
minHeight: 220,
|
||||||
minHeight: 220,
|
maxHeight: 240,
|
||||||
maxHeight: 240,
|
),
|
||||||
|
child: const Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Consumption(),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
CarbonEmission(),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: const Column(
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
),
|
||||||
children: [
|
|
||||||
Consumption(),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
CarbonEmission(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,11 @@ class AcCubit extends Cubit<AcState> {
|
|||||||
void setTempToAll(double temperature) {
|
void setTempToAll(double temperature) {
|
||||||
for (DeviceModel ac in DevicesCubit.categories[0].devices) {
|
for (DeviceModel ac in DevicesCubit.categories[0].devices) {
|
||||||
if (ac is ACModel) {
|
if (ac is ACModel) {
|
||||||
setACTemp(ac, temperature);
|
if (ac.temperature != temperature &&
|
||||||
|
ac.bounds.min <= temperature &&
|
||||||
|
temperature <= ac.bounds.max) {
|
||||||
|
setACTemp(ac, temperature);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
universalACTemp = temperature;
|
universalACTemp = temperature;
|
||||||
|
@ -11,11 +11,7 @@ class CategoriesView extends StatelessWidget {
|
|||||||
return BlocProvider(
|
return BlocProvider(
|
||||||
create: (context) => DevicesCubit(),
|
create: (context) => DevicesCubit(),
|
||||||
child: BlocBuilder<DevicesCubit, DevicesState>(
|
child: BlocBuilder<DevicesCubit, DevicesState>(
|
||||||
builder: (context, state) => Container(
|
builder: (context, state) => const DevicesViewBody(),
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
width: MediaQuery.sizeOf(context).width,
|
|
||||||
height: MediaQuery.sizeOf(context).height,
|
|
||||||
child: const DevicesViewBody()),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,18 +16,20 @@ class AcInterface extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
maxHeight: 400,
|
maxHeight: 380,
|
||||||
),
|
),
|
||||||
child: AcInterfaceTempUnit(
|
child: AcInterfaceTempUnit(
|
||||||
acModel: acModel,
|
acModel: acModel,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
maxHeight: 130,
|
maxHeight: 120,
|
||||||
),
|
),
|
||||||
child: AcInterfaceControls(
|
child: AcInterfaceControls(
|
||||||
acModel: acModel,
|
acModel: acModel,
|
||||||
|
@ -18,12 +18,11 @@ class AcInterfaceControls extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
|
||||||
ACModeControlUnit(model: acModel),
|
ACModeControlUnit(model: acModel),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -35,7 +34,7 @@ class AcInterfaceControls extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
|
@ -23,8 +23,6 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
//TODO: use the coolTo value from the model
|
|
||||||
double coolTo = acModel.temperature;
|
|
||||||
return BlocBuilder<AcCubit, AcState>(
|
return BlocBuilder<AcCubit, AcState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return DefaultContainer(
|
return DefaultContainer(
|
||||||
@ -48,6 +46,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
dotColor: Colors.transparent,
|
dotColor: Colors.transparent,
|
||||||
),
|
),
|
||||||
infoProperties: InfoProperties(
|
infoProperties: InfoProperties(
|
||||||
|
//TODO: move to strings manager
|
||||||
bottomLabelText: 'CURRENT TEMP',
|
bottomLabelText: 'CURRENT TEMP',
|
||||||
bottomLabelStyle: context.bodyLarge.copyWith(
|
bottomLabelStyle: context.bodyLarge.copyWith(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
@ -71,17 +70,15 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
min: 20,
|
min: acModel.bounds.min,
|
||||||
max: 30,
|
max: acModel.bounds.max,
|
||||||
initialValue: 20,
|
initialValue: acModel.temperature,
|
||||||
onChange: (value) {
|
onChange: (value) {
|
||||||
String valueAsString = value.toStringAsFixed(1);
|
String valueAsString = value.toStringAsFixed(1);
|
||||||
if (valueAsString.endsWith(".0") ||
|
if (valueAsString.endsWith(".0") ||
|
||||||
valueAsString.endsWith(".5")) {
|
valueAsString.endsWith(".5")) {
|
||||||
value = double.parse(valueAsString);
|
value = double.parse(valueAsString);
|
||||||
if (value != acModel.temperature) {
|
AcCubit.get(context).setTempToAll(value);
|
||||||
AcCubit.get(context).setTempToAll(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -96,9 +93,9 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
dimension: 24,
|
dimension: 24,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// AcCubit.get(context).setACTemp(acModel, coolTo - .5);
|
AcCubit.get(context)
|
||||||
AcCubit.get(context).setACTemp(acModel, coolTo);
|
.setACTemp(acModel, acModel.coolTo);
|
||||||
coolTo = coolTo - .5;
|
acModel.coolTo -= .5;
|
||||||
},
|
},
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.iconsMinus,
|
Assets.iconsMinus,
|
||||||
@ -108,7 +105,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
BodyLarge(
|
BodyLarge(
|
||||||
text: "$coolTo° C",
|
text: "${acModel.coolTo}° C",
|
||||||
style: context.bodyLarge.copyWith(
|
style: context.bodyLarge.copyWith(
|
||||||
color:
|
color:
|
||||||
ColorsManager.primaryColor.withOpacity(0.6),
|
ColorsManager.primaryColor.withOpacity(0.6),
|
||||||
@ -126,9 +123,9 @@ class AcInterfaceTempUnit extends StatelessWidget {
|
|||||||
dimension: 24,
|
dimension: 24,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// AcCubit.get(context).setACTemp(acModel, coolTo + .5);
|
AcCubit.get(context)
|
||||||
AcCubit.get(context).setACTemp(acModel, coolTo);
|
.setACTemp(acModel, acModel.coolTo);
|
||||||
coolTo = coolTo + .5;
|
acModel.coolTo += .5;
|
||||||
},
|
},
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.iconsPlus,
|
Assets.iconsPlus,
|
||||||
|
@ -36,7 +36,7 @@ class _ACModeControlUnitState extends State<ACModeControlUnit> {
|
|||||||
//TODO Move the fanSpeeds and tempModes to the Cubit
|
//TODO Move the fanSpeeds and tempModes to the Cubit
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -53,7 +53,7 @@ class _ACModeControlUnitState extends State<ACModeControlUnit> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Flexible(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.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_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/bloc/AC/ac_cubit.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/ac_model.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/ac_interface.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_list.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_list.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
import '../../../../../generated/assets.dart';
|
import '../../../../../generated/assets.dart';
|
||||||
import '../../../../../utils/resource_manager/color_manager.dart';
|
import '../../../../../utils/resource_manager/color_manager.dart';
|
||||||
@ -38,7 +38,7 @@ class ACsView extends StatelessWidget {
|
|||||||
backgroundColor: ColorsManager.backgroundColor,
|
backgroundColor: ColorsManager.backgroundColor,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
appBar: const DefaultAppBar(),
|
appBar: DefaultAppBar(context),
|
||||||
body: Container(
|
body: Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
@ -52,8 +52,11 @@ class ACsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 60, right: 15, left: 15, bottom: 80),
|
top: Constants.appBarHeight,
|
||||||
|
left: Constants.defaultPadding,
|
||||||
|
right: Constants.defaultPadding,
|
||||||
|
),
|
||||||
child: SizedBox.expand(
|
child: SizedBox.expand(
|
||||||
child: selectedAC != null
|
child: selectedAC != null
|
||||||
? AcInterface(acModel: selectedAC)
|
? AcInterface(acModel: selectedAC)
|
||||||
@ -61,7 +64,6 @@ class ACsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: const DefaultNavBar(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import 'package:syncrow_app/features/devices/view/widgets/devices_mode_tab.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/devices_mode_tab.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/switches.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/switches.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||||
|
|
||||||
class DevicesCategoriesView extends StatelessWidget {
|
class DevicesCategoriesView extends StatelessWidget {
|
||||||
@ -13,43 +14,46 @@ class DevicesCategoriesView extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Column(
|
return const Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.symmetric(horizontal: Constants.defaultPadding),
|
||||||
children: [
|
child: Column(
|
||||||
Expanded(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
flex: 3,
|
children: [
|
||||||
child: Column(
|
Expanded(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
flex: 3,
|
||||||
children: [
|
|
||||||
TitleMedium(
|
|
||||||
text: StringsManager.devices,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 32,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
DevicesModeTab(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 11,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TitleMedium(
|
TitleMedium(
|
||||||
text: StringsManager.wizard,
|
text: StringsManager.devices,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 28,
|
fontSize: 32,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switches(),
|
DevicesModeTab(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
Expanded(
|
||||||
],
|
flex: 11,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TitleMedium(
|
||||||
|
text: StringsManager.wizard,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Switches(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/devices_categories_view.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/devices_categories_view.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
import '../../../../utils/resource_manager/strings_manager.dart';
|
import '../../../../utils/resource_manager/strings_manager.dart';
|
||||||
import '../../bloc/devices_cubit.dart';
|
import '../../bloc/devices_cubit.dart';
|
||||||
@ -23,106 +24,126 @@ class DevicesViewBody extends StatelessWidget {
|
|||||||
PageController pageController = PageController();
|
PageController pageController = PageController();
|
||||||
return state is DevicesLoading
|
return state is DevicesLoading
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: Column(
|
: Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
padding: EdgeInsets.only(
|
||||||
children: [
|
top: Constants.appBarHeight,
|
||||||
Expanded(
|
bottom: Constants.bottomNavBarHeight),
|
||||||
child: PageView(
|
child: Column(
|
||||||
controller: pageController,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: const [
|
children: [
|
||||||
DevicesCategoriesView(),
|
Expanded(
|
||||||
Column(
|
child: PageView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
controller: pageController,
|
||||||
children: [
|
children: const [
|
||||||
Expanded(
|
DevicesCategoriesView(),
|
||||||
child: Column(
|
Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.symmetric(
|
||||||
children: [
|
horizontal: Constants.defaultPadding),
|
||||||
TitleMedium(
|
child: Column(
|
||||||
text: "Home",
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
style: TextStyle(
|
children: [
|
||||||
fontSize: 32,
|
Expanded(
|
||||||
fontWeight: FontWeight.bold,
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TitleMedium(
|
||||||
|
text: "Home",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TitleMedium(
|
||||||
|
text: StringsManager.wizard,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Switches(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
flex: 3,
|
Padding(
|
||||||
child: SingleChildScrollView(
|
padding: EdgeInsets.symmetric(
|
||||||
child: Column(
|
horizontal: Constants.defaultPadding),
|
||||||
crossAxisAlignment:
|
child: Column(
|
||||||
CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TitleMedium(
|
Expanded(
|
||||||
text: StringsManager.wizard,
|
child: Column(
|
||||||
style: TextStyle(
|
crossAxisAlignment:
|
||||||
fontSize: 28,
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TitleMedium(
|
||||||
|
text: "Office",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
Switches(),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
)
|
flex: 3,
|
||||||
],
|
child: SingleChildScrollView(
|
||||||
),
|
child: Column(
|
||||||
Column(
|
crossAxisAlignment:
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
TitleMedium(
|
||||||
child: Column(
|
text: StringsManager.wizard,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
style: TextStyle(
|
||||||
children: [
|
fontSize: 28,
|
||||||
TitleMedium(
|
),
|
||||||
text: "Office",
|
),
|
||||||
style: TextStyle(
|
Switches(),
|
||||||
fontSize: 32,
|
],
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
flex: 3,
|
],
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
TitleMedium(
|
|
||||||
text: StringsManager.wizard,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 28,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Switches(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SmoothPageIndicator(
|
|
||||||
controller: pageController,
|
|
||||||
count: 3,
|
|
||||||
effect: const WormEffect(
|
|
||||||
dotHeight: 8,
|
|
||||||
dotWidth: 8,
|
|
||||||
),
|
),
|
||||||
onDotClicked: (index) {
|
),
|
||||||
pageController.animateToPage(
|
Padding(
|
||||||
index,
|
padding: const EdgeInsets.symmetric(
|
||||||
duration: const Duration(milliseconds: 300),
|
vertical: 7,
|
||||||
curve: Curves.ease,
|
),
|
||||||
);
|
child: SmoothPageIndicator(
|
||||||
}),
|
controller: pageController,
|
||||||
],
|
count: 3,
|
||||||
|
effect: const WormEffect(
|
||||||
|
dotHeight: 8,
|
||||||
|
dotWidth: 8,
|
||||||
|
),
|
||||||
|
onDotClicked: (index) {
|
||||||
|
pageController.animateToPage(
|
||||||
|
index,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.ease,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -6,7 +6,6 @@ import 'package:syncrow_app/features/devices/view/widgets/lights/lights_view_lis
|
|||||||
import '../../../../../generated/assets.dart';
|
import '../../../../../generated/assets.dart';
|
||||||
import '../../../../../utils/resource_manager/color_manager.dart';
|
import '../../../../../utils/resource_manager/color_manager.dart';
|
||||||
import '../../../../app_layout/view/widgets/default_app_bar.dart';
|
import '../../../../app_layout/view/widgets/default_app_bar.dart';
|
||||||
import '../../../../app_layout/view/widgets/default_nav_bar.dart';
|
|
||||||
import '../../../bloc/devices_cubit.dart';
|
import '../../../bloc/devices_cubit.dart';
|
||||||
import '../../../bloc/lights/lights_cubit.dart';
|
import '../../../bloc/lights/lights_cubit.dart';
|
||||||
import '../../../model/light_model.dart';
|
import '../../../model/light_model.dart';
|
||||||
@ -44,7 +43,7 @@ class LightsView extends StatelessWidget {
|
|||||||
backgroundColor: ColorsManager.backgroundColor,
|
backgroundColor: ColorsManager.backgroundColor,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
appBar: const DefaultAppBar(),
|
appBar: DefaultAppBar(context),
|
||||||
body: Container(
|
body: Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
@ -61,7 +60,6 @@ class LightsView extends StatelessWidget {
|
|||||||
? LightInterface(light: selectedLight)
|
? LightInterface(light: selectedLight)
|
||||||
: LightsViewList(lights: lights),
|
: LightsViewList(lights: lights),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: const DefaultNavBar(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/lights/lights_list.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/lights/lights_list.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
import '../../../../shared_widgets/text_widgets/body_small.dart';
|
import '../../../../shared_widgets/text_widgets/body_small.dart';
|
||||||
import '../../../bloc/devices_cubit.dart';
|
import '../../../bloc/devices_cubit.dart';
|
||||||
@ -17,7 +18,11 @@ class LightsViewList extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 70, right: 15, left: 15, bottom: 80),
|
padding: EdgeInsets.only(
|
||||||
|
top: Constants.appBarHeight,
|
||||||
|
right: Constants.defaultPadding,
|
||||||
|
left: Constants.defaultPadding,
|
||||||
|
),
|
||||||
child: SizedBox.expand(
|
child: SizedBox.expand(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -68,6 +68,7 @@ class Switches extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
height: 0,
|
height: 0,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
|
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
|
||||||
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
|
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
|
||||||
import 'package:syncrow_app/features/menu/view/widgets/profile_tab.dart';
|
import 'package:syncrow_app/features/menu/view/widgets/profile_tab.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
class MenuView extends StatelessWidget {
|
class MenuView extends StatelessWidget {
|
||||||
const MenuView({super.key});
|
const MenuView({super.key});
|
||||||
@ -13,17 +14,25 @@ class MenuView extends StatelessWidget {
|
|||||||
create: (BuildContext context) => MenuCubit(),
|
create: (BuildContext context) => MenuCubit(),
|
||||||
child: BlocBuilder<MenuCubit, MenuState>(
|
child: BlocBuilder<MenuCubit, MenuState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return SingleChildScrollView(
|
return Padding(
|
||||||
physics: const BouncingScrollPhysics(),
|
padding: EdgeInsets.only(
|
||||||
child: Column(
|
top: Constants.appBarHeight,
|
||||||
children: [
|
bottom: Constants.bottomNavBarHeight,
|
||||||
const ProfileTab(),
|
left: Constants.defaultPadding,
|
||||||
...MenuCubit.of(context).menuLists.map(
|
right: Constants.defaultPadding,
|
||||||
(list) => MenuList(
|
),
|
||||||
listModel: list,
|
child: SingleChildScrollView(
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const ProfileTab(),
|
||||||
|
...MenuCubit.of(context).menuLists.map(
|
||||||
|
(list) => MenuList(
|
||||||
|
listModel: list,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -6,6 +6,7 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dar
|
|||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.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/features/shared_widgets/text_widgets/title_medium.dart';
|
||||||
import 'package:syncrow_app/generated/assets.dart';
|
import 'package:syncrow_app/generated/assets.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
||||||
|
|
||||||
class SceneView extends StatelessWidget {
|
class SceneView extends StatelessWidget {
|
||||||
@ -17,99 +18,109 @@ class SceneView extends StatelessWidget {
|
|||||||
create: (BuildContext context) => SceneCubit(),
|
create: (BuildContext context) => SceneCubit(),
|
||||||
child: BlocBuilder<SceneCubit, SceneState>(
|
child: BlocBuilder<SceneCubit, SceneState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Column(
|
return Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
padding: EdgeInsets.only(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
top: Constants.appBarHeight,
|
||||||
children: [
|
bottom: Constants.bottomNavBarHeight,
|
||||||
const TitleMedium(
|
left: Constants.defaultPadding,
|
||||||
text: StringsManager.routine,
|
right: Constants.defaultPadding,
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: 32,
|
child: Column(
|
||||||
fontWeight: FontWeight.bold,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
const TitleMedium(
|
||||||
|
text: StringsManager.routine,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(height: 20),
|
const BodySmall(
|
||||||
const BodySmall(
|
text: StringsManager.tapToRunRoutine,
|
||||||
text: StringsManager.tapToRunRoutine,
|
),
|
||||||
),
|
Row(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Expanded(
|
||||||
Expanded(
|
child: Padding(
|
||||||
child: Padding(
|
padding: const EdgeInsets.symmetric(
|
||||||
padding: const EdgeInsets.symmetric(
|
vertical: 10,
|
||||||
vertical: 10,
|
),
|
||||||
),
|
child: DefaultContainer(
|
||||||
child: DefaultContainer(
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisAlignment:
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
height: 50,
|
height: 50,
|
||||||
width: 50,
|
width: 50,
|
||||||
Assets.iconsHot1,
|
Assets.iconsHot1,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.play_circle,
|
Icons.play_circle,
|
||||||
size: 40,
|
size: 40,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const BodyMedium(
|
const BodyMedium(
|
||||||
text: StringsManager.summerMode,
|
text: StringsManager.summerMode,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 10),
|
||||||
const SizedBox(width: 10),
|
Expanded(
|
||||||
Expanded(
|
child: Padding(
|
||||||
child: Padding(
|
padding: const EdgeInsets.symmetric(
|
||||||
padding: const EdgeInsets.symmetric(
|
vertical: 10,
|
||||||
vertical: 10,
|
),
|
||||||
),
|
child: DefaultContainer(
|
||||||
child: DefaultContainer(
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisAlignment:
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
height: 50,
|
height: 50,
|
||||||
width: 50,
|
width: 50,
|
||||||
Assets.iconsWinter1,
|
Assets.iconsWinter1,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.play_circle,
|
Icons.play_circle,
|
||||||
size: 40,
|
size: 40,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const BodyMedium(
|
const BodyMedium(
|
||||||
text: StringsManager.winterMode,
|
text: StringsManager.winterMode,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
)
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||||
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||||
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
import 'package:syncrow_app/utils/resource_manager/theme_manager.dart';
|
import 'package:syncrow_app/utils/resource_manager/theme_manager.dart';
|
||||||
|
|
||||||
import 'features/devices/bloc/devices_cubit.dart';
|
import 'features/devices/bloc/devices_cubit.dart';
|
||||||
@ -16,6 +17,10 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Constants.appBarHeight =
|
||||||
|
MediaQuery.sizeOf(context).height * Constants.appBarHeightPercentage;
|
||||||
|
Constants.bottomNavBarHeight = MediaQuery.sizeOf(context).height *
|
||||||
|
Constants.bottomNavBarHeightPercentage;
|
||||||
return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
abstract class ApiEndpoints {
|
abstract class ApiEndpoints {
|
||||||
static const String apiKey = '';
|
static const String apiKey = '';
|
||||||
|
|
||||||
|
//base
|
||||||
|
static const String baseUrl = 'faris:4001';
|
||||||
|
|
||||||
|
//auth
|
||||||
|
static const String auth = '/authentication/user';
|
||||||
|
static const String signUp = '$auth/signup';
|
||||||
|
static const String signIn = '$auth/login';
|
||||||
|
static const String sendOTP = '$auth/send-otp';
|
||||||
|
static const String verifyOTP = '$auth/verify-otp';
|
||||||
|
static const String forgetPassword = '$auth/forget-password';
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class HTTPService {
|
|||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T> getRequest<T>({
|
Future<T> get<T>({
|
||||||
required String path,
|
required String path,
|
||||||
Map<String, dynamic>? queryParameters,
|
Map<String, dynamic>? queryParameters,
|
||||||
required T Function(dynamic) expectedResponseModel,
|
required T Function(dynamic) expectedResponseModel,
|
||||||
@ -55,7 +55,7 @@ class HTTPService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T> postRequest<T>(
|
Future<T> post<T>(
|
||||||
{required String path,
|
{required String path,
|
||||||
Map<String, dynamic>? queryParameters,
|
Map<String, dynamic>? queryParameters,
|
||||||
Options? options,
|
Options? options,
|
||||||
@ -74,7 +74,7 @@ class HTTPService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T> patchRequest<T>(
|
Future<T> patch<T>(
|
||||||
{required String path,
|
{required String path,
|
||||||
Map<String, dynamic>? queryParameters,
|
Map<String, dynamic>? queryParameters,
|
||||||
dynamic body,
|
dynamic body,
|
||||||
@ -94,7 +94,7 @@ class HTTPService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T> downloadRequest<T>(
|
Future<T> download<T>(
|
||||||
{required String path,
|
{required String path,
|
||||||
required String savePath,
|
required String savePath,
|
||||||
Map<String, dynamic>? queryParameters,
|
Map<String, dynamic>? queryParameters,
|
||||||
|
@ -10,6 +10,7 @@ abstract class ColorsManager {
|
|||||||
static const Color primaryTextColor = Colors.black;
|
static const Color primaryTextColor = Colors.black;
|
||||||
|
|
||||||
static const Color greyColor = Color(0xFFd5d5d5);
|
static const Color greyColor = Color(0xFFd5d5d5);
|
||||||
|
|
||||||
static const Color backgroundColor = Color(0xFFececec);
|
static const Color backgroundColor = Color(0xFFececec);
|
||||||
static const Color dozeColor = Color(0xFFFEC258);
|
static const Color dozeColor = Color(0xFFFEC258);
|
||||||
static const Color relaxColor = Color(0xFFFBD288);
|
static const Color relaxColor = Color(0xFFFBD288);
|
||||||
|
@ -2,4 +2,11 @@ abstract class Constants {
|
|||||||
static const String languageCode = "en";
|
static const String languageCode = "en";
|
||||||
|
|
||||||
static const String countryCode = "US";
|
static const String countryCode = "US";
|
||||||
|
|
||||||
|
static const double appBarHeightPercentage = 0.1175;
|
||||||
|
static const double bottomNavBarHeightPercentage = 0.1175;
|
||||||
|
static late double appBarHeight;
|
||||||
|
static late double bottomNavBarHeight;
|
||||||
|
|
||||||
|
static const double defaultPadding = 16;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user