mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
Partially implemented the page view functionality
-page controller on change need to be figured correctly
This commit is contained in:
@ -17,53 +17,56 @@ class AppBarHomeDropdown extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<SpacesCubit, SpacesState>(
|
||||
builder: (context, state) {
|
||||
return DropdownButton(
|
||||
icon: const Icon(
|
||||
Icons.expand_more,
|
||||
color: Colors.black,
|
||||
size: 25,
|
||||
),
|
||||
underline: const SizedBox.shrink(),
|
||||
padding: const EdgeInsets.all(0),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
value: SpacesCubit.get(context).selectedSpace,
|
||||
items: SpacesCubit.spaces.map((space) {
|
||||
return DropdownMenuItem(
|
||||
value: space,
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
SvgPicture.asset(
|
||||
Assets.iconsHome,
|
||||
width: 25,
|
||||
height: 25,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
ColorsManager.textPrimaryColor,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Expanded(
|
||||
child: BodyMedium(
|
||||
text: space.name,
|
||||
style: context.bodyMedium.copyWith(
|
||||
fontSize: 15,
|
||||
color: ColorsManager.textPrimaryColor,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: DropdownButton(
|
||||
icon: const Icon(
|
||||
Icons.expand_more,
|
||||
color: Colors.black,
|
||||
size: 25,
|
||||
),
|
||||
underline: const SizedBox.shrink(),
|
||||
padding: const EdgeInsets.all(0),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
value: SpacesCubit.get(context).selectedSpace,
|
||||
items: SpacesCubit.spaces.map((space) {
|
||||
return DropdownMenuItem(
|
||||
value: space,
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
SvgPicture.asset(
|
||||
Assets.iconsHome,
|
||||
width: 25,
|
||||
height: 25,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
ColorsManager.textPrimaryColor,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 5),
|
||||
Expanded(
|
||||
child: BodyMedium(
|
||||
text: space.name,
|
||||
style: context.bodyMedium.copyWith(
|
||||
fontSize: 15,
|
||||
color: ColorsManager.textPrimaryColor,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
SpacesCubit.get(context).selectSpace(value!);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
SpacesCubit.get(context).selectSpace(value!);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user