Commit 4d1866fd1a344f991336798e071256e8f657108b

Authored by 蓋亞光
1 parent 702104e2

跨年bug修复

@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "146" 14 +def flutterVersionCode = "151"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '146' 16 + flutterVersionCode = '151'
17 } 17 }
18 18
19 -def flutterVersionName = "1.4.6" 19 +def flutterVersionName = "1.5.1"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '1.4.6' 21 + flutterVersionName = '1.5.1'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
@@ -34,7 +34,7 @@ Future<void> main() async { @@ -34,7 +34,7 @@ Future<void> main() async {
34 Routes.configureRoutes(router); 34 Routes.configureRoutes(router);
35 App.router = router; 35 App.router = router;
36 App.setupLocator(); 36 App.setupLocator();
37 - LogUtil.init(isDebug: true, tag: 'ONE_KEY'); 37 + LogUtil.init(isDebug: false, tag: 'ONE_KEY');
38 Provider.debugCheckInvalidValueType = null; 38 Provider.debugCheckInvalidValueType = null;
39 await initializeDateFormatting(); 39 await initializeDateFormatting();
40 SystemChrome.setPreferredOrientations( 40 SystemChrome.setPreferredOrientations(
@@ -143,13 +143,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -143,13 +143,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
143 if (j == 143 if (j ==
144 _notebookDetailChangeModel.dateList.length - 1) { 144 _notebookDetailChangeModel.dateList.length - 1) {
145 String selectStr = 145 String selectStr =
146 - _notebookDetailChangeModel.dateList[2]['title'];  
147 - String timeNow = DateUtil.formatDate(  
148 - DateTime.now(),  
149 - );  
150 - String selectDate =  
151 - timeNow.replaceRange(5, 10, selectStr);  
152 - _calendWidget(DateUtil.getDateTime(selectDate)); 146 + _notebookDetailChangeModel.dateList[2]['title']+" 00:00:00";
  147 + _calendWidget(DateUtil.getDateTime(selectStr));
153 } 148 }
154 } 149 }
155 } 150 }
@@ -310,7 +305,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -310,7 +305,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
310 // _createDateText(day); 305 // _createDateText(day);
311 dateTime = day; 306 dateTime = day;
312 int dateTimeMill = day.millisecondsSinceEpoch; 307 int dateTimeMill = day.millisecondsSinceEpoch;
313 - String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'MM-dd'); 308 + String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'yyyy-MM-dd');
314 bool isThird = true; 309 bool isThird = true;
315 for (int i = 0; i < _notebookDetailChangeModel.dateList.length; i++) { 310 for (int i = 0; i < _notebookDetailChangeModel.dateList.length; i++) {
316 _notebookDetailChangeModel.dateList[i]['select'] = false; 311 _notebookDetailChangeModel.dateList[i]['select'] = false;
@@ -354,17 +349,13 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -354,17 +349,13 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
354 InkWell( 349 InkWell(
355 onTap: () async { 350 onTap: () async {
356 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 351 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
357 - //当前选中 月 日string  
358 - String mdStr = ''; 352 + String ymyStr = ""; //年月日
359 //今天 明天 其他天 353 //今天 明天 其他天
360 for (var item in _notebookDetailChangeModel.dateList) { 354 for (var item in _notebookDetailChangeModel.dateList) {
361 if (item['select'] == true) { 355 if (item['select'] == true) {
362 - mdStr = item['title']; 356 + ymyStr = item['title'];
363 } 357 }
364 } 358 }
365 - String timeNowYear =  
366 - DateUtil.formatDate(DateTime.now(), format: 'yyyy');  
367 - String ymyStr = timeNowYear + '-' + mdStr; //年月日  
368 String timeStr = ymyStr + ' ' + "00:00:00"; 359 String timeStr = ymyStr + ' ' + "00:00:00";
369 int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳 360 int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
370 String ddateSolt = ''; 361 String ddateSolt = '';
@@ -689,18 +680,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -689,18 +680,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
689 tempMndList = _notebookDetailChangeModel.dailyMap[key]; 680 tempMndList = _notebookDetailChangeModel.dailyMap[key];
690 } 681 }
691 } 682 }
692 - //计算行数  
693 -  
694 - int line = 0;  
695 - int count = tempMndList.length;  
696 - if (count % 3 == 0) {  
697 - line = int.parse('${count / 3}');  
698 - } else {  
699 - line = (count / 3).ceil();  
700 - }  
701 - int height = 85 + 40 + 36 * line + (line - 1) * 15;  
702 final option = await showModalBottomSheet( 683 final option = await showModalBottomSheet(
703 context: context, 684 context: context,
  685 + isScrollControlled: true,
704 backgroundColor: Colors.white, 686 backgroundColor: Colors.white,
705 builder: (context) { 687 builder: (context) {
706 return StatefulBuilder(builder: (context, state) { 688 return StatefulBuilder(builder: (context, state) {
@@ -709,8 +691,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -709,8 +691,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
709 decoration: BoxDecoration( 691 decoration: BoxDecoration(
710 borderRadius: 692 borderRadius:
711 BorderRadius.circular(ScreenUtil().setWidth(10))), 693 BorderRadius.circular(ScreenUtil().setWidth(10))),
712 - height: ScreenUtil().setWidth(height * 2),  
713 child: Column( 694 child: Column(
  695 + mainAxisSize: MainAxisSize.min,
714 children: [ 696 children: [
715 InkWell( 697 InkWell(
716 onTap: () { 698 onTap: () {
@@ -739,10 +721,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -739,10 +721,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
739 fontWeight: FontWeight.bold, 721 fontWeight: FontWeight.bold,
740 color: MyColours.color_353535)), 722 color: MyColours.color_353535)),
741 ), 723 ),
742 - VEmptyView(40),  
743 Padding( 724 Padding(
744 padding: EdgeInsets.symmetric( 725 padding: EdgeInsets.symmetric(
745 - horizontal: ScreenUtil().setWidth(60)), 726 + horizontal: ScreenUtil().setWidth(60),vertical: ScreenUtil().setWidth(40)),
746 child: GridView.builder( 727 child: GridView.builder(
747 padding: 728 padding:
748 EdgeInsets.only(top: ScreenUtil().setWidth(20)), 729 EdgeInsets.only(top: ScreenUtil().setWidth(20)),
@@ -160,16 +160,13 @@ class Utils { @@ -160,16 +160,13 @@ class Utils {
160 160
161 /// 获取日期 今天 明天 后天等等 161 /// 获取日期 今天 明天 后天等等
162 static int getDdate(List dateList) { 162 static int getDdate(List dateList) {
163 - //当前选中 月 日string  
164 - String mdStr = ''; 163 + String ymyStr = ""; //年月日
165 //今天 明天 其他天 164 //今天 明天 其他天
166 for (var item in dateList) { 165 for (var item in dateList) {
167 if (item['select'] == true) { 166 if (item['select'] == true) {
168 - mdStr = item['title']; 167 + ymyStr = item['title'];
169 } 168 }
170 } 169 }
171 - String timeNowYear = DateUtil.formatDate(DateTime.now(), format: 'yyyy');  
172 - String ymyStr = timeNowYear + '-' + mdStr; //年月日  
173 String timeStr = ymyStr + ' ' + "00:00:00"; 170 String timeStr = ymyStr + ' ' + "00:00:00";
174 int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳 171 int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
175 return ddate; 172 return ddate;