[READ-ONLY] Mirror of https://github.com/probablykasper/notifier. Android app for scheduling notifications
android app flutter notifications
0

Configure Feed

Select the types of activity you want to include in your feed.

Fixed date updates not rebuilding UI

Tried to do this in an earlier commit but for some reason the commit ended up being basically empty

Kasper (Jul 2, 2019, 12:26 AM +0200) b47c84c8 d63946a8

+7 -3
+7 -3
lib/views/notification_dialog.dart
··· 33 33 Future<void> _pickDateTime(BuildContext context, NotificationDialogModel model) async { 34 34 final themeModel = ScopedModel.of<ThemeModel>(context); 35 35 final firstDate = DateTime.now().subtract(Duration(days: 1)); 36 - var initialDateTime = DateTime.fromMillisecondsSinceEpoch(model.item['date']); 36 + DateTime initialDateTime = DateTime.fromMillisecondsSinceEpoch(model.item['date']); 37 37 if (initialDateTime.isBefore(firstDate)) { 38 38 initialDateTime = firstDate; 39 39 } ··· 74 74 pickedTime.minute, 75 75 ); 76 76 model.item['date'] = newDate.millisecondsSinceEpoch; 77 + model.rebuild(); 77 78 } 78 79 79 80 final GlobalKey<FormState> formKey = GlobalKey<FormState>(); ··· 208 209 ), 209 210 ), 210 211 onTap: () async { 212 + descriptionFocusNode.unfocus(); 211 213 print('[notifier] Selecting date'); 212 214 await _pickDateTime(context, model); 213 - model.rebuild(); 215 + final notificationItemModel = ScopedModel.of<NotificationDialogModel>(context); 216 + notificationItemModel.rebuild(); 214 217 }, 215 218 ), 216 - //* REPEAT 217 219 Container( 218 220 padding: EdgeInsets.symmetric(horizontal: 24), 219 221 child: Row( 220 222 children: <Widget>[ 223 + //* REPEAT 221 224 FormField( 222 225 initialValue: model.item['repeat'], 223 226 onSaved: (newValue) { ··· 270 273 return Text('every', style: TextStyle(fontSize: 15)); 271 274 } 272 275 })(), 276 + //* REPEAT EVERY 273 277 Container(width: 6), 274 278 (() { 275 279 if (model.item['repeat'] == 'never') {