fixed rtl supoort in some pages
This commit is contained in:
@@ -34,30 +34,35 @@ class _TabletTendersPageState extends State<TabletTendersPage> {
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
appBar: tabletAppBar(title: TendersStrings.tendersTitle, key: key),
|
||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||
body: SingleChildScrollView(
|
||||
child: Consumer<TendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(color: AppColors.jellyBean),
|
||||
);
|
||||
}
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
if ((viewModel.tendersResponse?.data?.tenders == null ||
|
||||
viewModel.tendersResponse!.data!.tenders!.isEmpty) &&
|
||||
viewModel.isLoading == false) {
|
||||
return const Center(child: Text(CommonStrings.noData));
|
||||
}
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 24.0.w(), top: 128.0.h()),
|
||||
child: MainTendersSlider(
|
||||
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
||||
),
|
||||
body: Consumer<TendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(color: AppColors.jellyBean),
|
||||
);
|
||||
},
|
||||
),
|
||||
}
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
if ((viewModel.tendersResponse?.data?.tenders == null ||
|
||||
viewModel.tendersResponse!.data!.tenders!.isEmpty) &&
|
||||
viewModel.isLoading == false) {
|
||||
return const Center(child: Text(CommonStrings.noData));
|
||||
}
|
||||
return Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
end: 24.0.w(),
|
||||
top: 128.0.h(),
|
||||
),
|
||||
child: MainTendersSlider(
|
||||
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,8 +83,11 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isLtr = Directionality.of(context) == TextDirection.ltr;
|
||||
return SingleChildScrollView(
|
||||
child: Stack(children: [_tendersPageView(), _nextPreviousArrows()]),
|
||||
child: Stack(
|
||||
children: [_tendersPageView(), _nextPreviousArrows(isLtr: isLtr)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -127,43 +130,48 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _nextPreviousArrows() {
|
||||
return Positioned(
|
||||
Widget _nextPreviousArrows({required bool isLtr}) {
|
||||
return PositionedDirectional(
|
||||
top: 607.0.h(),
|
||||
bottom: 52.0.h(),
|
||||
left: 9.0.w(),
|
||||
right: 9.0.w(),
|
||||
start: 9.0.w(),
|
||||
end: 9.0.w(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [_leftArrowButton(), _pageNumberText(), _rightArrowButton()],
|
||||
children: [
|
||||
_leftArrowButton(isLtr: isLtr),
|
||||
_pageNumberText(),
|
||||
_rightArrowButton(isLtr: isLtr),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _leftArrowButton() {
|
||||
return Visibility(
|
||||
visible: currentPage != 1,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToPreviousPage,
|
||||
child: Container(
|
||||
width: 32.0.h(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.iconColor, width: 1.5),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.arrowLeftSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
Widget _leftArrowButton({required bool isLtr}) {
|
||||
return currentPage != 1
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToPreviousPage,
|
||||
child: Container(
|
||||
width: 32.0.h(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.iconColor, width: 1.5),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
isLtr
|
||||
? AssetsManager.arrowLeftSmall
|
||||
: AssetsManager.arrowRightSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
)
|
||||
: SizedBox(width: 32.0.h(), height: 32.0.h());
|
||||
}
|
||||
|
||||
Widget _pageNumberText() {
|
||||
@@ -195,29 +203,30 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _rightArrowButton() {
|
||||
return Visibility(
|
||||
visible: currentPage != widget.tenders.length,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToNextPage,
|
||||
child: Container(
|
||||
width: 32.0.h(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.iconColor, width: 1.5),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.arrowRightSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
Widget _rightArrowButton({required bool isLtr}) {
|
||||
return currentPage != widget.tenders.length
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToNextPage,
|
||||
child: Container(
|
||||
width: 32.0.h(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.iconColor, width: 1.5),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
isLtr
|
||||
? AssetsManager.arrowRightSmall
|
||||
: AssetsManager.arrowLeftSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
)
|
||||
: SizedBox(width: 32.0.h(), height: 32.0.h());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user