尺寸修改

This commit is contained in:
2025-11-14 17:53:40 +08:00
parent 2aeff5e8a6
commit 3a7f69d525
4 changed files with 74 additions and 42 deletions

View File

@@ -27,11 +27,11 @@ class CarInfoPage extends GetView<CarInfoController> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
_buildDriverInfoCard(), _buildDriverInfoCard(),
const SizedBox(height: 12), const SizedBox(height: 5),
_buildCarBindingCard(), _buildCarBindingCard(),
const SizedBox(height: 12), const SizedBox(height: 5),
_buildCertificatesCard(), _buildCertificatesCard(),
const SizedBox(height: 12), const SizedBox(height: 5),
_buildTipsCard(), _buildTipsCard(),
], ],
), ),
@@ -45,8 +45,8 @@ class CarInfoPage extends GetView<CarInfoController> {
/// 1. 构建顶部的司机信息卡片(包含蓝色背景) /// 1. 构建顶部的司机信息卡片(包含蓝色背景)
Widget _buildDriverInfoCard() { Widget _buildDriverInfoCard() {
return Card( return Card(
elevation: 4, elevation: 2,
margin: EdgeInsets.zero, // Card 在蓝色背景内,不需要外边距 margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Column( child: Column(
children: [ children: [
@@ -55,23 +55,23 @@ class CarInfoPage extends GetView<CarInfoController> {
child: Row( child: Row(
children: [ children: [
const CircleAvatar( const CircleAvatar(
radius: 28, radius: 20,
backgroundColor: Colors.blue, backgroundColor: Colors.blue,
child: Icon(Icons.person, color: Colors.white, size: 36), child: Icon(Icons.person, color: Colors.white, size: 34),
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text( Text(
'王小龙', "${StorageService.to.name}",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
const Text( Text(
'15888332828', "${StorageService.to.phone}",
style: TextStyle(color: Colors.grey, fontSize: 14), style: TextStyle(color: Colors.grey, fontSize: 11),
), ),
], ],
), ),

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:ln_jq_app/storage_service.dart';
import 'controller.dart'; import 'controller.dart';
// 假设您的 Controller 在这里,如果还没有,可以先创建一个空类 // 假设您的 Controller 在这里,如果还没有,可以先创建一个空类
@@ -56,7 +57,7 @@ class MinePage extends GetView<MineController> {
child: Row( child: Row(
children: [ children: [
const CircleAvatar( const CircleAvatar(
radius: 30, radius: 25,
backgroundColor: Colors.blue, backgroundColor: Colors.blue,
child: Icon(Icons.person, color: Colors.white, size: 40), child: Icon(Icons.person, color: Colors.white, size: 40),
), ),
@@ -65,18 +66,18 @@ class MinePage extends GetView<MineController> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text( Text(
'王小龙', "${StorageService.to.name}",
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
const Text( Text(
'15888332828', "${StorageService.to.phone}",
style: TextStyle(color: Colors.grey, fontSize: 14), style: TextStyle(color: Colors.grey, fontSize: 11),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
const Text( Text(
'未绑定车辆', StorageService.to.hasVehicleInfo ? "已绑定车辆" : '未绑定车辆',
style: TextStyle(color: Colors.orange, fontSize: 12), style: TextStyle(color: Colors.orange, fontSize: 12),
), ),
], ],
@@ -93,10 +94,17 @@ class MinePage extends GetView<MineController> {
children: [ children: [
Icon(Icons.shield_outlined, color: Colors.blue, size: 14), Icon(Icons.shield_outlined, color: Colors.blue, size: 14),
SizedBox(width: 4), SizedBox(width: 4),
Text('已认证', style: TextStyle(color: Colors.blue, fontSize: 10, fontWeight: FontWeight.bold)), Text(
'已认证',
style: TextStyle(
color: Colors.blue,
fontSize: 10,
fontWeight: FontWeight.bold,
),
),
], ],
), ),
) ),
], ],
), ),
), ),
@@ -138,7 +146,10 @@ class MinePage extends GetView<MineController> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text('驾驶得分', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), const Text(
'驾驶得分',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
const Text('本月表现', style: TextStyle(fontSize: 12, color: Colors.grey)), const Text('本月表现', style: TextStyle(fontSize: 12, color: Colors.grey)),
const SizedBox(height: 20), const SizedBox(height: 20),
Center( Center(
@@ -179,7 +190,10 @@ class MinePage extends GetView<MineController> {
padding: const EdgeInsets.only(top: 12.0), padding: const EdgeInsets.only(top: 12.0),
child: Row( child: Row(
children: [ children: [
const Text('优秀驾驶员', style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500)), const Text(
'优秀驾驶员',
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
),
const Spacer(), const Spacer(),
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
@@ -187,11 +201,14 @@ class MinePage extends GetView<MineController> {
color: Colors.blue, color: Colors.blue,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: const Text('A+', style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), child: const Text(
) 'A+',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
),
], ],
), ),
) ),
], ],
), ),
), ),
@@ -199,7 +216,12 @@ class MinePage extends GetView<MineController> {
} }
// 驾驶得分卡片中的评分项 // 驾驶得分卡片中的评分项
Widget _buildScoreDetailRow(IconData icon, String title, String subtitle, bool isCompleted) { Widget _buildScoreDetailRow(
IconData icon,
String title,
String subtitle,
bool isCompleted,
) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row( child: Row(
@@ -214,13 +236,15 @@ class MinePage extends GetView<MineController> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(title, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), Text(
title,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
Text(subtitle, style: const TextStyle(fontSize: 12, color: Colors.grey)), Text(subtitle, style: const TextStyle(fontSize: 12, color: Colors.grey)),
], ],
), ),
), ),
if (isCompleted) if (isCompleted) const Icon(Icons.check_circle, color: Colors.blue),
const Icon(Icons.check_circle, color: Colors.blue),
], ],
), ),
); );
@@ -236,7 +260,10 @@ class MinePage extends GetView<MineController> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text('本月记录', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), const Text(
'本月记录',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
const SizedBox(height: 8), const SizedBox(height: 8),
_buildRecordRow(Icons.autorenew, '加氢预约践行率', '100%'), _buildRecordRow(Icons.autorenew, '加氢预约践行率', '100%'),
const Divider(), const Divider(),
@@ -301,7 +328,9 @@ class MinePage extends GetView<MineController> {
children: [ children: [
Icon(icon, color: Colors.blue, size: 20), Icon(icon, color: Colors.blue, size: 20),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded(child: Text(text, style: const TextStyle(fontSize: 12, color: Colors.black54))), Expanded(
child: Text(text, style: const TextStyle(fontSize: 12, color: Colors.black54)),
),
], ],
); );
} }
@@ -319,7 +348,10 @@ class MinePage extends GetView<MineController> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
elevation: 2, elevation: 2,
), ),
child: const Text('退出登录', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), child: const Text(
'退出登录',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
); );
} }
} }

