mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 07:29:40 +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;
|
||||
return DefaultScaffold(
|
||||
title: 'Manage Your Home',
|
||||
child: spaces == null
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
child: spaces.isEmpty
|
||||
? const Center(
|
||||
child: BodyMedium(text: 'No spaces found'),
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
DefaultContainer(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 25,
|
||||
vertical: 20,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: List.generate(
|
||||
spaces.length,
|
||||
(index) {
|
||||
: DefaultContainer(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
|
||||
child: ListView.builder(
|
||||
itemCount: spaces.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == spaces.length - 1) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
@ -74,7 +67,7 @@ class ManageHomeView extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(text: HomeCubit.getInstance().spaces![index].name),
|
||||
BodyMedium(text: HomeCubit.getInstance().spaces[index].name),
|
||||
const Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: ColorsManager.greyColor,
|
||||
@ -90,11 +83,7 @@ class ManageHomeView extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
}),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user