fixed rtl supoort in some pages
This commit is contained in:
@@ -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