fixed jira tm-172 and pagination dialog design changed
This commit is contained in:
@@ -84,6 +84,7 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
|
|||||||
appBar: tabletAppBar(
|
appBar: tabletAppBar(
|
||||||
title: TenderDetailsStrings.tenderDetailTitle,
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
key: key,
|
key: key,
|
||||||
|
context: context,
|
||||||
),
|
),
|
||||||
|
|
||||||
drawer: const TabletNavigationWidget(
|
drawer: const TabletNavigationWidget(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TabletHomePage extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
|
|
||||||
appBar: tabletAppBar(title: HomeStrings.home, key: key),
|
appBar: tabletAppBar(title: HomeStrings.home, key: key, context: context),
|
||||||
|
|
||||||
drawer: const TabletNavigationWidget(
|
drawer: const TabletNavigationWidget(
|
||||||
currentIndex: 0, // Home is index 0
|
currentIndex: 0, // Home is index 0
|
||||||
|
|||||||
@@ -154,7 +154,11 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PageSelectionDialog(totalPages: totalPages),
|
builder:
|
||||||
|
(context) => PageSelectionDialog(
|
||||||
|
totalPages: totalPages,
|
||||||
|
currentPage: currentPage,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
|
appBar: tabletAppBar(
|
||||||
|
title: LikedTendersStrings.likedTenders,
|
||||||
|
key: key,
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -115,7 +119,8 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final currentPage = viewModel.currentPage;
|
final currentPage = viewModel.currentPage;
|
||||||
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
|
final totalPages =
|
||||||
|
viewModel.data?.data?.meta?.pages ?? 1;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -168,7 +173,11 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PageSelectionDialog(totalPages: totalPages),
|
builder:
|
||||||
|
(context) => PageSelectionDialog(
|
||||||
|
totalPages: totalPages,
|
||||||
|
currentPage: currentPage,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
|||||||
builder:
|
builder:
|
||||||
(context) => PageSelectionDialog(
|
(context) => PageSelectionDialog(
|
||||||
totalPages: totalPages,
|
totalPages: totalPages,
|
||||||
|
currentPage: currentPage,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
|||||||
appBar: tabletAppBar(
|
appBar: tabletAppBar(
|
||||||
title: NotificationStrings.notificationTitle,
|
title: NotificationStrings.notificationTitle,
|
||||||
key: key,
|
key: key,
|
||||||
|
context: context,
|
||||||
),
|
),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 3),
|
drawer: const TabletNavigationWidget(currentIndex: 3),
|
||||||
body: Center(
|
body: Center(
|
||||||
@@ -151,8 +152,10 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
|||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder:
|
builder:
|
||||||
(context) =>
|
(context) => PageSelectionDialog(
|
||||||
PageSelectionDialog(totalPages: totalPages),
|
totalPages: totalPages,
|
||||||
|
currentPage: currentPage,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class NotificationStrings {
|
|||||||
static const String important = 'Important';
|
static const String important = 'Important';
|
||||||
static const String markAllAsReadButton = 'Mark all as read';
|
static const String markAllAsReadButton = 'Mark all as read';
|
||||||
static const String page = 'page';
|
static const String page = 'page';
|
||||||
static const String selectPage = 'selectPage';
|
static const String selectPage = 'Select Page';
|
||||||
static const String currentPage = 'currentPage';
|
static const String currentPage = 'currentPage';
|
||||||
static const String of = 'of';
|
static const String of = 'of';
|
||||||
static const String totalPages = 'totalPages';
|
static const String totalPages = 'totalPages';
|
||||||
|
|||||||
@@ -67,7 +67,11 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
|
appBar: tabletAppBar(
|
||||||
|
title: ProfileStrings.profileTitle,
|
||||||
|
key: key,
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
|
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 4),
|
drawer: const TabletNavigationWidget(currentIndex: 4),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
|
|||||||
@@ -75,9 +75,10 @@ class DesktopNavigationWidget extends StatelessWidget {
|
|||||||
text: TendersStrings.tendersTitle,
|
text: TendersStrings.tendersTitle,
|
||||||
isActive: currentIndex == 1,
|
isActive: currentIndex == 1,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (currentIndex == 1) {
|
// if (currentIndex == 1) {
|
||||||
return;
|
// return;
|
||||||
} else {
|
// } else
|
||||||
|
{
|
||||||
Router.neglect(
|
Router.neglect(
|
||||||
context,
|
context,
|
||||||
() => const TendersRouteData().go(context),
|
() => const TendersRouteData().go(context),
|
||||||
|
|||||||
@@ -1,29 +1,82 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:tm_app/core/theme/colors.dart';
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
class PageSelectionDialog extends StatelessWidget {
|
class PageSelectionDialog extends StatefulWidget {
|
||||||
final int totalPages;
|
final int totalPages;
|
||||||
|
final int currentPage;
|
||||||
|
|
||||||
const PageSelectionDialog({
|
const PageSelectionDialog({
|
||||||
required this.totalPages, super.key,
|
required this.totalPages,
|
||||||
|
required this.currentPage,
|
||||||
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PageSelectionDialog> createState() => _PageSelectionDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PageSelectionDialogState extends State<PageSelectionDialog> {
|
||||||
|
late int selectedPage;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
selectedPage = widget.currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
title: const Text(NotificationStrings.selectPage),
|
insetPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0.w(),
|
||||||
|
vertical: 16.0.h(),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'${NotificationStrings.selectPage} (Current: ${widget.currentPage})',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
),
|
||||||
content: SizedBox(
|
content: SizedBox(
|
||||||
width: 200,
|
width: 200,
|
||||||
height: 300,
|
height: 300,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: totalPages,
|
itemCount: widget.totalPages,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final pageNumber = index + 1;
|
final pageNumber = index + 1;
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text('$pageNumber'),
|
leading: Radio<int>(
|
||||||
onTap: () => Navigator.pop(context, pageNumber),
|
value: pageNumber,
|
||||||
|
groupValue: selectedPage,
|
||||||
|
activeColor: AppColors.mainBlue,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
selectedPage = value!;
|
||||||
|
});
|
||||||
|
context.pop(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'$pageNumber',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedPage = pageNumber;
|
||||||
|
});
|
||||||
|
context.pop(pageNumber);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/constants/assets.dart';
|
import 'package:tm_app/core/constants/assets.dart';
|
||||||
import 'package:tm_app/core/theme/colors.dart';
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
import 'package:tm_app/core/utils/size_config.dart';
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
|
|
||||||
|
import '../../core/routes/app_routes.dart';
|
||||||
|
import '../../view_models/home_view_model.dart';
|
||||||
|
|
||||||
PreferredSizeWidget tenderMobileAppBar({required String title}) {
|
PreferredSizeWidget tenderMobileAppBar({required String title}) {
|
||||||
return PreferredSize(
|
return PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(56),
|
preferredSize: const Size.fromHeight(56),
|
||||||
@@ -65,6 +69,7 @@ PreferredSizeWidget appBar({
|
|||||||
PreferredSizeWidget tabletAppBar({
|
PreferredSizeWidget tabletAppBar({
|
||||||
required String title,
|
required String title,
|
||||||
required GlobalKey<ScaffoldState> key,
|
required GlobalKey<ScaffoldState> key,
|
||||||
|
required BuildContext context,
|
||||||
}) {
|
}) {
|
||||||
return PreferredSize(
|
return PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(64),
|
preferredSize: const Size.fromHeight(64),
|
||||||
@@ -75,8 +80,18 @@ PreferredSizeWidget tabletAppBar({
|
|||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
|
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
|
||||||
|
highlightColor: AppColors.green0,
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
onTap: () {
|
||||||
|
Router.neglect(context, () => const HomeRouteData().go(context));
|
||||||
|
context.read<HomeViewModel>().init();
|
||||||
|
},
|
||||||
child: SvgPicture.asset(AssetsManager.logoSmall),
|
child: SvgPicture.asset(AssetsManager.logoSmall),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Padding(
|
icon: Padding(
|
||||||
|
|||||||
@@ -282,7 +282,10 @@ class _DesktopPagination extends StatelessWidget {
|
|||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder:
|
builder:
|
||||||
(context) => PageSelectionDialog(totalPages: totalPages),
|
(context) => PageSelectionDialog(
|
||||||
|
totalPages: totalPages,
|
||||||
|
currentPage: currentPage,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
onPageSelected(selectedPage);
|
onPageSelected(selectedPage);
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ class _TabletTendersPageState extends State<TabletTendersPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: TendersStrings.tendersTitle, key: key),
|
appBar: tabletAppBar(
|
||||||
|
title: TendersStrings.tendersTitle,
|
||||||
|
key: key,
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: Consumer<TendersViewModel>(
|
body: Consumer<TendersViewModel>(
|
||||||
builder: (context, viewModel, child) {
|
builder: (context, viewModel, child) {
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: YourTendersStrings.yourTenders, key: key),
|
appBar: tabletAppBar(
|
||||||
|
title: YourTendersStrings.yourTenders,
|
||||||
|
key: key,
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Center(
|
child: Center(
|
||||||
|
|||||||
Reference in New Issue
Block a user