fixed jira tm-172 and pagination dialog design changed
This commit is contained in:
@@ -75,9 +75,10 @@ class DesktopNavigationWidget extends StatelessWidget {
|
||||
text: TendersStrings.tendersTitle,
|
||||
isActive: currentIndex == 1,
|
||||
onTap: () {
|
||||
if (currentIndex == 1) {
|
||||
return;
|
||||
} else {
|
||||
// if (currentIndex == 1) {
|
||||
// return;
|
||||
// } else
|
||||
{
|
||||
Router.neglect(
|
||||
context,
|
||||
() => const TendersRouteData().go(context),
|
||||
|
||||
@@ -1,29 +1,82 @@
|
||||
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/utils/size_config.dart';
|
||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||
|
||||
class PageSelectionDialog extends StatelessWidget {
|
||||
class PageSelectionDialog extends StatefulWidget {
|
||||
final int totalPages;
|
||||
final int currentPage;
|
||||
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
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(
|
||||
width: 200,
|
||||
height: 300,
|
||||
child: ListView.builder(
|
||||
itemCount: totalPages,
|
||||
itemCount: widget.totalPages,
|
||||
itemBuilder: (context, index) {
|
||||
final pageNumber = index + 1;
|
||||
|
||||
return ListTile(
|
||||
title: Text('$pageNumber'),
|
||||
onTap: () => Navigator.pop(context, pageNumber),
|
||||
leading: Radio<int>(
|
||||
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_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/theme/colors.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}) {
|
||||
return PreferredSize(
|
||||
preferredSize: const Size.fromHeight(56),
|
||||
@@ -65,6 +69,7 @@ PreferredSizeWidget appBar({
|
||||
PreferredSizeWidget tabletAppBar({
|
||||
required String title,
|
||||
required GlobalKey<ScaffoldState> key,
|
||||
required BuildContext context,
|
||||
}) {
|
||||
return PreferredSize(
|
||||
preferredSize: const Size.fromHeight(64),
|
||||
@@ -75,7 +80,17 @@ PreferredSizeWidget tabletAppBar({
|
||||
titleSpacing: 0,
|
||||
leading: Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
|
||||
child: SvgPicture.asset(AssetsManager.logoSmall),
|
||||
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),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
|
||||
Reference in New Issue
Block a user