fixed rtl supoort in some pages
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.57 5.93018L3.5 12.0002L9.57 18.0702" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M20.5 12H3.67004" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 395 B |
@@ -8,13 +8,13 @@ class AppConfig {
|
||||
|
||||
// این متد بر اساس محیط فعال، URL مناسب را برمیگرداند.
|
||||
static String get apiBaseUrl {
|
||||
return 'http://10.0.2.2:8081';
|
||||
// return 'http://10.0.2.2:8081';
|
||||
// return '192.168.1.103:8081';
|
||||
// if (isDevelopment) {
|
||||
// // Handle different platforms for local development
|
||||
// if (kIsWeb) {
|
||||
// For web, use localhost
|
||||
// return 'https://app.opplens.com';
|
||||
return 'https://app.opplens.com';
|
||||
// return 'http://localhost:8081';
|
||||
// } else {
|
||||
// For Android emulator, use 10.0.2.2 (special IP for host machine)
|
||||
|
||||
@@ -47,6 +47,7 @@ class AssetsManager {
|
||||
static const shield = 'assets/icons/shield.svg';
|
||||
static const edit = 'assets/icons/edit.svg';
|
||||
static const arrowRight = 'assets/icons/arrow-right.svg';
|
||||
static const leftArrow = 'assets/icons/left-arrow.svg';
|
||||
static const notification = 'assets/icons/notification.svg';
|
||||
static const danger = 'assets/icons/danger.svg';
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
appBar: appBar(
|
||||
@@ -96,7 +98,9 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
||||
builder: (context, tenderViewModel, child) {
|
||||
if (tenderViewModel.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.secondary50,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,6 +136,7 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class DesktopHomePage extends StatelessWidget {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 740),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
isYourTenders
|
||||
? HomeStrings.yourTenders
|
||||
|
||||
@@ -31,6 +31,7 @@ class TenderCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final directionality = Directionality.of(context);
|
||||
return InkWell(
|
||||
onTap: enableTap ? onTap : null,
|
||||
child: Container(
|
||||
@@ -67,7 +68,15 @@ class TenderCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
enableTap
|
||||
? SvgPicture.asset(AssetsManager.arrowRight)
|
||||
? SvgPicture.asset(
|
||||
directionality == TextDirection.rtl
|
||||
? AssetsManager.leftArrow
|
||||
: AssetsManager.arrowRight,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.grey50,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -87,9 +87,10 @@ class TendersListItem extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
tender.description!,
|
||||
textAlign: TextAlign.left,
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 4,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
|
||||
@@ -56,9 +56,7 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
endDrawer: Drawer(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.horizontal(left: Radius.circular(20)),
|
||||
),
|
||||
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
@@ -131,10 +129,6 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await viewModel.getLikedTenders(reset: true);
|
||||
},
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 24.0.w(),
|
||||
@@ -147,8 +141,7 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
||||
bool hasApproval = viewModel
|
||||
.hasTenderApprovalForTender(item.tenderId!);
|
||||
if (hasApproval) {
|
||||
approval = viewModel
|
||||
.getApprovalStatusForTender(
|
||||
approval = viewModel.getApprovalStatusForTender(
|
||||
item.tenderId!,
|
||||
);
|
||||
} else {
|
||||
@@ -185,7 +178,6 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 10.0.h()),
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: InkWell(
|
||||
onTap: () => viewModel.logout(),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
|
||||
@@ -145,7 +145,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: InkWell(
|
||||
onTap: () => viewModel.logout(),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
|
||||
@@ -35,6 +35,7 @@ PreferredSizeWidget appBar({
|
||||
required BuildContext context,
|
||||
required String title,
|
||||
}) {
|
||||
final isRtl = Directionality.of(context) == TextDirection.rtl;
|
||||
return PreferredSize(
|
||||
preferredSize: const Size.fromHeight(60),
|
||||
child: AppBar(
|
||||
@@ -43,7 +44,7 @@ PreferredSizeWidget appBar({
|
||||
titleSpacing: 0,
|
||||
leading: IconButton(
|
||||
icon: SvgPicture.asset(
|
||||
AssetsManager.arrowLeft,
|
||||
isRtl ? AssetsManager.arrowRight : AssetsManager.arrowLeft,
|
||||
height: 24.0.w(),
|
||||
width: 24.0.w(),
|
||||
),
|
||||
|
||||
@@ -34,8 +34,7 @@ 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>(
|
||||
body: Consumer<TendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return const Center(
|
||||
@@ -50,15 +49,21 @@ class _TabletTendersPageState extends State<TabletTendersPage> {
|
||||
viewModel.isLoading == false) {
|
||||
return const Center(child: Text(CommonStrings.noData));
|
||||
}
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 24.0.w(), top: 128.0.h()),
|
||||
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,23 +130,26 @@ 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(
|
||||
Widget _leftArrowButton({required bool isLtr}) {
|
||||
return currentPage != 1
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToPreviousPage,
|
||||
child: Container(
|
||||
@@ -155,15 +161,17 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.arrowLeftSmall,
|
||||
isLtr
|
||||
? AssetsManager.arrowLeftSmall
|
||||
: AssetsManager.arrowRightSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
)
|
||||
: SizedBox(width: 32.0.h(), height: 32.0.h());
|
||||
}
|
||||
|
||||
Widget _pageNumberText() {
|
||||
@@ -195,10 +203,9 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _rightArrowButton() {
|
||||
return Visibility(
|
||||
visible: currentPage != widget.tenders.length,
|
||||
child: InkWell(
|
||||
Widget _rightArrowButton({required bool isLtr}) {
|
||||
return currentPage != widget.tenders.length
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
onTap: _goToNextPage,
|
||||
child: Container(
|
||||
@@ -210,14 +217,16 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.arrowRightSmall,
|
||||
isLtr
|
||||
? AssetsManager.arrowRightSmall
|
||||
: AssetsManager.arrowLeftSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.iconColor,
|
||||
BlendMode.srcATop,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
)
|
||||
: SizedBox(width: 32.0.h(), height: 32.0.h());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
appBar: appBar(context: context, title: YourTendersStrings.yourTenders),
|
||||
body: Column(
|
||||
@@ -104,6 +106,7 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user