提交 3873f400 authored 作者: guoqing's avatar guoqing

修改基础库警告

上级 b8b4d5ff
import 'package:flutter/widgets.dart';
import 'package:flutter_clx_base/utils/log_utils.dart';
/// 扩展函数 Iterable
extension IterableExt<E> on Iterable<E>? {
......@@ -84,7 +85,7 @@ extension DoubleExt on num? {
try {
num = double.parse(toString());
} catch (e) {
print("转换异常:$e");
loggerNoStack.i("转换异常:$e");
return nullTxt;
}
if ((num.toString().length - num.toString().lastIndexOf(".") - 1) < 2) {
......@@ -113,7 +114,7 @@ extension DoubleExt on num? {
try {
num = int.parse(toString());
} catch (e) {
print("转换异常:$e");
loggerNoStack.d("转换异常:$e");
return nullTxt;
}
return num.toString();
......
import 'package:flutter_clx_base/utils/log_utils.dart';
import 'package:get/get.dart';
......@@ -32,7 +33,7 @@ String formatDouble(number, {nullTxt = "-"}) {
try {
num = double.parse(number.toString());
} catch (e) {
print("转换异常:$e");
loggerNoStack.d("转换异常:$e");
return nullTxt;
}
if ((num.toString().length - num.toString().lastIndexOf(".") - 1) < 2) {
......@@ -61,7 +62,7 @@ String formatInt(number, {nullTxt = "-"}) {
try {
num = int.parse(number.toString());
} catch (e) {
print("转换异常:$e");
loggerNoStack.i("转换异常:$e");
return nullTxt;
}
return num.toString();
......
......@@ -39,8 +39,6 @@ String txtLength(String? txt, {int? length, nullTxt = ""}) {
}
}
//时间去除.0
String? rightTime(String? time) {
String? rightTime = time;
......@@ -65,19 +63,23 @@ int getControllerStringLength(TextEditingController controller) {
return getControllerString(controller).length;
}
bool checkEasyPwd(String input,String phone) {
bool checkEasyPwd(String input, String phone) {
//1:不能出现连续的字母或者数字
var allMatchLength = input.length - 1; // 匹配全部
var preMatchLength = input.length - 2; // 匹配N-1位
RegExp allSameChar = new RegExp("([0-9a-zA-Z])\\1{$allMatchLength}"); // 匹配全为连续字符
RegExp preSameChar = new RegExp("([0-9a-zA-Z])\\1{$preMatchLength}"); // 匹配n-1位位连续字符
RegExp allSameChar = RegExp("([0-9a-zA-Z])\\1{$allMatchLength}"); // 匹配全为连续字符
RegExp preSameChar =
RegExp("([0-9a-zA-Z])\\1{$preMatchLength}"); // 匹配n-1位位连续字符
//2:不能出现顺子(123456或654321一类) 连续的数字
// allSuccessiveNum 顺子
// startCharSuccessiveNum 第一位字母 后面顺子
// endCharSuccessiveNum 最后一位字母 前面顺子
RegExp allSuccessiveNum = new RegExp("(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)|9(?=0)){$allMatchLength}\\d|(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$allMatchLength}\\d");
RegExp startCharSuccessiveNum = new RegExp("[A-Za-z](?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){$preMatchLength}\\d|[A-Za-z](?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$preMatchLength}\\d");
RegExp endCharSuccessiveNum = new RegExp("((?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){$preMatchLength}\\d)[A-Za-z]|((?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$preMatchLength}\\d)[A-Za-z]");
RegExp allSuccessiveNum = RegExp(
"(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)|9(?=0)){$allMatchLength}\\d|(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$allMatchLength}\\d");
RegExp startCharSuccessiveNum = RegExp(
"[A-Za-z](?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){$preMatchLength}\\d|[A-Za-z](?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$preMatchLength}\\d");
RegExp endCharSuccessiveNum = RegExp(
"((?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){$preMatchLength}\\d)[A-Za-z]|((?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){$preMatchLength}\\d)[A-Za-z]");
// print('----- allSameChar: $allSameChar');
// print('----- preSameChar: $preSameChar');
......
......@@ -19,8 +19,8 @@ class MyScaffold extends StatelessWidget {
Key? key,
this.appBar,
this.backgroundColor,
this.children,
this.title = "",
this.children,
this.padding,
this.body,
this.bottomButton,
......@@ -35,11 +35,11 @@ class MyScaffold extends StatelessWidget {
backgroundColor: backgroundColor ?? const Color(0xFFf2f3f3),
body: body ??
MyScrollView(
children: children,
padding: padding,
bottomButton: bottomButton,
crossAxisAlignment: crossAxisAlignment,
keyboardConfig: keyboardConfig,
children: children ?? [],
),
);
}
......
......@@ -20,7 +20,7 @@ class MyScrollView extends StatelessWidget {
this.overScroll = 16.0,
}) : super(key: key);
final List<Widget>? children;
final List<Widget> children;
final EdgeInsetsGeometry? padding;
final ScrollPhysics physics;
final CrossAxisAlignment crossAxisAlignment;
......@@ -37,7 +37,7 @@ class MyScrollView extends StatelessWidget {
Widget build(BuildContext context) {
Widget contents = Column(
crossAxisAlignment: crossAxisAlignment,
children: children!,
children: children,
);
if (defaultTargetPlatform == TargetPlatform.iOS && keyboardConfig != null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论