Turn and if != null into an elvis operator (#9190)

This commit is contained in:
Ian Hickson 2017-04-04 17:20:43 -07:00 committed by GitHub
parent 20e214fa71
commit dcd3833455

View File

@ -389,8 +389,7 @@ class _MonthPickerState extends State<MonthPicker> {
final DateTime tomorrow = new DateTime(_todayDate.year, _todayDate.month, _todayDate.day + 1); final DateTime tomorrow = new DateTime(_todayDate.year, _todayDate.month, _todayDate.day + 1);
Duration timeUntilTomorrow = tomorrow.difference(_todayDate); Duration timeUntilTomorrow = tomorrow.difference(_todayDate);
timeUntilTomorrow += const Duration(seconds: 1); // so we don't miss it by rounding timeUntilTomorrow += const Duration(seconds: 1); // so we don't miss it by rounding
if (_timer != null) _timer?.cancel();
_timer.cancel();
_timer = new Timer(timeUntilTomorrow, () { _timer = new Timer(timeUntilTomorrow, () {
setState(() { setState(() {
_updateCurrentDate(); _updateCurrentDate();