Partially implemented the page view functionality

-page controller on change need to be figured correctly
This commit is contained in:
Mohammad Salameh
2024-03-06 23:11:09 +03:00
parent b3fcca639a
commit c5f88caec3
12 changed files with 503 additions and 276 deletions

View File

@ -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!);
},
),
);
},
);