feat:更新UI颜色

This commit is contained in:
2025-07-17 23:03:33 +08:00
parent eec0e9f7d3
commit 05fdbf9462
6 changed files with 86 additions and 74 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:fluttertoast/fluttertoast.dart';
Widget formLabelText({required String labelText, bool isRequired = false}) {
return Text.rich(
@@ -28,6 +27,7 @@ InputDecoration formInputDecoration({
);
}
/// 确认按钮样式
ButtonStyle primaryButtonStyle() {
return ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.green),
@@ -37,6 +37,7 @@ ButtonStyle primaryButtonStyle() {
);
}
/// 取消按钮样式
ButtonStyle cancelButtonStyle() {
return ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.grey),
@@ -50,6 +51,22 @@ Text buttonText({required String text}) {
return Text(text, style: TextStyle(color: Colors.white));
}
Widget errorImageContainer(double height) {
return Container(
height: height,
color: Colors.grey[200],
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.error, color: Colors.red),
const SizedBox(width: 5),
const Text("加载失败", style: TextStyle(color: Colors.red)),
],
),
);
}
/// 成功消息
void showSuccessToast(String message) {
Fluttertoast.showToast(
msg: message,
@@ -62,6 +79,7 @@ void showSuccessToast(String message) {
);
}
/// 错误消息
void showErrorToast(String message) {
Fluttertoast.showToast(
msg: message,