push routines style and create scene view

This commit is contained in:
ashrafzarkanisala
2024-06-12 01:54:03 +03:00
parent 76f5c6d325
commit 1045d72bbe
21 changed files with 411 additions and 189 deletions
@@ -16,21 +16,21 @@ class AppBarHomeDropdown extends StatelessWidget {
builder: (context, state) {
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: HomeCubit.getInstance().selectedSpace!.id,
items: HomeCubit.getInstance().spaces!.map((space) {
return DropdownMenuItem(
value: space.id,
child: SizedBox(
width: 100,
child: Center(
child: DropdownButton(
icon: const Icon(
Icons.expand_more,
color: ColorsManager.textPrimaryColor,
size: 16,
),
underline: const SizedBox.shrink(),
padding: EdgeInsets.zero,
borderRadius: BorderRadius.circular(20),
value: HomeCubit.getInstance().selectedSpace!.id,
items: HomeCubit.getInstance().spaces!.map((space) {
return DropdownMenuItem(
alignment: AlignmentDirectional.centerStart,
value: space.id,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@@ -45,7 +45,8 @@ class AppBarHomeDropdown extends StatelessWidget {
),
),
const SizedBox(width: 5),
Expanded(
Flexible(
fit: FlexFit.loose,
child: BodyMedium(
text: space.name ?? "??",
style: context.bodyMedium.copyWith(
@@ -55,19 +56,20 @@ class AppBarHomeDropdown extends StatelessWidget {
),
),
),
const SizedBox(width: 5),
],
),
),
);
}).toList(),
onChanged: (value) {
if (value != null) {
HomeCubit.getInstance().changeSelectedSpace(
HomeCubit.getInstance()
.spaces!
.firstWhere((element) => element.id == value));
}
},
);
}).toList(),
onChanged: (value) {
if (value != null) {
HomeCubit.getInstance().changeSelectedSpace(
HomeCubit.getInstance()
.spaces!
.firstWhere((element) => element.id == value));
}
},
),
),
);
},
@@ -20,9 +20,11 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
leadingWidth: 150,
toolbarHeight: Constants.appBarHeight,
leading: HomeCubit.getInstance().spaces!.isNotEmpty
? HomeCubit.appBarLeading[HomeCubit.bottomNavItems[HomeCubit.pageIndex].label]
? HomeCubit.appBarLeading[
HomeCubit.bottomNavItems[HomeCubit.pageIndex].label]
: null,
// actions: HomeCubit.appBarActions[HomeCubit.bottomNavItems[HomeCubit.pageIndex].label],
actions: HomeCubit.appBarActions[
HomeCubit.bottomNavItems[HomeCubit.pageIndex].label],
));
},
);