Merge pull request 'TM-164,165,167 bugs fixed' (#192) from bugs into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/192
This commit is contained in:
@@ -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,143 +56,139 @@ class _DesktopForgotPasswordCreatePageState
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Consumer<AuthViewModel>(
|
||||||
child: Consumer<AuthViewModel>(
|
builder: (context, viewModel, _) {
|
||||||
builder: (context, viewModel, _) {
|
return Expanded(
|
||||||
return Center(
|
child: Center(
|
||||||
child: Padding(
|
child: SizedBox(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 110),
|
width: 364,
|
||||||
child: SizedBox(
|
child: Column(
|
||||||
width: 364,
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Column(
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
Padding(
|
||||||
children: [
|
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||||
Padding(
|
child: SvgPicture.asset(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
AssetsManager.logoBig,
|
||||||
child: SvgPicture.asset(
|
width: double.infinity,
|
||||||
AssetsManager.logoBig,
|
height: 50.0.h(),
|
||||||
width: double.infinity,
|
|
||||||
height: 50.0.h(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 72.0.h()),
|
),
|
||||||
Text(
|
SizedBox(height: 72.0.h()),
|
||||||
ForgotPasswordCreateStrings.forgotPasswordTitle,
|
Text(
|
||||||
style: TextStyle(
|
ForgotPasswordCreateStrings.forgotPasswordTitle,
|
||||||
fontSize: 28.0.sp(),
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontSize: 28.0.sp(),
|
||||||
color: AppColors.grey80,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
color: AppColors.grey80,
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.0.h()),
|
),
|
||||||
Text(
|
SizedBox(height: 16.0.h()),
|
||||||
ForgotPasswordCreateStrings.forgotPasswordSubtitle,
|
Text(
|
||||||
textAlign: TextAlign.center,
|
ForgotPasswordCreateStrings.forgotPasswordSubtitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 40.0.h()),
|
||||||
|
LoginTextField(
|
||||||
|
controller: viewModel.newPasswordController,
|
||||||
|
focusNode: viewModel.newPasswordFocus,
|
||||||
|
label: ForgotPasswordCreateStrings.createNewPassword,
|
||||||
|
iconPath: AssetsManager.passwordIcon,
|
||||||
|
isPassword: true,
|
||||||
|
obscureText: viewModel.obscureForgotPassword,
|
||||||
|
onToggleVisibility:
|
||||||
|
viewModel.toggleForgotPasswordVisibility,
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
padding: EdgeInsets.only(left: 16.0.w()),
|
||||||
|
child: Text(
|
||||||
|
ForgotPasswordCreateStrings.atLast5Character,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 14.0.sp(),
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
color: AppColors.grey60,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 40.0.h()),
|
),
|
||||||
LoginTextField(
|
SizedBox(height: 6.0.h()),
|
||||||
controller: viewModel.newPasswordController,
|
Container(
|
||||||
focusNode: viewModel.newPasswordFocus,
|
alignment: Alignment.centerLeft,
|
||||||
label:
|
padding: EdgeInsets.only(left: 16.0.w()),
|
||||||
ForgotPasswordCreateStrings.createNewPassword,
|
child: Text(
|
||||||
iconPath: AssetsManager.passwordIcon,
|
ForgotPasswordCreateStrings.atLeast1uppercase,
|
||||||
isPassword: true,
|
style: TextStyle(
|
||||||
obscureText: viewModel.obscureForgotPassword,
|
fontSize: 14.0.sp(),
|
||||||
onToggleVisibility:
|
color: AppColors.grey60,
|
||||||
viewModel.toggleForgotPasswordVisibility,
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
padding: EdgeInsets.only(left: 16.0.w()),
|
|
||||||
child: Text(
|
|
||||||
ForgotPasswordCreateStrings.atLast5Character,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 6.0.h()),
|
),
|
||||||
Container(
|
SizedBox(height: 6.0.h()),
|
||||||
alignment: Alignment.centerLeft,
|
Container(
|
||||||
padding: EdgeInsets.only(left: 16.0.w()),
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
padding: EdgeInsets.only(left: 16.0.w()),
|
||||||
ForgotPasswordCreateStrings.atLeast1uppercase,
|
child: Text(
|
||||||
style: TextStyle(
|
ForgotPasswordCreateStrings.atLeast1lowercase,
|
||||||
fontSize: 14.0.sp(),
|
style: TextStyle(
|
||||||
color: AppColors.grey60,
|
fontSize: 14.0.sp(),
|
||||||
),
|
color: AppColors.grey60,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 6.0.h()),
|
),
|
||||||
Container(
|
SizedBox(height: 6.0.h()),
|
||||||
alignment: Alignment.centerLeft,
|
Container(
|
||||||
padding: EdgeInsets.only(left: 16.0.w()),
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
padding: EdgeInsets.only(left: 16.0.w()),
|
||||||
ForgotPasswordCreateStrings.atLeast1lowercase,
|
child: Text(
|
||||||
style: TextStyle(
|
ForgotPasswordCreateStrings.atLeastSpecial,
|
||||||
fontSize: 14.0.sp(),
|
style: TextStyle(
|
||||||
color: AppColors.grey60,
|
fontSize: 14.0.sp(),
|
||||||
),
|
color: AppColors.grey60,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 6.0.h()),
|
),
|
||||||
Container(
|
SizedBox(height: 80.0.h()),
|
||||||
alignment: Alignment.centerLeft,
|
viewModel.isResetPasswordLoading
|
||||||
padding: EdgeInsets.only(left: 16.0.w()),
|
? BaseButton(
|
||||||
child: Text(
|
isEnabled: viewModel.isNewPasswordValid,
|
||||||
ForgotPasswordCreateStrings.atLeastSpecial,
|
text: ForgotPasswordCreateStrings.resetLink,
|
||||||
style: TextStyle(
|
onPressed: null,
|
||||||
fontSize: 14.0.sp(),
|
isLoading: true,
|
||||||
color: AppColors.grey60,
|
)
|
||||||
),
|
: BaseButton(
|
||||||
|
isEnabled: viewModel.isNewPasswordValid,
|
||||||
|
text: ForgotPasswordCreateStrings.resetLink,
|
||||||
|
onPressed:
|
||||||
|
viewModel.isNewPasswordValid
|
||||||
|
? () async {
|
||||||
|
viewModel.resetPassword();
|
||||||
|
}
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
SizedBox(height: 80.0.h()),
|
|
||||||
viewModel.isResetPasswordLoading
|
|
||||||
? BaseButton(
|
|
||||||
isEnabled: viewModel.isNewPasswordValid,
|
|
||||||
text: ForgotPasswordCreateStrings.resetLink,
|
|
||||||
onPressed: null,
|
|
||||||
isLoading: true,
|
|
||||||
)
|
|
||||||
: BaseButton(
|
|
||||||
isEnabled: viewModel.isNewPasswordValid,
|
|
||||||
text: ForgotPasswordCreateStrings.resetLink,
|
|
||||||
onPressed:
|
|
||||||
viewModel.isNewPasswordValid
|
|
||||||
? () async {
|
|
||||||
viewModel.resetPassword();
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
|
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
ForgotPasswordCreateStrings.backToSignInButton,
|
ForgotPasswordCreateStrings.backToSignInButton,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 14.0.sp(),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: AppColors.mainBlue,
|
color: AppColors.mainBlue,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -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,80 +62,83 @@ 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(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
AssetsManager.logoBig,
|
AssetsManager.logoBig,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 50.0.h(),
|
height: 50.0.h(),
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 72.0.h()),
|
|
||||||
Text(
|
|
||||||
ForgotPasswordStrings.forgotPasswordTitle,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 28.0.sp(),
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: AppColors.grey80,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
Text(
|
|
||||||
ForgotPasswordStrings.forgotPasswordSubtitle,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 40.0.h()),
|
|
||||||
LoginTextField(
|
|
||||||
controller: viewModel.emailController,
|
|
||||||
focusNode: viewModel.emailFocus,
|
|
||||||
label: ForgotPasswordStrings.emailHint,
|
|
||||||
isPassword: false,
|
|
||||||
),
|
|
||||||
SizedBox(height: 70.0.h()),
|
|
||||||
viewModel.isLoadingForgot
|
|
||||||
? const BaseButton(
|
|
||||||
isEnabled: false,
|
|
||||||
text: ForgotPasswordStrings.resetLink,
|
|
||||||
onPressed: null,
|
|
||||||
isLoading: true,
|
|
||||||
)
|
|
||||||
: BaseButton(
|
|
||||||
isEnabled: viewModel.isEmailValid,
|
|
||||||
text: ForgotPasswordStrings.resetLink,
|
|
||||||
onPressed:
|
|
||||||
viewModel.isEmailValid
|
|
||||||
? () async {
|
|
||||||
await viewModel.forgotPassword(context);
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
TextButton(
|
SizedBox(height: 72.0.h()),
|
||||||
onPressed: () {
|
Text(
|
||||||
Navigator.pop(context);
|
ForgotPasswordStrings.forgotPasswordTitle,
|
||||||
},
|
style: TextStyle(
|
||||||
child: Text(
|
fontSize: 28.0.sp(),
|
||||||
ForgotPasswordStrings.backToSignInButton,
|
fontWeight: FontWeight.bold,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
Text(
|
||||||
|
ForgotPasswordStrings.forgotPasswordSubtitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 14.0.sp(),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w400,
|
||||||
color: AppColors.mainBlue,
|
color: AppColors.grey60,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 40.0.h()),
|
||||||
],
|
LoginTextField(
|
||||||
|
controller: viewModel.emailController,
|
||||||
|
focusNode: viewModel.emailFocus,
|
||||||
|
label: ForgotPasswordStrings.emailHint,
|
||||||
|
isPassword: false,
|
||||||
|
),
|
||||||
|
SizedBox(height: 70.0.h()),
|
||||||
|
viewModel.isLoadingForgot
|
||||||
|
? const BaseButton(
|
||||||
|
isEnabled: false,
|
||||||
|
text: ForgotPasswordStrings.resetLink,
|
||||||
|
onPressed: null,
|
||||||
|
isLoading: true,
|
||||||
|
)
|
||||||
|
: BaseButton(
|
||||||
|
isEnabled: viewModel.isEmailValid,
|
||||||
|
text: ForgotPasswordStrings.resetLink,
|
||||||
|
onPressed:
|
||||||
|
viewModel.isEmailValid
|
||||||
|
? () async {
|
||||||
|
await viewModel.forgotPassword(
|
||||||
|
context,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
ForgotPasswordStrings.backToSignInButton,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.mainBlue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,24 +104,36 @@ class TendersListItem extends StatelessWidget {
|
|||||||
const TenderCardProgressBar(),
|
const TenderCardProgressBar(),
|
||||||
SizedBox(height: 15.0.h()),
|
SizedBox(height: 15.0.h()),
|
||||||
|
|
||||||
Row(
|
Expanded(
|
||||||
children: [
|
child: Row(
|
||||||
SvgPicture.asset(AssetsManager.location),
|
children: [
|
||||||
SizedBox(width: 1.0.w()),
|
SvgPicture.asset(AssetsManager.location),
|
||||||
Text(
|
SizedBox(width: 1.0.w()),
|
||||||
tender.countryCode!,
|
Text(
|
||||||
style: TextStyle(
|
tender.countryCode!,
|
||||||
fontSize: 12.0.sp(),
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w400,
|
fontSize: 12.0.sp(),
|
||||||
color: AppColors.grey80,
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: 8.0.w()),
|
||||||
SizedBox(width: 8.0.w()),
|
tender.countryCode != null
|
||||||
tender.countryCode != null
|
? 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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -52,93 +52,100 @@ 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: Consumer<AuthViewModel>(
|
child: SizedBox(
|
||||||
builder: (context, viewModel, _) {
|
width: 364,
|
||||||
return Column(
|
child: Consumer<AuthViewModel>(
|
||||||
mainAxisSize: MainAxisSize.min,
|
builder: (context, viewModel, _) {
|
||||||
children: [
|
return Column(
|
||||||
SvgPicture.asset(
|
mainAxisSize: MainAxisSize.min,
|
||||||
AssetsManager.logoBig,
|
children: [
|
||||||
width: 320,
|
SvgPicture.asset(
|
||||||
height: 50,
|
AssetsManager.logoBig,
|
||||||
fit: BoxFit.cover,
|
width: 320,
|
||||||
),
|
height: 50,
|
||||||
SizedBox(height: 72.0.h()),
|
fit: BoxFit.cover,
|
||||||
const LoginTitle(),
|
|
||||||
SizedBox(height: 32.0.h()),
|
|
||||||
LoginTextField(
|
|
||||||
controller: viewModel.usernameController,
|
|
||||||
focusNode: viewModel.usernameFocus,
|
|
||||||
label: LoginStrings.usernameLabel,
|
|
||||||
iconPath: AssetsManager.userIcon,
|
|
||||||
fieldHeight: 60.0.h(),
|
|
||||||
borderRedus: 12,
|
|
||||||
prefixIconPadding: 7.0.w(),
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
LoginTextField(
|
|
||||||
controller: viewModel.passwordController,
|
|
||||||
focusNode: viewModel.passwordFocus,
|
|
||||||
label: LoginStrings.passwordLabel,
|
|
||||||
iconPath: AssetsManager.passwordIcon,
|
|
||||||
prefixIconPadding: 7.0.w(),
|
|
||||||
isPassword: true,
|
|
||||||
obscureText: viewModel.obscurePassword,
|
|
||||||
fieldHeight: 60.0.h(),
|
|
||||||
onToggleVisibility: viewModel.togglePasswordVisibility,
|
|
||||||
borderRedus: 12,
|
|
||||||
),
|
|
||||||
SizedBox(height: 32.0.h()),
|
|
||||||
if (viewModel.isLoading)
|
|
||||||
const BaseButton(
|
|
||||||
isEnabled: false,
|
|
||||||
onPressed: null,
|
|
||||||
isLoading: true,
|
|
||||||
)
|
|
||||||
else
|
|
||||||
BaseButton(
|
|
||||||
isEnabled: viewModel.isLoginEnabled,
|
|
||||||
onPressed: () async {
|
|
||||||
if (viewModel.isLoginEnabled) {
|
|
||||||
await viewModel.login();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 32.0),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
const ForgotPasswordRouteData().push(context);
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
LoginStrings.forgotPassword,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.mainBlue,
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 72.0.h()),
|
||||||
),
|
const LoginTitle(),
|
||||||
],
|
SizedBox(height: 32.0.h()),
|
||||||
);
|
LoginTextField(
|
||||||
},
|
controller: viewModel.usernameController,
|
||||||
|
focusNode: viewModel.usernameFocus,
|
||||||
|
label: LoginStrings.usernameLabel,
|
||||||
|
iconPath: AssetsManager.userIcon,
|
||||||
|
fieldHeight: 60.0.h(),
|
||||||
|
borderRedus: 12,
|
||||||
|
prefixIconPadding: 7.0.w(),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
LoginTextField(
|
||||||
|
controller: viewModel.passwordController,
|
||||||
|
focusNode: viewModel.passwordFocus,
|
||||||
|
label: LoginStrings.passwordLabel,
|
||||||
|
iconPath: AssetsManager.passwordIcon,
|
||||||
|
prefixIconPadding: 7.0.w(),
|
||||||
|
isPassword: true,
|
||||||
|
obscureText: viewModel.obscurePassword,
|
||||||
|
fieldHeight: 60.0.h(),
|
||||||
|
onToggleVisibility:
|
||||||
|
viewModel.togglePasswordVisibility,
|
||||||
|
borderRedus: 12,
|
||||||
|
),
|
||||||
|
SizedBox(height: 32.0.h()),
|
||||||
|
if (viewModel.isLoading)
|
||||||
|
const BaseButton(
|
||||||
|
isEnabled: false,
|
||||||
|
onPressed: null,
|
||||||
|
isLoading: true,
|
||||||
|
)
|
||||||
|
else
|
||||||
|
BaseButton(
|
||||||
|
isEnabled: viewModel.isLoginEnabled,
|
||||||
|
onPressed: () async {
|
||||||
|
if (viewModel.isLoginEnabled) {
|
||||||
|
await viewModel.login();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 32.0),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
const ForgotPasswordRouteData().push(context);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
LoginStrings.forgotPassword,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.mainBlue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 20.0.h(),
|
||||||
|
horizontal: 25.0.w(),
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(32),
|
||||||
|
child: Image.asset(
|
||||||
|
AssetsManager.webLoginImage,
|
||||||
|
width: 796.0,
|
||||||
|
height: 944.0,
|
||||||
|
fit: BoxFit.fitWidth,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
kIsWeb
|
|
||||||
? Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(32),
|
|
||||||
child: Image.asset(
|
|
||||||
AssetsManager.webLoginImage,
|
|
||||||
width: 796.0,
|
|
||||||
height: 944.0,
|
|
||||||
fit: BoxFit.fitWidth,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Container(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user