Browse Source

1.修复出生日期月日不随年变化的问题

tags/0.0.14+3
“yanghuaxuan” 3 years ago
parent
commit
400a089e99
2 changed files with 9 additions and 12 deletions
  1. +2
    -2
      example/android/app/build.gradle
  2. +7
    -10
      lib/widgets/others/action_date_alert/action_date_alert.dart

+ 2
- 2
example/android/app/build.gradle View File

@@ -53,8 +53,8 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
//选择要添加的对应cpu类型的.so库。 //选择要添加的对应cpu类型的.so库。
//abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
// abiFilters 'armeabi-v7a','x86_64'
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
//abiFilters 'armeabi-v7a','x86_64'
} }
} }




+ 7
- 10
lib/widgets/others/action_date_alert/action_date_alert.dart View File

@@ -9,9 +9,7 @@ class ActionDateAlert extends StatefulWidget {
final TextStyle selectedStyle; final TextStyle selectedStyle;
final String maxTimeNew; final String maxTimeNew;


const ActionDateAlert({Key key, this.title, this.normalStyle, this.selectedStyle,this.maxTimeNew}) : super(key: key);


const ActionDateAlert({Key key, this.title, this.normalStyle, this.selectedStyle, this.maxTimeNew}) : super(key: key);


@override @override
State<StatefulWidget> createState() => _ActionDateAlert(); State<StatefulWidget> createState() => _ActionDateAlert();
@@ -34,9 +32,7 @@ class _ActionDateAlert extends State<ActionDateAlert> {
width: double.infinity, width: double.infinity,
height: 250, height: 250,
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10))),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10))),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
widget.title == null || widget.title == '' widget.title == null || widget.title == ''
@@ -87,14 +83,15 @@ class _ActionDateAlert extends State<ActionDateAlert> {


Widget _createContent(BuildContext context) { Widget _createContent(BuildContext context) {
DateTime maxTime; DateTime maxTime;
if(!EmptyUtil.isEmpty(widget.maxTimeNew) && widget.maxTimeNew=="max"){
maxTime=DateTime.now();
}else{
maxTime=DateTime.parse("2100-12-31 23:59:59");
if (!EmptyUtil.isEmpty(widget.maxTimeNew) && widget.maxTimeNew == "max") {
maxTime = DateTime.now();
} else {
maxTime = DateTime.parse("2100-12-31 23:59:59");
} }
return DatePickerWidget( return DatePickerWidget(
maxDateTime: maxTime, maxDateTime: maxTime,
initialDateTime: _dateTime, initialDateTime: _dateTime,
onMonthChangeStartWithFirstDate: true,
onChange: (dataTime, list) { onChange: (dataTime, list) {
_dateTime = dataTime; _dateTime = dataTime;
}, },


Loading…
Cancel
Save