diff --git a/lib/spaces/spaceHome.dart b/lib/spaces/spaceHome.dart index 02723df..8eb415a 100644 --- a/lib/spaces/spaceHome.dart +++ b/lib/spaces/spaceHome.dart @@ -99,18 +99,14 @@ class _SpaceHomeState extends State { return Scaffold( body: GestureDetector( onTap: () { - var now = DateTime.now(); + var now = TimeOfDay.now(); + int startHour = 11; + int endHour = 14; - if (!(now - .difference( - DateTime(now.year, now.month, now.day, 11, 30)) - .inMinutes > - 0 && - now - .difference( - DateTime(now.year, now.month, now.day, 14, 30)) - .inMinutes < - 0)) { + if (now.hour == startHour && now.minute <= 30 || + now.hour < startHour || + now.hour == endHour && now.minute >= 30 || + now.hour >= endHour + 1) { _showNotRateTimeDialog(context); } else { Provider.of(context, listen: false)