feat:更新UI颜色
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user