Showing
1 changed file
with
279 additions
and
186 deletions
| @@ -15,13 +15,12 @@ import 'package:provider/provider.dart'; | @@ -15,13 +15,12 @@ import 'package:provider/provider.dart'; | ||
| 15 | import 'package:table_calendar/table_calendar.dart'; | 15 | import 'package:table_calendar/table_calendar.dart'; |
| 16 | 16 | ||
| 17 | class DialogUtil { | 17 | class DialogUtil { |
| 18 | - | ||
| 19 | //显示消息弹框 | 18 | //显示消息弹框 |
| 20 | static showMessageDialog(BuildContext context) async { | 19 | static showMessageDialog(BuildContext context) async { |
| 21 | MessageDialogModel messageModel = | 20 | MessageDialogModel messageModel = |
| 22 | - Provider.of<MessageDialogModel>(context, listen: false); | 21 | + Provider.of<MessageDialogModel>(context, listen: false); |
| 23 | if (messageModel.messages.isEmpty) return null; | 22 | if (messageModel.messages.isEmpty) return null; |
| 24 | - messageModel.showMessageDialog=true; | 23 | + messageModel.showMessageDialog = true; |
| 25 | await showModalBottomSheet<int>( | 24 | await showModalBottomSheet<int>( |
| 26 | context: context, | 25 | context: context, |
| 27 | isScrollControlled: true, | 26 | isScrollControlled: true, |
| @@ -33,12 +32,14 @@ class DialogUtil { | @@ -33,12 +32,14 @@ class DialogUtil { | ||
| 33 | children: <Widget>[ | 32 | children: <Widget>[ |
| 34 | Consumer<MessageDialogModel>(builder: (BuildContext context, | 33 | Consumer<MessageDialogModel>(builder: (BuildContext context, |
| 35 | MessageDialogModel model, Widget child) { | 34 | MessageDialogModel model, Widget child) { |
| 36 | - if(messageModel.messages.isEmpty)return Container(); | 35 | + if (messageModel.messages.isEmpty) return Container(); |
| 37 | return Column( | 36 | return Column( |
| 38 | mainAxisSize: MainAxisSize.min, | 37 | mainAxisSize: MainAxisSize.min, |
| 39 | children: <Widget>[ | 38 | children: <Widget>[ |
| 40 | Container( | 39 | Container( |
| 41 | - margin: EdgeInsets.only(top: ScreenUtil().setWidth(21),bottom: ScreenUtil().setWidth(12)), | 40 | + margin: EdgeInsets.only( |
| 41 | + top: ScreenUtil().setWidth(21), | ||
| 42 | + bottom: ScreenUtil().setWidth(12)), | ||
| 42 | width: double.infinity, | 43 | width: double.infinity, |
| 43 | child: Stack( | 44 | child: Stack( |
| 44 | alignment: Alignment.center, | 45 | alignment: Alignment.center, |
| @@ -56,8 +57,8 @@ class DialogUtil { | @@ -56,8 +57,8 @@ class DialogUtil { | ||
| 56 | Navigator.of(dialogContext).pop(); | 57 | Navigator.of(dialogContext).pop(); |
| 57 | }, | 58 | }, |
| 58 | child: Padding( | 59 | child: Padding( |
| 59 | - padding: | ||
| 60 | - EdgeInsets.all(ScreenUtil().setWidth(12)), | 60 | + padding: EdgeInsets.all( |
| 61 | + ScreenUtil().setWidth(12)), | ||
| 61 | child: Image.asset( | 62 | child: Image.asset( |
| 62 | "assets/icon_close.png", | 63 | "assets/icon_close.png", |
| 63 | width: ScreenUtil().setWidth(28), | 64 | width: ScreenUtil().setWidth(28), |
| @@ -67,70 +68,78 @@ class DialogUtil { | @@ -67,70 +68,78 @@ class DialogUtil { | ||
| 67 | )) | 68 | )) |
| 68 | ], | 69 | ], |
| 69 | )), | 70 | )), |
| 70 | - model.messages.length>3?Container( | ||
| 71 | - margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(22),vertical: ScreenUtil().setWidth(11)), | ||
| 72 | - padding: EdgeInsets.fromLTRB( | ||
| 73 | - ScreenUtil().setWidth(16), | ||
| 74 | - ScreenUtil().setWidth(76), | ||
| 75 | - ScreenUtil().setWidth(16), | ||
| 76 | - ScreenUtil().setWidth(41)), | ||
| 77 | - decoration: BoxDecoration( | ||
| 78 | - color: MyColours.color_fefefe, | ||
| 79 | - borderRadius: | ||
| 80 | - BorderRadius.all(Radius.circular(ScreenUtil().setWidth(8)))), | ||
| 81 | - child: Column( | ||
| 82 | - mainAxisSize: MainAxisSize.min, | ||
| 83 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 84 | - children: <Widget>[ | ||
| 85 | - Row( | ||
| 86 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 87 | - children: <Widget>[ | ||
| 88 | - Text( | ||
| 89 | - "在线预订", | ||
| 90 | - style: TextStyle( | ||
| 91 | - color: MyColours.color_353535, | ||
| 92 | - fontSize: ScreenUtil().setSp(32)), | ||
| 93 | - ), | ||
| 94 | - Spacer(), | ||
| 95 | - Text( | ||
| 96 | - "刚刚", | ||
| 97 | - style: TextStyle( | ||
| 98 | - color: MyColours.color_999999, | ||
| 99 | - fontSize: ScreenUtil().setSp(22)), | ||
| 100 | - ), | ||
| 101 | - ], | ||
| 102 | - ), | ||
| 103 | - VEmptyView(20), | ||
| 104 | - Text( | ||
| 105 | - "在线预订:${model.messages.length}个", | ||
| 106 | - style: TextStyle( | ||
| 107 | - color: MyColours.color_353535, | ||
| 108 | - fontSize: ScreenUtil().setSp(32)), | ||
| 109 | - ), | ||
| 110 | - Row( | ||
| 111 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 112 | - children: <Widget>[ | ||
| 113 | - Spacer(), | ||
| 114 | - CommonButton( | ||
| 115 | - width: 160, | ||
| 116 | - height: 48, | ||
| 117 | - fontSize: 32, | ||
| 118 | - content: "立即处理", | ||
| 119 | - state: 1, | ||
| 120 | - onPress: () { | ||
| 121 | - NavigatorUtil.goHomePage(context,initialIndex: 0); | ||
| 122 | - }, | ||
| 123 | - ) | ||
| 124 | - ], | 71 | + model.messages.length > 3 |
| 72 | + ? Container( | ||
| 73 | + margin: EdgeInsets.symmetric( | ||
| 74 | + horizontal: ScreenUtil().setWidth(22), | ||
| 75 | + vertical: ScreenUtil().setWidth(11)), | ||
| 76 | + padding: EdgeInsets.fromLTRB( | ||
| 77 | + ScreenUtil().setWidth(16), | ||
| 78 | + ScreenUtil().setWidth(76), | ||
| 79 | + ScreenUtil().setWidth(16), | ||
| 80 | + ScreenUtil().setWidth(41)), | ||
| 81 | + decoration: BoxDecoration( | ||
| 82 | + color: MyColours.color_fefefe, | ||
| 83 | + borderRadius: BorderRadius.all( | ||
| 84 | + Radius.circular( | ||
| 85 | + ScreenUtil().setWidth(8)))), | ||
| 86 | + child: Column( | ||
| 87 | + mainAxisSize: MainAxisSize.min, | ||
| 88 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 89 | + children: <Widget>[ | ||
| 90 | + Row( | ||
| 91 | + crossAxisAlignment: | ||
| 92 | + CrossAxisAlignment.center, | ||
| 93 | + children: <Widget>[ | ||
| 94 | + Text( | ||
| 95 | + "在线预订", | ||
| 96 | + style: TextStyle( | ||
| 97 | + color: MyColours.color_353535, | ||
| 98 | + fontSize: ScreenUtil().setSp(32)), | ||
| 99 | + ), | ||
| 100 | + Spacer(), | ||
| 101 | + Text( | ||
| 102 | + "刚刚", | ||
| 103 | + style: TextStyle( | ||
| 104 | + color: MyColours.color_999999, | ||
| 105 | + fontSize: ScreenUtil().setSp(22)), | ||
| 106 | + ), | ||
| 107 | + ], | ||
| 108 | + ), | ||
| 109 | + VEmptyView(20), | ||
| 110 | + Text( | ||
| 111 | + "在线预订:${model.messages.length}个", | ||
| 112 | + style: TextStyle( | ||
| 113 | + color: MyColours.color_353535, | ||
| 114 | + fontSize: ScreenUtil().setSp(32)), | ||
| 115 | + ), | ||
| 116 | + Row( | ||
| 117 | + crossAxisAlignment: | ||
| 118 | + CrossAxisAlignment.center, | ||
| 119 | + children: <Widget>[ | ||
| 120 | + Spacer(), | ||
| 121 | + CommonButton( | ||
| 122 | + width: 160, | ||
| 123 | + height: 48, | ||
| 124 | + fontSize: 32, | ||
| 125 | + content: "立即处理", | ||
| 126 | + state: 1, | ||
| 127 | + onPress: () { | ||
| 128 | + NavigatorUtil.goHomePage(context, | ||
| 129 | + initialIndex: 0); | ||
| 130 | + }, | ||
| 131 | + ) | ||
| 132 | + ], | ||
| 133 | + ) | ||
| 134 | + ], | ||
| 135 | + ), | ||
| 125 | ) | 136 | ) |
| 126 | - ], | ||
| 127 | - ), | ||
| 128 | - ):ListView.builder( | ||
| 129 | - itemBuilder: (context, index) { | ||
| 130 | - return MessageDialogItem(model.messages[index]); | ||
| 131 | - }, | ||
| 132 | - itemCount: model.messages.length, | ||
| 133 | - shrinkWrap: true) | 137 | + : ListView.builder( |
| 138 | + itemBuilder: (context, index) { | ||
| 139 | + return MessageDialogItem(model.messages[index]); | ||
| 140 | + }, | ||
| 141 | + itemCount: model.messages.length, | ||
| 142 | + shrinkWrap: true) | ||
| 134 | ], | 143 | ], |
| 135 | ); | 144 | ); |
| 136 | }) | 145 | }) |
| @@ -139,30 +148,42 @@ class DialogUtil { | @@ -139,30 +148,42 @@ class DialogUtil { | ||
| 139 | ); | 148 | ); |
| 140 | return widget; | 149 | return widget; |
| 141 | }); | 150 | }); |
| 142 | - messageModel.showMessageDialog=false; | 151 | + messageModel.showMessageDialog = false; |
| 143 | } | 152 | } |
| 144 | 153 | ||
| 145 | //解析返回显示的日期 | 154 | //解析返回显示的日期 |
| 146 | - static String _parseDateDay(DateTime dateTime){ | ||
| 147 | - DateTime now=DateTime.now(); | ||
| 148 | - if(Utils.isOneDay(dateTime,now)){ | 155 | + static String _parseDateDay(DateTime dateTime) { |
| 156 | + DateTime now = DateTime.now(); | ||
| 157 | + if (Utils.isOneDay(dateTime, now)) { | ||
| 149 | return "今"; | 158 | return "今"; |
| 150 | - }else if(Utils.isOneDay(dateTime,now.add(Duration(days: 1)))){ | 159 | + } else if (Utils.isOneDay(dateTime, now.add(Duration(days: 1)))) { |
| 151 | return "明"; | 160 | return "明"; |
| 152 | - }else if(Utils.isOneDay(dateTime,now.add(Duration(days: 2)))){ | 161 | + } else if (Utils.isOneDay(dateTime, now.add(Duration(days: 2)))) { |
| 153 | return "后"; | 162 | return "后"; |
| 154 | - }else{ | 163 | + } else { |
| 155 | return dateTime.day.toString(); | 164 | return dateTime.day.toString(); |
| 156 | } | 165 | } |
| 157 | } | 166 | } |
| 158 | 167 | ||
| 159 | //显示日历弹框 | 168 | //显示日历弹框 |
| 160 | - static Future<DateTime> showCalendarDialog(BuildContext context,DateTime selectDateTime) { | 169 | + static Future<DateTime> showCalendarDialog( |
| 170 | + BuildContext context, DateTime selectDateTime) { | ||
| 161 | CalendarController _calendarController = CalendarController(); | 171 | CalendarController _calendarController = CalendarController(); |
| 162 | - Map<DateTime, List> _events = {}; | 172 | + final _selectedDay = DateTime.now(); |
| 173 | + Map<DateTime, List> _events = { | ||
| 174 | + _selectedDay: ['Event A7', 'Event B7', 'Event C7', 'Event D7'], | ||
| 175 | + _selectedDay.add(Duration(days: 1)): [ | ||
| 176 | + 'Event A8', | ||
| 177 | + 'Event B8', | ||
| 178 | + 'Event C8', | ||
| 179 | + 'Event D8' | ||
| 180 | + ], | ||
| 181 | + _selectedDay.add(Duration(days: 2)): | ||
| 182 | + Set.from(['Event A9', 'Event A9', 'Event B9']).toList(), | ||
| 183 | + }; | ||
| 163 | return showModalBottomSheet<DateTime>( | 184 | return showModalBottomSheet<DateTime>( |
| 164 | context: context, | 185 | context: context, |
| 165 | - isScrollControlled:true, | 186 | + isScrollControlled: true, |
| 166 | builder: (BuildContext context) { | 187 | builder: (BuildContext context) { |
| 167 | BuildContext dialogContext = context; | 188 | BuildContext dialogContext = context; |
| 168 | Widget widget = StatefulBuilder(builder: (context, _setState) { | 189 | Widget widget = StatefulBuilder(builder: (context, _setState) { |
| @@ -183,8 +204,8 @@ class DialogUtil { | @@ -183,8 +204,8 @@ class DialogUtil { | ||
| 183 | locale: "zh_CN", | 204 | locale: "zh_CN", |
| 184 | initialCalendarFormat: CalendarFormat.month, | 205 | initialCalendarFormat: CalendarFormat.month, |
| 185 | headerStyle: HeaderStyle( | 206 | headerStyle: HeaderStyle( |
| 186 | - decoration: BoxDecoration( | ||
| 187 | - color: MyColours.color_2bb5b7), | 207 | + decoration: |
| 208 | + BoxDecoration(color: MyColours.color_2bb5b7), | ||
| 188 | headerPadding: EdgeInsets.zero, | 209 | headerPadding: EdgeInsets.zero, |
| 189 | formatButtonVisible: false, | 210 | formatButtonVisible: false, |
| 190 | centerHeaderTitle: false, | 211 | centerHeaderTitle: false, |
| @@ -197,10 +218,10 @@ class DialogUtil { | @@ -197,10 +218,10 @@ class DialogUtil { | ||
| 197 | titleTextStyle: TextStyle( | 218 | titleTextStyle: TextStyle( |
| 198 | color: MyColours.color_ffffff, | 219 | color: MyColours.color_ffffff, |
| 199 | fontSize: ScreenUtil().setSp(30)), | 220 | fontSize: ScreenUtil().setSp(30)), |
| 200 | - leftChevronIcon: | ||
| 201 | - const Icon(Icons.chevron_left, color: Colors.white), | ||
| 202 | - rightChevronIcon: | ||
| 203 | - const Icon(Icons.chevron_right, color: Colors.white), | 221 | + leftChevronIcon: const Icon(Icons.chevron_left, |
| 222 | + color: Colors.white), | ||
| 223 | + rightChevronIcon: const Icon(Icons.chevron_right, | ||
| 224 | + color: Colors.white), | ||
| 204 | ), | 225 | ), |
| 205 | calendarStyle: CalendarStyle( | 226 | calendarStyle: CalendarStyle( |
| 206 | contentPadding: const EdgeInsets.only(bottom: 4.0), | 227 | contentPadding: const EdgeInsets.only(bottom: 4.0), |
| @@ -218,6 +239,7 @@ class DialogUtil { | @@ -218,6 +239,7 @@ class DialogUtil { | ||
| 218 | return Container( | 239 | return Container( |
| 219 | color: MyColours.color_2bb5b7, | 240 | color: MyColours.color_2bb5b7, |
| 220 | alignment: Alignment.center, | 241 | alignment: Alignment.center, |
| 242 | + margin: EdgeInsets.only(bottom: 20), | ||
| 221 | padding: EdgeInsets.symmetric( | 243 | padding: EdgeInsets.symmetric( |
| 222 | vertical: ScreenUtil().setHeight(25)), | 244 | vertical: ScreenUtil().setHeight(25)), |
| 223 | child: Text( | 245 | child: Text( |
| @@ -228,17 +250,20 @@ class DialogUtil { | @@ -228,17 +250,20 @@ class DialogUtil { | ||
| 228 | ), | 250 | ), |
| 229 | ); | 251 | ); |
| 230 | }, | 252 | }, |
| 231 | - dayBuilder: (context,date,_){ | 253 | + dayBuilder: (context, date, _) { |
| 232 | return Container( | 254 | return Container( |
| 255 | + height: 100, | ||
| 233 | decoration: BoxDecoration( | 256 | decoration: BoxDecoration( |
| 234 | - shape: BoxShape.circle, | 257 | + shape: BoxShape.circle, |
| 258 | + // color: Colors.blue, | ||
| 235 | ), | 259 | ), |
| 236 | alignment: Alignment.center, | 260 | alignment: Alignment.center, |
| 237 | - margin: const EdgeInsets.all(6.0), | 261 | + margin: const EdgeInsets.fromLTRB(6, 6, 6, 16), |
| 238 | padding: const EdgeInsets.only( | 262 | padding: const EdgeInsets.only( |
| 239 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), | 263 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), |
| 240 | child: Text( | 264 | child: Text( |
| 241 | - "${_parseDateDay(date)}", | 265 | + // "${_parseDateDay(date)}", |
| 266 | + '${date.day}', | ||
| 242 | style: TextStyle().copyWith( | 267 | style: TextStyle().copyWith( |
| 243 | fontSize: ScreenUtil().setSp(32), | 268 | fontSize: ScreenUtil().setSp(32), |
| 244 | color: MyColours.color_353535), | 269 | color: MyColours.color_353535), |
| @@ -249,14 +274,14 @@ class DialogUtil { | @@ -249,14 +274,14 @@ class DialogUtil { | ||
| 249 | return Container( | 274 | return Container( |
| 250 | decoration: BoxDecoration( | 275 | decoration: BoxDecoration( |
| 251 | shape: BoxShape.circle, | 276 | shape: BoxShape.circle, |
| 252 | - color: MyColours.color_2bb5b7 | ||
| 253 | - ), | 277 | + color: MyColours.color_2bb5b7), |
| 254 | alignment: Alignment.center, | 278 | alignment: Alignment.center, |
| 255 | - margin: const EdgeInsets.all(6.0), | 279 | + margin: const EdgeInsets.fromLTRB(6, 6, 6, 16), |
| 256 | padding: const EdgeInsets.only( | 280 | padding: const EdgeInsets.only( |
| 257 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), | 281 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), |
| 258 | child: Text( | 282 | child: Text( |
| 259 | - "${_parseDateDay(date)}", | 283 | + // "${_parseDateDay(date)}", |
| 284 | + '${date.day}', | ||
| 260 | style: TextStyle().copyWith( | 285 | style: TextStyle().copyWith( |
| 261 | fontSize: ScreenUtil().setSp(32), | 286 | fontSize: ScreenUtil().setSp(32), |
| 262 | color: MyColours.color_ffffff), | 287 | color: MyColours.color_ffffff), |
| @@ -270,29 +295,59 @@ class DialogUtil { | @@ -270,29 +295,59 @@ class DialogUtil { | ||
| 270 | border: Border.all( | 295 | border: Border.all( |
| 271 | color: MyColours.color_2bb5b7, width: 1)), | 296 | color: MyColours.color_2bb5b7, width: 1)), |
| 272 | alignment: Alignment.center, | 297 | alignment: Alignment.center, |
| 273 | - margin: const EdgeInsets.all(6.0), | 298 | + margin: const EdgeInsets.fromLTRB(6, 6, 6, 16), |
| 274 | padding: const EdgeInsets.only( | 299 | padding: const EdgeInsets.only( |
| 275 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), | 300 | bottom: 4.0, left: 8.0, right: 8.0, top: 4.0), |
| 276 | child: Text( | 301 | child: Text( |
| 277 | - '今', | 302 | + // '今', |
| 303 | + '${date.day}', | ||
| 278 | style: TextStyle().copyWith( | 304 | style: TextStyle().copyWith( |
| 279 | fontSize: ScreenUtil().setSp(32), | 305 | fontSize: ScreenUtil().setSp(32), |
| 280 | color: MyColours.color_2bb5b7), | 306 | color: MyColours.color_2bb5b7), |
| 281 | ), | 307 | ), |
| 282 | ); | 308 | ); |
| 283 | }, | 309 | }, |
| 284 | - singleMarkerBuilder: (context, dateTime, event) { | ||
| 285 | - return Container( | ||
| 286 | - width: ScreenUtil().setWidth(6), | ||
| 287 | - height: ScreenUtil().setWidth(6), | ||
| 288 | - margin: const EdgeInsets.symmetric( | ||
| 289 | - horizontal: 0.3), | ||
| 290 | - decoration: BoxDecoration( | ||
| 291 | - shape: BoxShape.circle, | ||
| 292 | - color: MyColours.color_ff0000, | ||
| 293 | - ), | 310 | + markersBuilder: (context, date, events, holidays) { |
| 311 | + final children = <Widget>[]; | ||
| 312 | + | ||
| 313 | + // if (events.isNotEmpty) { | ||
| 314 | + // children.add( | ||
| 315 | + // Positioned( | ||
| 316 | + // right: 1, | ||
| 317 | + // bottom: 1, | ||
| 318 | + // child: _buildEventsMarker(date, events), | ||
| 319 | + // ), | ||
| 320 | + // ); | ||
| 321 | + // } | ||
| 322 | + | ||
| 323 | + // if (holidays.isNotEmpty) { | ||
| 324 | + children.add( | ||
| 325 | + Positioned( | ||
| 326 | + right: ScreenUtil().setWidth(27), | ||
| 327 | + bottom: 0, | ||
| 328 | + top: 5, | ||
| 329 | + child: buildMarker(date)), | ||
| 330 | + // Align( | ||
| 331 | + // alignment: Alignment.bottomCenter, | ||
| 332 | + // child: buildMarker(date), | ||
| 333 | + // ) | ||
| 294 | ); | 334 | ); |
| 335 | + // } | ||
| 336 | + | ||
| 337 | + return children; | ||
| 295 | }, | 338 | }, |
| 339 | + // singleMarkerBuilder: (context, dateTime, event) { | ||
| 340 | + // return Container( | ||
| 341 | + // width: ScreenUtil().setWidth(6), | ||
| 342 | + // height: ScreenUtil().setWidth(6), | ||
| 343 | + // margin: | ||
| 344 | + // const EdgeInsets.symmetric(horizontal: 0.3), | ||
| 345 | + // decoration: BoxDecoration( | ||
| 346 | + // shape: BoxShape.circle, | ||
| 347 | + // color: MyColours.color_ff0000, | ||
| 348 | + // ), | ||
| 349 | + // ); | ||
| 350 | + // }, | ||
| 296 | ), | 351 | ), |
| 297 | ), | 352 | ), |
| 298 | ], | 353 | ], |
| @@ -310,17 +365,17 @@ class DialogUtil { | @@ -310,17 +365,17 @@ class DialogUtil { | ||
| 310 | child: Container( | 365 | child: Container( |
| 311 | child: ClipOval( | 366 | child: ClipOval( |
| 312 | child: Container( | 367 | child: Container( |
| 313 | - width: ScreenUtil().setWidth(100), | ||
| 314 | - height: ScreenUtil().setWidth(100), | ||
| 315 | - alignment: Alignment.center, | ||
| 316 | - color: MyColours.color_2bb5b7, | ||
| 317 | - child: Text( | ||
| 318 | - "今天", | ||
| 319 | - style: TextStyle( | ||
| 320 | - color: MyColours.color_ffffff, | ||
| 321 | - fontSize: ScreenUtil().setSp(32)), | ||
| 322 | - ), | ||
| 323 | - )), | 368 | + width: ScreenUtil().setWidth(100), |
| 369 | + height: ScreenUtil().setWidth(100), | ||
| 370 | + alignment: Alignment.center, | ||
| 371 | + color: MyColours.color_2bb5b7, | ||
| 372 | + child: Text( | ||
| 373 | + "回到\n今天", | ||
| 374 | + style: TextStyle( | ||
| 375 | + color: MyColours.color_ffffff, | ||
| 376 | + fontSize: ScreenUtil().setSp(26)), | ||
| 377 | + ), | ||
| 378 | + )), | ||
| 324 | ), | 379 | ), |
| 325 | ), | 380 | ), |
| 326 | ), | 381 | ), |
| @@ -336,93 +391,131 @@ class DialogUtil { | @@ -336,93 +391,131 @@ class DialogUtil { | ||
| 336 | }); | 391 | }); |
| 337 | } | 392 | } |
| 338 | 393 | ||
| 394 | + static Widget buildMarker(date) { | ||
| 395 | + return Container( | ||
| 396 | + height: ScreenUtil().setWidth(30), | ||
| 397 | + // color: Colors.red, | ||
| 398 | + // decoration: | ||
| 399 | + // BoxDecoration(shape: BoxShape.circle, color: MyColours.color_2bb5b7), | ||
| 400 | + alignment: Alignment.bottomCenter, | ||
| 401 | + margin: const EdgeInsets.fromLTRB(6, 6, 6, 0), | ||
| 402 | + padding: const EdgeInsets.only(top: 10.0), | ||
| 403 | + child: Text( | ||
| 404 | + "${_parseDateDay(date)}", | ||
| 405 | + style: TextStyle().copyWith( | ||
| 406 | + fontSize: ScreenUtil().setSp(28), color: MyColours.color_2bb5b7), | ||
| 407 | + ), | ||
| 408 | + ); | ||
| 409 | + } | ||
| 410 | + | ||
| 339 | //显示分享弹框 | 411 | //显示分享弹框 |
| 340 | static showShareDialog(BuildContext context) { | 412 | static showShareDialog(BuildContext context) { |
| 341 | - return showModalBottomSheet(context: context, builder: (context) { | ||
| 342 | - Widget widget = Container( | ||
| 343 | - width: double.infinity, | ||
| 344 | - height: ScreenUtil().setHeight(233), | ||
| 345 | - color: MyColours.color_f1f1f1, | ||
| 346 | - child: Row( | ||
| 347 | - children: <Widget>[ | ||
| 348 | - Expanded( | ||
| 349 | - child: GestureDetector( | ||
| 350 | - onTap: (){ | ||
| 351 | - Navigator.of(context).pop(1); | ||
| 352 | - }, | ||
| 353 | - behavior: HitTestBehavior.opaque, | ||
| 354 | - child: Column( | ||
| 355 | - mainAxisSize: MainAxisSize.min, | ||
| 356 | - children: <Widget>[ | ||
| 357 | - Image.asset( | ||
| 358 | - "assets/icon_wechat.png", width: ScreenUtil().setWidth(140), | ||
| 359 | - height: ScreenUtil().setWidth(140),), | ||
| 360 | - Text("微信", style: TextStyle(color: MyColours.color_353535, | ||
| 361 | - fontSize: ScreenUtil().setSp(32)),) | ||
| 362 | - ], | 413 | + return showModalBottomSheet( |
| 414 | + context: context, | ||
| 415 | + builder: (context) { | ||
| 416 | + Widget widget = Container( | ||
| 417 | + width: double.infinity, | ||
| 418 | + height: ScreenUtil().setHeight(233), | ||
| 419 | + color: MyColours.color_f1f1f1, | ||
| 420 | + child: Row( | ||
| 421 | + children: <Widget>[ | ||
| 422 | + Expanded( | ||
| 423 | + child: GestureDetector( | ||
| 424 | + onTap: () { | ||
| 425 | + Navigator.of(context).pop(1); | ||
| 426 | + }, | ||
| 427 | + behavior: HitTestBehavior.opaque, | ||
| 428 | + child: Column( | ||
| 429 | + mainAxisSize: MainAxisSize.min, | ||
| 430 | + children: <Widget>[ | ||
| 431 | + Image.asset( | ||
| 432 | + "assets/icon_wechat.png", | ||
| 433 | + width: ScreenUtil().setWidth(140), | ||
| 434 | + height: ScreenUtil().setWidth(140), | ||
| 435 | + ), | ||
| 436 | + Text( | ||
| 437 | + "微信", | ||
| 438 | + style: TextStyle( | ||
| 439 | + color: MyColours.color_353535, | ||
| 440 | + fontSize: ScreenUtil().setSp(32)), | ||
| 441 | + ) | ||
| 442 | + ], | ||
| 443 | + ), | ||
| 444 | + ), | ||
| 363 | ), | 445 | ), |
| 364 | - ), | ||
| 365 | - ), | ||
| 366 | - Expanded( | ||
| 367 | - child: GestureDetector( | ||
| 368 | - onTap: (){ | ||
| 369 | - Navigator.of(context).pop(2); | ||
| 370 | - }, | ||
| 371 | - behavior: HitTestBehavior.opaque, | ||
| 372 | - child: Column( | ||
| 373 | - mainAxisSize: MainAxisSize.min, | ||
| 374 | - children: <Widget>[ | ||
| 375 | - Image.asset( | ||
| 376 | - "assets/icon_sms.png", width: ScreenUtil().setWidth(140), | ||
| 377 | - height: ScreenUtil().setWidth(140),), | ||
| 378 | - Text("短信", style: TextStyle(color: MyColours.color_353535, | ||
| 379 | - fontSize: ScreenUtil().setSp(32)),) | ||
| 380 | - ], | 446 | + Expanded( |
| 447 | + child: GestureDetector( | ||
| 448 | + onTap: () { | ||
| 449 | + Navigator.of(context).pop(2); | ||
| 450 | + }, | ||
| 451 | + behavior: HitTestBehavior.opaque, | ||
| 452 | + child: Column( | ||
| 453 | + mainAxisSize: MainAxisSize.min, | ||
| 454 | + children: <Widget>[ | ||
| 455 | + Image.asset( | ||
| 456 | + "assets/icon_sms.png", | ||
| 457 | + width: ScreenUtil().setWidth(140), | ||
| 458 | + height: ScreenUtil().setWidth(140), | ||
| 459 | + ), | ||
| 460 | + Text( | ||
| 461 | + "短信", | ||
| 462 | + style: TextStyle( | ||
| 463 | + color: MyColours.color_353535, | ||
| 464 | + fontSize: ScreenUtil().setSp(32)), | ||
| 465 | + ) | ||
| 466 | + ], | ||
| 467 | + ), | ||
| 468 | + ), | ||
| 381 | ), | 469 | ), |
| 382 | - ), | 470 | + Expanded( |
| 471 | + child: GestureDetector( | ||
| 472 | + onTap: () { | ||
| 473 | + Navigator.of(context).pop(3); | ||
| 474 | + }, | ||
| 475 | + behavior: HitTestBehavior.opaque, | ||
| 476 | + child: Column( | ||
| 477 | + mainAxisSize: MainAxisSize.min, | ||
| 478 | + children: <Widget>[ | ||
| 479 | + Image.asset( | ||
| 480 | + "assets/icon_phone.png", | ||
| 481 | + width: ScreenUtil().setWidth(140), | ||
| 482 | + height: ScreenUtil().setWidth(140), | ||
| 483 | + ), | ||
| 484 | + Text( | ||
| 485 | + "电话", | ||
| 486 | + style: TextStyle( | ||
| 487 | + color: MyColours.color_353535, | ||
| 488 | + fontSize: ScreenUtil().setSp(32)), | ||
| 489 | + ) | ||
| 490 | + ], | ||
| 491 | + ), | ||
| 492 | + ), | ||
| 493 | + ) | ||
| 494 | + ], | ||
| 383 | ), | 495 | ), |
| 384 | - Expanded( | ||
| 385 | - child: GestureDetector( | ||
| 386 | - onTap: (){ | ||
| 387 | - Navigator.of(context).pop(3); | ||
| 388 | - }, | ||
| 389 | - behavior: HitTestBehavior.opaque, | ||
| 390 | - child: Column( | ||
| 391 | - mainAxisSize: MainAxisSize.min, | ||
| 392 | - children: <Widget>[ | ||
| 393 | - Image.asset( | ||
| 394 | - "assets/icon_phone.png", width: ScreenUtil().setWidth(140), | ||
| 395 | - height: ScreenUtil().setWidth(140),), | ||
| 396 | - Text("电话", style: TextStyle(color: MyColours.color_353535, | ||
| 397 | - fontSize: ScreenUtil().setSp(32)),) | ||
| 398 | - ], | ||
| 399 | - ), | ||
| 400 | - ), | ||
| 401 | - ) | ||
| 402 | - ], | ||
| 403 | - ), | ||
| 404 | - ); | ||
| 405 | - return widget; | ||
| 406 | - }); | 496 | + ); |
| 497 | + return widget; | ||
| 498 | + }); | ||
| 407 | } | 499 | } |
| 408 | 500 | ||
| 409 | //显示选择客户经理弹框 | 501 | //显示选择客户经理弹框 |
| 410 | - static Future<List<int>> showSelectCusmanDialog(BuildContext context,List<String> data,ValueChanged valueChanged){ | 502 | + static Future<List<int>> showSelectCusmanDialog( |
| 503 | + BuildContext context, List<String> data, ValueChanged valueChanged) { | ||
| 411 | return Picker( | 504 | return Picker( |
| 412 | adapter: PickerDataAdapter<String>(pickerdata: data), | 505 | adapter: PickerDataAdapter<String>(pickerdata: data), |
| 413 | hideHeader: false, | 506 | hideHeader: false, |
| 414 | cancelText: "取消", | 507 | cancelText: "取消", |
| 415 | - cancelTextStyle: TextStyle(color: MyColours.color_828282,fontSize: 20), | 508 | + cancelTextStyle: TextStyle(color: MyColours.color_828282, fontSize: 20), |
| 416 | confirmText: "确定", | 509 | confirmText: "确定", |
| 417 | - confirmTextStyle: TextStyle(color: MyColours.color_2bb5b7,fontSize: 20), | 510 | + confirmTextStyle: |
| 511 | + TextStyle(color: MyColours.color_2bb5b7, fontSize: 20), | ||
| 418 | selectedTextStyle: TextStyle(color: Colors.blue), | 512 | selectedTextStyle: TextStyle(color: Colors.blue), |
| 419 | onConfirm: (Picker picker, List value) { | 513 | onConfirm: (Picker picker, List value) { |
| 420 | print(value.toString()); | 514 | print(value.toString()); |
| 421 | - if(valueChanged!=null){ | 515 | + if (valueChanged != null) { |
| 422 | valueChanged(value); | 516 | valueChanged(value); |
| 423 | } | 517 | } |
| 424 | - } | ||
| 425 | - ).showModal<List<int>>(context).then((value){ | 518 | + }).showModal<List<int>>(context).then((value) { |
| 426 | LogUtil.v("value:${value.toString()}"); | 519 | LogUtil.v("value:${value.toString()}"); |
| 427 | return value; | 520 | return value; |
| 428 | }); | 521 | }); |
-
Please register or login to post a comment