mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 06:14:55 +00:00
Fixed list issue in the manage home screen
This commit is contained in:
@ -16,23 +16,16 @@ class ManageHomeView extends StatelessWidget {
|
|||||||
var spaces = HomeCubit.getInstance().spaces;
|
var spaces = HomeCubit.getInstance().spaces;
|
||||||
return DefaultScaffold(
|
return DefaultScaffold(
|
||||||
title: 'Manage Your Home',
|
title: 'Manage Your Home',
|
||||||
child: spaces == null
|
height: MediaQuery.sizeOf(context).height,
|
||||||
|
child: spaces.isEmpty
|
||||||
? const Center(
|
? const Center(
|
||||||
child: BodyMedium(text: 'No spaces found'),
|
child: BodyMedium(text: 'No spaces found'),
|
||||||
)
|
)
|
||||||
: Column(
|
: DefaultContainer(
|
||||||
children: [
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
|
||||||
DefaultContainer(
|
child: ListView.builder(
|
||||||
padding: const EdgeInsets.symmetric(
|
itemCount: spaces.length,
|
||||||
horizontal: 25,
|
itemBuilder: (context, index) {
|
||||||
vertical: 20,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: List.generate(
|
|
||||||
spaces.length,
|
|
||||||
(index) {
|
|
||||||
if (index == spaces.length - 1) {
|
if (index == spaces.length - 1) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -74,7 +67,7 @@ class ManageHomeView extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
BodyMedium(text: HomeCubit.getInstance().spaces![index].name),
|
BodyMedium(text: HomeCubit.getInstance().spaces[index].name),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
color: ColorsManager.greyColor,
|
color: ColorsManager.greyColor,
|
||||||
@ -90,11 +83,7 @@ class ManageHomeView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user