mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
Fixed the overflow in the login screen, the page is scrollable.
- Fixed Scrolling wasent working in login screen - Changed Home page to indexed based view instead of PageView
This commit is contained in:
@ -17,10 +17,8 @@ class NavCubit extends Cubit<NavState> {
|
||||
|
||||
static NavCubit of(context) => BlocProvider.of<NavCubit>(context);
|
||||
|
||||
//functoin to do the important work when the user logs out
|
||||
static clear() {
|
||||
pageIndex = 0;
|
||||
pageController.jumpToPage(0);
|
||||
}
|
||||
|
||||
static int pageIndex = 0;
|
||||
@ -146,12 +144,9 @@ class NavCubit extends Cubit<NavState> {
|
||||
const MenuView(),
|
||||
];
|
||||
|
||||
static final PageController pageController = PageController();
|
||||
|
||||
void updatePageIndex(int index) {
|
||||
pageIndex = index;
|
||||
pageController.animateToPage(index,
|
||||
duration: const Duration(milliseconds: 150), curve: Curves.easeIn);
|
||||
|
||||
emit(NavChangePage());
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import 'package:syncrow_app/features/app_layout/bloc/spaces_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/features/devices/bloc/devices_cubit.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
@ -14,8 +15,15 @@ class AppLayout extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => SpacesCubit(),
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider(
|
||||
create: (context) => SpacesCubit(),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (context) => DevicesCubit(),
|
||||
),
|
||||
],
|
||||
child: BlocListener<SpacesCubit, SpacesState>(
|
||||
listener: (context, state) {
|
||||
if (state is SpacesError) {
|
||||
|
@ -38,11 +38,7 @@ class AppBody extends StatelessWidget {
|
||||
},
|
||||
builder: (context, state) {
|
||||
return state is! SpacesLoading || state is! SpaceRoomsLoading
|
||||
? PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: NavCubit.pageController,
|
||||
children: NavCubit.of(context).pages,
|
||||
)
|
||||
? NavCubit.of(context).pages[NavCubit.pageIndex]
|
||||
: const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
),
|
||||
|
@ -33,40 +33,40 @@ class LoginView extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
Assets.imagesBackground,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
Assets.imagesBackground,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(Assets.imagesVector),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.9,
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(Assets.imagesVector),
|
||||
fit: BoxFit.cover,
|
||||
opacity: 0.9,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: Constants.defaultPadding,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: Constants.defaultPadding,
|
||||
left: Constants.defaultPadding,
|
||||
top: Constants.defaultPadding,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -99,9 +99,9 @@ class LoginView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: constant_identifier_names, unused_import
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -22,273 +22,51 @@ part 'devices_state.dart';
|
||||
|
||||
class DevicesCubit extends Cubit<DevicesState> {
|
||||
DevicesCubit() : super(DevicesInitial()) {
|
||||
fetchGroups(SpacesCubit.selectedSpace!);
|
||||
fetchGroups(SpacesCubit.selectedSpace!.id!);
|
||||
}
|
||||
|
||||
static DevicesCubit get(context) => BlocProvider.of(context);
|
||||
|
||||
static List<DevicesCategoryModel> allCategories = [
|
||||
// DevicesCategoryModel(
|
||||
// devices: [
|
||||
// DeviceModel(
|
||||
// name: "Living Room AC",
|
||||
// id: 0,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// temperature: 20,
|
||||
// fanSpeed: 0,
|
||||
// tempMode: 0,
|
||||
// coolTo: 20,
|
||||
// type: DeviceType.AC,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// bounds: Bounds(
|
||||
// min: 20,
|
||||
// max: 30,
|
||||
// ),
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Master Bedroom AC",
|
||||
// id: 1,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// temperature: 20,
|
||||
// fanSpeed: 0,
|
||||
// tempMode: 0,
|
||||
// coolTo: 20,
|
||||
// type: DeviceType.AC,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// bounds: Bounds(
|
||||
// min: 20,
|
||||
// max: 30,
|
||||
// ),
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Kitchen AC",
|
||||
// id: 2,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// temperature: 20,
|
||||
// fanSpeed: 0,
|
||||
// tempMode: 0,
|
||||
// coolTo: 20,
|
||||
// type: DeviceType.AC,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// bounds: Bounds(
|
||||
// min: 20,
|
||||
// max: 30,
|
||||
// ),
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Bathroom AC",
|
||||
// id: 3,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// temperature: 20,
|
||||
// fanSpeed: 0,
|
||||
// tempMode: 0,
|
||||
// coolTo: 20,
|
||||
// type: DeviceType.AC,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// bounds: Bounds(
|
||||
// min: 20,
|
||||
// max: 30,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// icon: Assets.iconsAC,
|
||||
// name: 'ACs',
|
||||
// type: DeviceType.AC,
|
||||
// page: const ACsView(),
|
||||
// ),
|
||||
// DevicesCategoryModel(
|
||||
// devices: [
|
||||
// DeviceModel(
|
||||
// name: "Living Room Light",
|
||||
// id: 0,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// color: 0,
|
||||
// brightness: 20,
|
||||
// lightingMode: 1,
|
||||
// timer: null,
|
||||
// type: DeviceType.Lights,
|
||||
// image: '',
|
||||
// recentColors: [
|
||||
// 0xFF83D9FF,
|
||||
// 0xFFFC3E81,
|
||||
// 0xFFC0FF66,
|
||||
// 0xFFFDC242,
|
||||
// ],
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Master Bedroom Light",
|
||||
// id: 1,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// color: 2,
|
||||
// brightness: 40,
|
||||
// lightingMode: 1,
|
||||
// timer: null,
|
||||
// type: DeviceType.Lights,
|
||||
// image: '',
|
||||
// recentColors: [
|
||||
// 0xFF83D9FF,
|
||||
// 0xFFFC3E81,
|
||||
// 0xFFC0FF66,
|
||||
// 0xFFFDC242,
|
||||
// ],
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Kitchen Light",
|
||||
// id: 2,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// color: 1,
|
||||
// brightness: 60,
|
||||
// lightingMode: 1,
|
||||
// timer: null,
|
||||
// type: DeviceType.Lights,
|
||||
// image: '',
|
||||
// recentColors: [
|
||||
// 0xFF83D9FF,
|
||||
// 0xFFFC3E81,
|
||||
// 0xFFC0FF66,
|
||||
// 0xFFFDC242,
|
||||
// ],
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Bathroom Light",
|
||||
// id: 3,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// color: 3,
|
||||
// brightness: 80,
|
||||
// lightingMode: 1,
|
||||
// timer: null,
|
||||
// type: DeviceType.Lights,
|
||||
// image: '',
|
||||
// recentColors: [
|
||||
// 0xFF83D9FF,
|
||||
// 0xFFFC3E81,
|
||||
// 0xFFC0FF66,
|
||||
// 0xFFFDC242,
|
||||
// ],
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// name: "Balcony Light",
|
||||
// id: 4,
|
||||
// functions: [],
|
||||
// status: false,
|
||||
// color: 4,
|
||||
// brightness: 100,
|
||||
// lightingMode: 1,
|
||||
// timer: null,
|
||||
// type: DeviceType.Lights,
|
||||
// image: '',
|
||||
// recentColors: [
|
||||
// 0xFF83D9FF,
|
||||
// 0xFFFC3E81,
|
||||
// 0xFFC0FF66,
|
||||
// 0xFFFDC242,
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// icon: Assets.iconsLight,
|
||||
// name: 'Lights',
|
||||
// type: DeviceType.Lights,
|
||||
// page: const LightsView(),
|
||||
// ),
|
||||
// DevicesCategoryModel(
|
||||
// devices: [],
|
||||
// icon: Assets.iconsDoorLock,
|
||||
// name: 'Doors',
|
||||
// type: DeviceType.DoorLock,
|
||||
// page: const DoorView(),
|
||||
// ),
|
||||
// DevicesCategoryModel(
|
||||
// devices: [
|
||||
// DeviceModel(
|
||||
// openPercentage: 10,
|
||||
// id: 1,
|
||||
// functions: [],
|
||||
// name: "Living Room Curtain",
|
||||
// status: false,
|
||||
// type: DeviceType.Curtain,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// ),
|
||||
// DeviceModel(
|
||||
// openPercentage: 20,
|
||||
// id: 2,
|
||||
// functions: [],
|
||||
// name: "Master Bedroom Curtain",
|
||||
// status: false,
|
||||
// type: DeviceType.Curtain,
|
||||
// image: '',
|
||||
// timer: null,
|
||||
// ),
|
||||
// ],
|
||||
// icon: Assets.iconsCurtain,
|
||||
// name: 'Curtains',
|
||||
// type: DeviceType.Curtain,
|
||||
// page: const CurtainView(),
|
||||
// ),
|
||||
// DevicesCategoryModel(
|
||||
// devices: [],
|
||||
// icon: Assets.icons3GangSwitch,
|
||||
// name: 'Bedroom Lights',
|
||||
// type: DeviceType.ThreeGang,
|
||||
// page: const LightSwitchesView(),
|
||||
// ),
|
||||
// DevicesCategoryModel(
|
||||
// devices: [],
|
||||
// icon: Assets.iconsGateway,
|
||||
// name: 'Gateway',
|
||||
// type: DeviceType.Gateway,
|
||||
// page: const GateWayView(),
|
||||
// ),
|
||||
];
|
||||
static List<DevicesCategoryModel>? allCategories;
|
||||
|
||||
selectCategory(int index) {
|
||||
for (var i = 0; i < allCategories.length; i++) {
|
||||
for (var i = 0; i < allCategories!.length; i++) {
|
||||
if (i == index) {
|
||||
allCategories[i].isSelected = true;
|
||||
allCategories![i].isSelected = true;
|
||||
} else {
|
||||
allCategories[i].isSelected = false;
|
||||
allCategories![i].isSelected = false;
|
||||
}
|
||||
}
|
||||
emit(DevicesCategoryChanged());
|
||||
}
|
||||
|
||||
unselectAllCategories() {
|
||||
for (var category in allCategories) {
|
||||
for (var category in allCategories!) {
|
||||
category.isSelected = false;
|
||||
}
|
||||
emit(DevicesCategoryChanged());
|
||||
}
|
||||
|
||||
Widget? get chosenCategoryView {
|
||||
for (var category in allCategories) {
|
||||
if (category.isSelected) {
|
||||
switch (category.type) {
|
||||
case DeviceType.AC:
|
||||
return const ACsView();
|
||||
case DeviceType.Lights:
|
||||
return const LightsView();
|
||||
case DeviceType.DoorLock:
|
||||
return const DoorView();
|
||||
case DeviceType.Curtain:
|
||||
return const CurtainView();
|
||||
case DeviceType.ThreeGang:
|
||||
return const LightSwitchesView();
|
||||
case DeviceType.Gateway:
|
||||
return const GateWayView();
|
||||
default:
|
||||
return null;
|
||||
if (allCategories != null) {
|
||||
for (var category in allCategories!) {
|
||||
if (category.isSelected) {
|
||||
switch (category.type) {
|
||||
case DeviceType.AC:
|
||||
return const ACsView();
|
||||
case DeviceType.Lights:
|
||||
return const LightsView();
|
||||
case DeviceType.DoorLock:
|
||||
return const DoorView();
|
||||
case DeviceType.Curtain:
|
||||
return const CurtainView();
|
||||
case DeviceType.ThreeGang:
|
||||
return const LightSwitchesView();
|
||||
case DeviceType.Gateway:
|
||||
return const GateWayView();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -296,7 +74,7 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
}
|
||||
|
||||
DevicesCategoryModel? get chosenCategory {
|
||||
for (var category in allCategories) {
|
||||
for (var category in allCategories!) {
|
||||
if (category.isSelected) {
|
||||
return category;
|
||||
}
|
||||
@ -305,7 +83,7 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
}
|
||||
|
||||
selectDevice(DeviceModel device) {
|
||||
for (var category in allCategories) {
|
||||
for (var category in allCategories!) {
|
||||
if (category.devices != null) {
|
||||
for (var device in category.devices!) {
|
||||
if (device.isSelected) {
|
||||
@ -321,7 +99,7 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
}
|
||||
|
||||
DeviceModel? getSelectedDevice() {
|
||||
for (var category in allCategories) {
|
||||
for (var category in allCategories!) {
|
||||
if (category.devices != null) {
|
||||
for (var device in category.devices!) {
|
||||
if (device.isSelected) {
|
||||
@ -356,7 +134,7 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
|
||||
turnOnOffDevice(DeviceModel device) {
|
||||
device.status = !device.status!;
|
||||
DevicesCategoryModel category = allCategories.firstWhere((category) {
|
||||
DevicesCategoryModel category = allCategories!.firstWhere((category) {
|
||||
if (category.devices != null) {
|
||||
return category.devices!.contains(device);
|
||||
} else {
|
||||
@ -427,7 +205,7 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
}
|
||||
|
||||
clearCategoriesSelection(BuildContext context) {
|
||||
for (var category in allCategories) {
|
||||
for (var category in allCategories!) {
|
||||
category.isSelected = false;
|
||||
if (category.devices != null) {
|
||||
for (var device in category.devices!) {
|
||||
@ -450,16 +228,10 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
}
|
||||
}
|
||||
|
||||
fetchGroups(
|
||||
SpaceModel space,
|
||||
) async {
|
||||
fetchGroups(int spaceId) async {
|
||||
try {
|
||||
if (state is! DevicesCategoriesLoading) {
|
||||
emit(DevicesCategoriesLoading());
|
||||
allCategories = await DevicesAPI.fetchGroups(space.id!);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
emit(DevicesCategoriesLoading());
|
||||
allCategories = await DevicesAPI.fetchGroups(spaceId);
|
||||
emit(DevicesCategoriesSuccess());
|
||||
} on DioException catch (error) {
|
||||
emit(
|
||||
|
@ -27,8 +27,8 @@ class LightsView extends StatelessWidget {
|
||||
as DeviceModel;
|
||||
}
|
||||
List<DeviceModel> lights = [];
|
||||
if (DevicesCubit.allCategories[1].devices != null) {
|
||||
for (var device in DevicesCubit.allCategories[1].devices!) {
|
||||
if (DevicesCubit.allCategories![1].devices != null) {
|
||||
for (var device in DevicesCubit.allCategories![1].devices!) {
|
||||
lights.add(device);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class LightsViewList extends StatelessWidget {
|
||||
children: [
|
||||
const BodySmall(text: "All Lights"),
|
||||
UniversalSwitch(
|
||||
category: DevicesCubit.allCategories[1],
|
||||
category: DevicesCubit.allCategories![1],
|
||||
),
|
||||
LightsList(lights: lights),
|
||||
],
|
||||
|
@ -18,71 +18,80 @@ class WizartSwitches extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<DevicesCubit, DevicesState>(
|
||||
builder: (context, state) {
|
||||
return state is DevicesLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
childAspectRatio: 1.5,
|
||||
),
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: DevicesCubit.allCategories.length,
|
||||
itemBuilder: (_, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
DevicesCubit.get(context).selectCategory(index);
|
||||
//Navigate to the chosen category view without animation
|
||||
return state is! DevicesLoading
|
||||
? DevicesCubit.allCategories != null
|
||||
? GridView.builder(
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
childAspectRatio: 1.5,
|
||||
),
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: DevicesCubit.allCategories!.length,
|
||||
itemBuilder: (_, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
DevicesCubit.get(context).selectCategory(index);
|
||||
//Navigate to the chosen category view without animation
|
||||
|
||||
Navigator.push(context,
|
||||
CustomPageRoute(builder: (context) {
|
||||
return DevicesCubit.get(context).chosenCategoryView!;
|
||||
}));
|
||||
},
|
||||
child: DefaultContainer(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10, right: 10, left: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
Navigator.push(context,
|
||||
CustomPageRoute(builder: (context) {
|
||||
return DevicesCubit.get(context)
|
||||
.chosenCategoryView!;
|
||||
}));
|
||||
},
|
||||
child: DefaultContainer(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 10, right: 10, left: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
DevicesCubit.allCategories[index].icon!,
|
||||
fit: BoxFit.contain,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
DevicesCubit.allCategories![index].icon!,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
CustomSwitch(
|
||||
category:
|
||||
DevicesCubit.allCategories![index],
|
||||
),
|
||||
],
|
||||
),
|
||||
CustomSwitch(
|
||||
category: DevicesCubit.allCategories[index],
|
||||
Expanded(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: BodyLarge(
|
||||
text: DevicesCubit
|
||||
.allCategories![index].name!,
|
||||
style: context.bodyLarge.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 0,
|
||||
fontSize: 24,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: BodyLarge(
|
||||
text: DevicesCubit.allCategories[index].name!,
|
||||
style: context.bodyLarge.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 0,
|
||||
fontSize: 24,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
: const SizedBox.shrink()
|
||||
: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -5,8 +5,6 @@ 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/constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/theme_manager.dart';
|
||||
|
||||
import 'features/devices/bloc/devices_cubit.dart';
|
||||
import 'navigation/router.dart' as router;
|
||||
import 'navigation/routing_constants.dart';
|
||||
|
||||
@ -30,9 +28,6 @@ class MyApp extends StatelessWidget {
|
||||
lazy: false,
|
||||
create: (context) => NavCubit(),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (context) => DevicesCubit(),
|
||||
),
|
||||
],
|
||||
child: MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
|
@ -38,8 +38,8 @@ class HTTPService {
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
|
||||
debugPrint("status code is ${response.statusCode}");
|
||||
debugPrint("response data is ${response.data}");
|
||||
// debugPrint("status code is ${response.statusCode}");
|
||||
// debugPrint("response data is ${response.data}");
|
||||
return expectedResponseModel(response.data);
|
||||
} catch (error) {
|
||||
debugPrint("******* Error");
|
||||
|
Reference in New Issue
Block a user