Turn and if != null into an elvis operator (#9190)
This commit is contained in:
parent
20e214fa71
commit
dcd3833455
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user