fixed some bug
This commit is contained in:
@@ -27,24 +27,35 @@ class DesktopHomePage extends StatelessWidget {
|
||||
return Center(child: Text(homeViewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 55),
|
||||
// SizedBox(width: 780, child: NotificationCard()),
|
||||
SizedBox(height: 40.0),
|
||||
_progressBarsRow(homeViewModel.tenderApprovalsStateResponse!),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_firstTenderCardsRow(
|
||||
context,
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 780,
|
||||
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 55),
|
||||
// SizedBox(width: 780, child: NotificationCard()),
|
||||
SizedBox(height: 40.0),
|
||||
_progressBarsRow(
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
|
||||
child: _firstTenderCardsRow(
|
||||
context,
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(homeViewModel),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -81,7 +92,7 @@ class DesktopHomePage extends StatelessWidget {
|
||||
circularProgressIndicatorWidth: 176,
|
||||
circularProgressIndicatorHeight: 176,
|
||||
),
|
||||
SizedBox(width: 106),
|
||||
//SizedBox(width: 106),
|
||||
// ProgressBarColumn(
|
||||
// text: AppStrings.contracting,
|
||||
// value: double.parse(homeResponse.contracting ?? '0'),
|
||||
@@ -100,39 +111,44 @@ class DesktopHomePage extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TenderCard(
|
||||
backgroundColor: AppColors.primary20,
|
||||
iconPath: 'assets/icons/arrows.svg',
|
||||
title: AppStrings.tenderSubmitted,
|
||||
amount: tenderApprovalsStateResponse.data!.approvedTenders.toString(),
|
||||
// tenderApprovalsStateResponse
|
||||
// .data!
|
||||
// .approvalsBySubmission!
|
||||
// .selfApply
|
||||
// .toString(),
|
||||
textColor: Color(0xFF0164FF),
|
||||
enableTap: true,
|
||||
width: 178,
|
||||
height: 148,
|
||||
onTap: () {
|
||||
YourTendersRouteData().push(context);
|
||||
},
|
||||
Expanded(
|
||||
child: TenderCard(
|
||||
backgroundColor: AppColors.primary20,
|
||||
iconPath: 'assets/icons/arrows.svg',
|
||||
title: AppStrings.tenderSubmitted,
|
||||
amount:
|
||||
tenderApprovalsStateResponse.data!.approvedTenders.toString(),
|
||||
// tenderApprovalsStateResponse
|
||||
// .data!
|
||||
// .approvalsBySubmission!
|
||||
// .selfApply
|
||||
// .toString(),
|
||||
textColor: Color(0xFF0164FF),
|
||||
enableTap: true,
|
||||
width: 178,
|
||||
height: 148,
|
||||
onTap: () {
|
||||
YourTendersRouteData().push(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
TenderCard(
|
||||
backgroundColor: AppColors.primary10,
|
||||
iconPath: 'assets/icons/thumb.svg',
|
||||
title: AppStrings.approvedTenders,
|
||||
amount: '0',
|
||||
textColor: Color(0xFF24848E),
|
||||
enableTap: true,
|
||||
width: 178,
|
||||
height: 148,
|
||||
onTap: () {
|
||||
YourTendersRouteData().push(context);
|
||||
},
|
||||
Expanded(
|
||||
child: TenderCard(
|
||||
backgroundColor: AppColors.primary10,
|
||||
iconPath: 'assets/icons/thumb.svg',
|
||||
title: AppStrings.approvedTenders,
|
||||
amount: '0',
|
||||
textColor: Color(0xFF24848E),
|
||||
enableTap: true,
|
||||
width: 178,
|
||||
height: 148,
|
||||
onTap: () {
|
||||
YourTendersRouteData().push(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
// SizedBox(width: 10),
|
||||
// TenderCard(
|
||||
// backgroundColor: AppColors.orange10,
|
||||
// iconPath: 'assets/icons/shield.svg',
|
||||
@@ -160,13 +176,16 @@ class DesktopHomePage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _yourTenderText() {
|
||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: 740),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
AppStrings.recommendation,
|
||||
isYourTenders
|
||||
? AppStrings.yourTenders
|
||||
: AppStrings.recommendedTenders,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0.sp(),
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -179,15 +198,17 @@ class DesktopHomePage extends StatelessWidget {
|
||||
|
||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||
final controller = ScrollController();
|
||||
|
||||
controller.addListener(() {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return SizedBox(
|
||||
width: 740,
|
||||
height: 387.0,
|
||||
|
||||
@@ -195,10 +195,12 @@ class MobileHomePage extends StatelessWidget {
|
||||
final controller = ScrollController();
|
||||
|
||||
controller.addListener(() {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ class TabletHomePage extends StatelessWidget {
|
||||
SizedBox(height: 8.0.h()),
|
||||
//_secondTenderCardsRow(homeViewModel.homeResponse!),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(),
|
||||
_yourTenderText(homeViewModel),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
@@ -192,9 +192,10 @@ class TabletHomePage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _yourTenderText() {
|
||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
||||
return Text(
|
||||
AppStrings.recommendation,
|
||||
isYourTenders ? AppStrings.yourTenders : AppStrings.recommendedTenders,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0.sp(),
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -206,14 +207,17 @@ class TabletHomePage extends StatelessWidget {
|
||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||
final controller = ScrollController();
|
||||
|
||||
controller.addListener(() {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
controller.addListener(() {
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 387.0.h(),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -50,7 +51,8 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
mainAxisAlignment:
|
||||
kIsWeb ? MainAxisAlignment.spaceAround : MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 526,
|
||||
@@ -111,15 +113,17 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
||||
child: Image.asset(
|
||||
AssetsManager.webLoginImage,
|
||||
width: 796.0,
|
||||
height: 944.0,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
),
|
||||
kIsWeb
|
||||
? Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
||||
child: Image.asset(
|
||||
AssetsManager.webLoginImage,
|
||||
width: 796.0,
|
||||
height: 944.0,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
import 'package:tm_app/view_models/profile_view_model.dart';
|
||||
|
||||
@@ -87,17 +90,69 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
||||
TitleDescription(title: 'Founded', description: '2010'),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Theme Toggle
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.0.w(),
|
||||
vertical: 12.0.h(),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
AppStrings.settings,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surfaceColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColors.borderColor),
|
||||
),
|
||||
SizedBox(height: 36.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
AppStrings.appTheme,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
SvgPicture.asset(AssetsManager.sun),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SizedBox(
|
||||
width: 52.0.w(),
|
||||
height: 32.0.h(),
|
||||
child: ThemeToggle(),
|
||||
),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SvgPicture.asset(AssetsManager.moon),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () => viewModel.logout(),
|
||||
child: Container(
|
||||
width: 156,
|
||||
height: 56.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary20,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Logout',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: const ThemeToggle(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user