登录页面样式

This commit is contained in:
GYJ
2024-11-25 14:11:57 +08:00
parent b84d8477c0
commit 2f1eb7abc4
9 changed files with 401 additions and 88 deletions

View File

@@ -0,0 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'func_tools.dart';
class Utils {
///大陆手机号码11位数匹配格式前三位固定格式+后8位任意数
static bool isPhone(String phone) {
return RegExp('^1\\d{10}\$').hasMatch(phone);
}
static void toast(String? text, BuildContext? context) {
if (isEmptyString(text)) {
return;
}
Fluttertoast.showToast(
msg: "$text",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
// backgroundColor: Colors.red,
// textColor: Colors.white,
fontSize: 16.0);
}
static Future alert(BuildContext context, String? content, {String? title}) {
return showCupertinoDialog(
context: context,
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text(title ?? '提示'),
content: Text(content!),
actions: <Widget>[
TextButton(
child: const Text('确定'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
});
}
}