TM-164,165,167 bugs fixed

This commit is contained in:
amirrezaghabeli
2025-09-30 12:14:05 +03:30
parent fc925f7b84
commit 1746ff81bd
14 changed files with 369 additions and 301 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ class YourTendersApi {
required String createdTo, required String createdTo,
required String status, required String status,
}) { }) {
String url = '$tenderApproval?limit=$limit&offset=$offset'; String url = '$tenderApproval?limit=$limit&offset=$offset&status=submitted';
if (createdFrom.isNotEmpty && createdTo.isNotEmpty) { if (createdFrom.isNotEmpty && createdTo.isNotEmpty) {
url += '&created_from=$createdFrom&created_to=$createdTo'; url += '&created_from=$createdFrom&created_to=$createdTo';
@@ -56,12 +56,10 @@ class _DesktopForgotPasswordCreatePageState
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Center( Consumer<AuthViewModel>(
child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) { builder: (context, viewModel, _) {
return Center( return Expanded(
child: Padding( child: Center(
padding: const EdgeInsets.symmetric(horizontal: 110),
child: SizedBox( child: SizedBox(
width: 364, width: 364,
child: Column( child: Column(
@@ -98,8 +96,7 @@ class _DesktopForgotPasswordCreatePageState
LoginTextField( LoginTextField(
controller: viewModel.newPasswordController, controller: viewModel.newPasswordController,
focusNode: viewModel.newPasswordFocus, focusNode: viewModel.newPasswordFocus,
label: label: ForgotPasswordCreateStrings.createNewPassword,
ForgotPasswordCreateStrings.createNewPassword,
iconPath: AssetsManager.passwordIcon, iconPath: AssetsManager.passwordIcon,
isPassword: true, isPassword: true,
obscureText: viewModel.obscureForgotPassword, obscureText: viewModel.obscureForgotPassword,
@@ -193,7 +190,6 @@ class _DesktopForgotPasswordCreatePageState
); );
}, },
), ),
),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 20.0.h(), vertical: 20.0.h(),
@@ -61,8 +61,7 @@ class _DesktopForgotPasswordOtpPageState
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Expanded(
padding: const EdgeInsets.symmetric(horizontal: 100),
child: Center( child: Center(
child: SizedBox( child: SizedBox(
width: 364, width: 364,
@@ -62,8 +62,8 @@ class _DesktopForgotPasswordPageState extends State<DesktopForgotPasswordPage> {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Expanded(
padding: const EdgeInsets.symmetric(horizontal: 110), child: Center(
child: SizedBox( child: SizedBox(
width: 364, width: 364,
child: Column( child: Column(
@@ -117,7 +117,9 @@ class _DesktopForgotPasswordPageState extends State<DesktopForgotPasswordPage> {
onPressed: onPressed:
viewModel.isEmailValid viewModel.isEmailValid
? () async { ? () async {
await viewModel.forgotPassword(context); await viewModel.forgotPassword(
context,
);
} }
: null, : null,
), ),
@@ -139,6 +141,7 @@ class _DesktopForgotPasswordPageState extends State<DesktopForgotPasswordPage> {
), ),
), ),
), ),
),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 20.0.h(), vertical: 20.0.h(),
+8 -1
View File
@@ -230,7 +230,14 @@ class DesktopHomePage extends StatelessWidget {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index < homeViewModel.tenders.length) { if (index < homeViewModel.tenders.length) {
return TendersListItem(tender: homeViewModel.tenders[index]); return TendersListItem(
tender: homeViewModel.tenders[index],
onTap: () {
TenderDetailRouteData(
tenderId: homeViewModel.tenders[index].id!,
).push(context);
},
);
} else { } else {
return const Center( return const Center(
child: Padding( child: Padding(
+8 -1
View File
@@ -211,7 +211,14 @@ class MobileHomePage extends StatelessWidget {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index < homeViewModel.tenders.length) { if (index < homeViewModel.tenders.length) {
return TendersListItem(tender: homeViewModel.tenders[index]); return TendersListItem(
tender: homeViewModel.tenders[index],
onTap: () {
TenderDetailRouteData(
tenderId: homeViewModel.tenders[index].id!,
).push(context);
},
);
} else { } else {
return const Center( return const Center(
child: Padding( child: Padding(
+8 -1
View File
@@ -232,7 +232,14 @@ class TabletHomePage extends StatelessWidget {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index < homeViewModel.tenders.length) { if (index < homeViewModel.tenders.length) {
return TendersListItem(tender: homeViewModel.tenders[index]); return TendersListItem(
tender: homeViewModel.tenders[index],
onTap: () {
TenderDetailRouteData(
tenderId: homeViewModel.tenders[index].id!,
).push(context);
},
);
} else { } else {
return const Center( return const Center(
child: Padding( child: Padding(
+1
View File
@@ -16,4 +16,5 @@ class HomeStrings {
static const String tenderDeadline = 'Deadline'; static const String tenderDeadline = 'Deadline';
static const String recommendedTenders = 'Recommended Tenders'; static const String recommendedTenders = 'Recommended Tenders';
static const String tenderMatchProfile = 'Match with your profile'; static const String tenderMatchProfile = 'Match with your profile';
static const String seeMoreButton = 'See More';
} }
+16 -2
View File
@@ -8,11 +8,13 @@ import 'package:tm_app/views/home/widgets/tender_card_progress_bar.dart';
import '../../core/constants/assets.dart'; import '../../core/constants/assets.dart';
import '../../core/theme/colors.dart'; import '../../core/theme/colors.dart';
import '../../core/utils/size_config.dart'; import '../../core/utils/size_config.dart';
import '../shared/base_button.dart';
import '../shared/flag.dart'; import '../shared/flag.dart';
class TendersListItem extends StatelessWidget { class TendersListItem extends StatelessWidget {
const TendersListItem({required this.tender, super.key}); const TendersListItem({required this.tender, required this.onTap, super.key});
final TenderData tender; final TenderData tender;
final VoidCallback onTap;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -102,7 +104,8 @@ class TendersListItem extends StatelessWidget {
const TenderCardProgressBar(), const TenderCardProgressBar(),
SizedBox(height: 15.0.h()), SizedBox(height: 15.0.h()),
Row( Expanded(
child: Row(
children: [ children: [
SvgPicture.asset(AssetsManager.location), SvgPicture.asset(AssetsManager.location),
SizedBox(width: 1.0.w()), SizedBox(width: 1.0.w()),
@@ -119,8 +122,19 @@ class TendersListItem extends StatelessWidget {
? Flag(countryCode: tender.countryCode!) ? Flag(countryCode: tender.countryCode!)
: const Flag(countryCode: ''), : const Flag(countryCode: ''),
const Spacer(), const Spacer(),
BaseButton(
text: HomeStrings.seeMoreButton,
backgroundColor: AppColors.primary2,
isEnabled: true,
width: 100.0.w(),
height: 40.0.h(),
textColor: AppColors.mainBlue,
fontSize: 12.0.sp(),
onPressed: onTap,
),
], ],
), ),
),
], ],
), ),
), ),
+15 -8
View File
@@ -52,8 +52,10 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
mainAxisAlignment: mainAxisAlignment:
kIsWeb ? MainAxisAlignment.spaceAround : MainAxisAlignment.center, kIsWeb ? MainAxisAlignment.spaceAround : MainAxisAlignment.center,
children: [ children: [
SizedBox( Expanded(
width: 536, child: Center(
child: SizedBox(
width: 364,
child: Consumer<AuthViewModel>( child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) { builder: (context, viewModel, _) {
return Column( return Column(
@@ -87,7 +89,8 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
isPassword: true, isPassword: true,
obscureText: viewModel.obscurePassword, obscureText: viewModel.obscurePassword,
fieldHeight: 60.0.h(), fieldHeight: 60.0.h(),
onToggleVisibility: viewModel.togglePasswordVisibility, onToggleVisibility:
viewModel.togglePasswordVisibility,
borderRedus: 12, borderRedus: 12,
), ),
SizedBox(height: 32.0.h()), SizedBox(height: 32.0.h()),
@@ -125,9 +128,14 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
}, },
), ),
), ),
kIsWeb ),
? Padding( ),
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
Padding(
padding: EdgeInsets.symmetric(
vertical: 20.0.h(),
horizontal: 25.0.w(),
),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(32), borderRadius: BorderRadius.circular(32),
child: Image.asset( child: Image.asset(
@@ -137,8 +145,7 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
), ),
) ),
: Container(),
], ],
), ),
), ),
+9 -1
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/theme/colors.dart';
@@ -56,7 +57,14 @@ class _LoginTabletPageState extends State<LoginTabletPage> {
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
LoginLogo(width: 190.0.w(), height: 88.0.h()), Padding(
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
child: SvgPicture.asset(
AssetsManager.logoBig,
width: double.infinity,
height: 50.0.h(),
),
),
SizedBox(height: 32.0.h()), SizedBox(height: 32.0.h()),
const LoginTitle(), const LoginTitle(),
SizedBox(height: 32.0.h()), SizedBox(height: 32.0.h()),
@@ -45,6 +45,8 @@ class LoginTextField extends StatelessWidget {
horizontal: 12.0.w(), horizontal: 12.0.w(),
), ),
labelText: label, labelText: label,
filled: true,
fillColor: AppColors.grey0,
prefixIcon: prefixIcon:
iconPath != null iconPath != null
? Padding( ? Padding(
+8 -4
View File
@@ -16,9 +16,11 @@ class BaseButton extends StatelessWidget {
final double? borderRadius; final double? borderRadius;
final double? elevation; final double? elevation;
final double? width; final double? width;
final double? height;
final bool isLoading; final bool isLoading;
final String? icon; final String? icon;
final Color? iconColor; final Color? iconColor;
final double? fontSize;
const BaseButton({ const BaseButton({
required this.isEnabled, required this.isEnabled,
@@ -31,9 +33,11 @@ class BaseButton extends StatelessWidget {
this.borderRadius, this.borderRadius,
this.elevation, this.elevation,
this.width, this.width,
this.height,
this.isLoading = false, this.isLoading = false,
this.icon, this.icon,
this.iconColor, this.iconColor,
this.fontSize,
super.key, super.key,
}); });
@@ -42,7 +46,7 @@ class BaseButton extends StatelessWidget {
return isLoading return isLoading
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 55.0.h(), height: height ?? 55.0.h(),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.mainBlue, color: AppColors.mainBlue,
borderRadius: BorderRadius.circular(28.0.w()), borderRadius: BorderRadius.circular(28.0.w()),
@@ -60,7 +64,7 @@ class BaseButton extends StatelessWidget {
) )
: SizedBox( : SizedBox(
width: width ?? double.infinity, width: width ?? double.infinity,
height: 55.0.h(), height: height ?? 55.0.h(),
child: ElevatedButton( child: ElevatedButton(
onPressed: isEnabled ? onPressed : null, onPressed: isEnabled ? onPressed : null,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@@ -94,7 +98,7 @@ class BaseButton extends StatelessWidget {
Text( Text(
text ?? LoginStrings.loginButton, text ?? LoginStrings.loginButton,
style: TextStyle( style: TextStyle(
fontSize: 16.0.sp(), fontSize: fontSize ?? 16.0.sp(),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: textColor ?? AppColors.white, color: textColor ?? AppColors.white,
), ),
@@ -104,7 +108,7 @@ class BaseButton extends StatelessWidget {
: Text( : Text(
text ?? LoginStrings.loginButton, text ?? LoginStrings.loginButton,
style: TextStyle( style: TextStyle(
fontSize: 16.0.sp(), fontSize: fontSize ?? 16.0.sp(),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: textColor ?? AppColors.white, color: textColor ?? AppColors.white,
), ),
@@ -36,7 +36,20 @@ class DesktopNavigationWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
const SizedBox(width: 40), const SizedBox(width: 40),
SvgPicture.asset(AssetsManager.logoSmall), InkWell(
onTap: () {
if (currentIndex == 0) {
return;
} else {
Router.neglect(
context,
() => const HomeRouteData().go(context),
);
context.read<HomeViewModel>().init();
}
},
child: SvgPicture.asset(AssetsManager.logoSmall),
),
const Spacer(), const Spacer(),
_navigationItem( _navigationItem(
context: context, context: context,