Przeglądaj źródła

fix: remove filter bar white background and spacing, replace +new text with icon

chengc 6 dni temu
rodzic
commit
9e6455c548

+ 5 - 5
lib/core/router/app_router.dart

@@ -99,7 +99,7 @@ GoRouter createAppRouter() {
 
       GoRoute(
         path: '/expense-apply/list',
-        builder: (_, __) => const ExpenseApplicationListPage(),
+        builder: (_, _) => const ExpenseApplicationListPage(),
       ),
       GoRoute(
         path: '/expense-apply/detail/:id',
@@ -114,19 +114,19 @@ GoRouter createAppRouter() {
 
       GoRoute(
         path: '/report/expense-detail',
-        builder: (_, __) => const ExpenseDetailReportPage(),
+        builder: (_, _) => const ExpenseDetailReportPage(),
       ),
       GoRoute(
         path: '/report/expense-apply-detail',
-        builder: (_, __) => const ExpenseApplyDetailReportPage(),
+        builder: (_, _) => const ExpenseApplyDetailReportPage(),
       ),
       GoRoute(
         path: '/report/overtime-detail',
-        builder: (_, __) => const OvertimeDetailReportPage(),
+        builder: (_, _) => const OvertimeDetailReportPage(),
       ),
       GoRoute(
         path: '/report/vehicle-detail',
-        builder: (_, __) => const VehicleDetailReportPage(),
+        builder: (_, _) => const VehicleDetailReportPage(),
       ),
     ],
   );

+ 5 - 7
lib/features/expense/expense_list_page.dart

@@ -31,10 +31,9 @@ class _ExpenseListPageState extends ConsumerState<ExpenseListPage> {
       appBar: AppBar(
         title: const Text('报销单'),
         actions: [
-          TextButton(
+          IconButton(
+            icon: const Icon(Icons.add, color: Colors.white),
             onPressed: () => context.push('/expense/apply'),
-            child: const Text('+ 新建',
-                style: TextStyle(color: Colors.white, fontSize: 13)),
           ),
         ],
       ),
@@ -74,7 +73,7 @@ class _ExpenseListPageState extends ConsumerState<ExpenseListPage> {
     ];
     final filterBar = SingleChildScrollView(
       scrollDirection: Axis.horizontal,
-      padding: const EdgeInsets.symmetric(horizontal: 12),
+      padding: EdgeInsets.zero,
       child: Row(
         children: statuses.map((s) {
           final isSelected = current == s['key'];
@@ -113,9 +112,8 @@ class _ExpenseListPageState extends ConsumerState<ExpenseListPage> {
         }).toList(),
       ),
     );
-    return Container(
-      color: Colors.white,
-      padding: const EdgeInsets.symmetric(vertical: 8),
+    return Padding(
+      padding: const EdgeInsets.only(bottom: 4),
       child: r.isWide
           ? Center(
               child: SizedBox(width: r.listMaxWidth, child: filterBar))

+ 5 - 7
lib/features/expense_application/expense_application_list_page.dart

@@ -30,10 +30,9 @@ class _ExpenseApplicationListPageState
       appBar: AppBar(
         title: const Text('报销申请'),
         actions: [
-          TextButton(
+          IconButton(
+            icon: const Icon(Icons.add, color: Colors.white),
             onPressed: () => context.push('/expense-apply/apply'),
-            child: const Text('+ 新建',
-                style: TextStyle(color: Colors.white, fontSize: 13)),
           ),
         ],
       ),
@@ -73,7 +72,7 @@ class _ExpenseApplicationListPageState
     ];
     final filterBar = SingleChildScrollView(
       scrollDirection: Axis.horizontal,
-      padding: const EdgeInsets.symmetric(horizontal: 12),
+      padding: EdgeInsets.zero,
       child: Row(
         children: statuses.map((s) {
           final isSelected = current == s['key'];
@@ -111,9 +110,8 @@ class _ExpenseApplicationListPageState
         }).toList(),
       ),
     );
-    return Container(
-      color: Colors.white,
-      padding: const EdgeInsets.symmetric(vertical: 8),
+    return Padding(
+      padding: const EdgeInsets.only(bottom: 4),
       child: r.isWide
           ? Center(
               child: SizedBox(width: r.listMaxWidth, child: filterBar))

+ 5 - 7
lib/features/overtime/overtime_list_page.dart

@@ -31,10 +31,9 @@ class _OvertimeListPageState extends ConsumerState<OvertimeListPage> {
       appBar: AppBar(
         title: const Text('加班申请'),
         actions: [
-          TextButton(
+          IconButton(
+            icon: const Icon(Icons.add, color: Colors.white),
             onPressed: () => context.push('/overtime/apply'),
-            child: const Text('+ 新建',
-                style: TextStyle(color: Colors.white, fontSize: 13)),
           ),
         ],
       ),
@@ -73,7 +72,7 @@ class _OvertimeListPageState extends ConsumerState<OvertimeListPage> {
     ];
     final filterBar = SingleChildScrollView(
       scrollDirection: Axis.horizontal,
-      padding: const EdgeInsets.symmetric(horizontal: 12),
+      padding: EdgeInsets.zero,
       child: Row(
         children: statuses.map((s) {
           final isSelected = current == s['key'];
@@ -109,9 +108,8 @@ class _OvertimeListPageState extends ConsumerState<OvertimeListPage> {
         }).toList(),
       ),
     );
-    return Container(
-      color: Colors.white,
-      padding: const EdgeInsets.symmetric(vertical: 8),
+    return Padding(
+      padding: const EdgeInsets.only(bottom: 4),
       child: r.isWide
           ? Center(
               child: SizedBox(width: r.listMaxWidth, child: filterBar))

+ 5 - 6
lib/features/vehicle/vehicle_list_page.dart

@@ -31,9 +31,9 @@ class _VehicleListPageState extends ConsumerState<VehicleListPage> {
       appBar: AppBar(
         title: const Text('用车申请'),
         actions: [
-          TextButton(
+          IconButton(
+            icon: const Icon(Icons.add, color: Colors.white),
             onPressed: () => context.push('/vehicle/apply'),
-            child: const Text('+ 新建', style: TextStyle(color: Colors.white, fontSize: 13)),
           ),
         ],
       ),
@@ -72,7 +72,7 @@ class _VehicleListPageState extends ConsumerState<VehicleListPage> {
     ];
     final filterBar = SingleChildScrollView(
       scrollDirection: Axis.horizontal,
-      padding: const EdgeInsets.symmetric(horizontal: 12),
+      padding: EdgeInsets.zero,
       child: Row(
         children: statuses.map((s) {
           final isSelected = current == s['key'];
@@ -97,9 +97,8 @@ class _VehicleListPageState extends ConsumerState<VehicleListPage> {
         }).toList(),
       ),
     );
-    return Container(
-      color: Colors.white,
-      padding: const EdgeInsets.symmetric(vertical: 8),
+    return Padding(
+      padding: const EdgeInsets.only(bottom: 4),
       child: r.isWide ? Center(child: SizedBox(width: r.listMaxWidth, child: filterBar)) : filterBar,
     );
   }