fix selection from dynamic table

This commit is contained in:
ashrafzarkanisala
2024-09-02 19:26:52 +03:00
parent 4cf9d4c2f2
commit 7bbae2d332
10 changed files with 96 additions and 39 deletions

View File

@ -15,13 +15,14 @@ class WebAppBar extends StatelessWidget with HelperResponsiveLayout {
@override
Widget build(BuildContext context) {
bool isSmallScreen = isSmallScreenSize(context);
bool isHalfMediumScreen = isHafMediumScreenSize(context);
return BlocBuilder<HomeBloc, HomeState>(builder: (context, state) {
final user = context.read<HomeBloc>().user;
return Container(
height: isSmallScreen ? 130 : 100,
height: (isSmallScreen || isHalfMediumScreen) ? 130 : 100,
decoration: const BoxDecoration(color: ColorsManager.secondaryColor),
padding: const EdgeInsets.all(10),
child: isSmallScreen
child: isSmallScreen || isHalfMediumScreen
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -31,14 +32,11 @@ class WebAppBar extends StatelessWidget with HelperResponsiveLayout {
child: title!,
),
if (centerBody != null)
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: centerBody,
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: centerBody,
),
if (rightBody != null || HomeBloc.user != null)
if (rightBody != null || user != null)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -61,9 +59,9 @@ class WebAppBar extends StatelessWidget with HelperResponsiveLayout {
const SizedBox(
width: 10,
),
if (HomeBloc.user != null)
if (user != null)
Text(
'${HomeBloc.user!.firstName} ${HomeBloc.user!.lastName}',
'${user.firstName} ${user.lastName}',
style: Theme.of(context).textTheme.bodyLarge,
),
],
@ -78,14 +76,19 @@ class WebAppBar extends StatelessWidget with HelperResponsiveLayout {
children: [
Align(
alignment: Alignment.centerLeft,
child: title!,
),
if (centerBody != null)
Expanded(
child: Center(
child: centerBody,
child: Expanded(
child: Row(
children: [
title!,
if (centerBody != null)
Padding(
padding: const EdgeInsets.only(left: 80),
child: centerBody!,
),
],
),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -113,9 +116,9 @@ class WebAppBar extends StatelessWidget with HelperResponsiveLayout {
const SizedBox(
width: 10,
),
if (HomeBloc.user != null)
if (user != null)
Text(
'${HomeBloc.user!.firstName} ${HomeBloc.user!.lastName}',
'${user.firstName} ${user.lastName}',
style: Theme.of(context).textTheme.bodyLarge,
),
],