View File

@@ -13,7 +13,7 @@ import 'package:ln_jq_app/storage_service.dart';
import '../../../common/styles/theme.dart'; import '../../../common/styles/theme.dart';
class ReservationController extends GetxController with BaseControllerMixin { class C_ReservationController extends GetxController with BaseControllerMixin {
@override @override
String get builderId => 'reservation'; String get builderId => 'reservation';

View File

@@ -8,13 +8,13 @@ import 'package:ln_jq_app/storage_service.dart';
import 'controller.dart'; import 'controller.dart';
///加氢预约 ///加氢预约
class ReservationPage extends GetView<ReservationController> { class ReservationPage extends GetView<C_ReservationController> {
const ReservationPage({super.key}); const ReservationPage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(ReservationController()); Get.put(C_ReservationController());
return GetBuilder<ReservationController>( return GetBuilder<C_ReservationController>(
id: 'reservation', id: 'reservation',
builder: (_) { builder: (_) {
return Scaffold( return Scaffold(
@@ -24,7 +24,7 @@ class ReservationPage extends GetView<ReservationController> {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
@@ -80,7 +80,7 @@ class ReservationPage extends GetView<ReservationController> {
Widget _buildUserInfoCard() { Widget _buildUserInfoCard() {
return Card( return Card(
elevation: 2, // 轻微的阴影 elevation: 2, // 轻微的阴影
shadowColor: Colors.black.withOpacity(0.1), margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Column( child: Column(
children: [ children: [