From 9caf98de7c6a075bcdbe825e58318f6149d20d0a Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Wed, 21 May 2025 10:47:54 +0530 Subject: [PATCH] template list --- lib/Screens/myTemplates/templatesList.dart | 66 ++++++++++++++++++++++ lib/routes/custom_appBar.dart | 7 +++ lib/routes/custom_router.dart | 5 ++ 3 files changed, 78 insertions(+) create mode 100644 lib/Screens/myTemplates/templatesList.dart diff --git a/lib/Screens/myTemplates/templatesList.dart b/lib/Screens/myTemplates/templatesList.dart new file mode 100644 index 0000000..2bbad6b --- /dev/null +++ b/lib/Screens/myTemplates/templatesList.dart @@ -0,0 +1,66 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:frontend/utils/auth_utils.dart'; +import 'package:go_router/go_router.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:http/http.dart' as http; +import 'package:responsive_builder/responsive_builder.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../../config/apiUrl.dart'; +import '../../routes/custom_appBar.dart'; +import '../../routes/custom_drawer.dart'; +import '../../services/apiService.dart'; +import '../../utils/pagination.dart'; +import '../../widgets/custom_popup.dart'; +import '../../widgets/popup_userList_action.dart'; + +class templatesList extends StatefulWidget { + @override + _templatesListState createState() => _templatesListState(); +} + +class _templatesListState extends State { + final ApiService apiService = ApiService(); + + + + @override + void initState() { + super.initState(); + + } + + + + @override + Widget build(BuildContext context) { + return ResponsiveBuilder(builder: (context, sizingInfo) { + bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop; + + return Scaffold( + backgroundColor: Color(0xFFf5f5f5), + appBar: CustomAppBar(isDesktop: isDesktop), + drawer: CustomDrawer(isDesktop: false), + body: Padding( + padding: isDesktop + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.1, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(0), + child: Row( + children: [ + + + ], + ), + ), + ); + }); + } + + +} diff --git a/lib/routes/custom_appBar.dart b/lib/routes/custom_appBar.dart index 0cc3fc1..902ab53 100644 --- a/lib/routes/custom_appBar.dart +++ b/lib/routes/custom_appBar.dart @@ -368,6 +368,8 @@ class _CustomAppBarState extends State { break; case '/PolicyList': context.go('/PolicyList'); + case '/templatesList': + context.go('/templatesList'); case '/CreateUserDetails': context.go( "/CreateUserDetails", @@ -509,6 +511,11 @@ final List> menuItems = [ 'icon': Icons.account_circle, 'label': 'My Profile' }, + { + 'value': '/templatesList', + 'icon': Icons.temple_buddhist_outlined, + 'label': 'My Templates' + }, {'value': '/logout', 'icon': Icons.login_outlined, 'label': 'Logout'}, ]; diff --git a/lib/routes/custom_router.dart b/lib/routes/custom_router.dart index 7cd0641..30e776c 100644 --- a/lib/routes/custom_router.dart +++ b/lib/routes/custom_router.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:frontend/Screens/authentication/login/login_page.dart'; import 'package:frontend/Screens/authentication/loginPage1.dart'; import 'package:frontend/Screens/dashboard/home_page.dart'; +import 'package:frontend/Screens/myTemplates/templatesList.dart'; import 'package:frontend/Screens/organization/orgSetup.dart'; import 'package:frontend/Screens/organization/org_List.dart'; import 'package:frontend/Screens/plans/create_plans.dart'; @@ -43,6 +44,10 @@ final GoRouter router = GoRouter( path: '/listPlan', builder: (context, state) => ListPlans(), ), + GoRoute( + path: '/templatesList', + builder: (context, state) => templatesList(), + ), GoRoute( path: '/createPlan', builder: (context, state) => CreatePlan(),