Repository: flutter
Issue: CupertinoDatePicker in CupertinoDatePickerMode.date mode respects time while compare initialDateTime and minimumDate in assert
Labels: c: crash,framework,f: date/time picker,f: cupertino,a: quality,a: error message,has reproducible steps,P2,found in release: 3.3,found in release: 3.6,workaround available,team-design,triaged-design

CupertinoDatePicker in CupertinoDatePickerMode.date mode respects time while compare initialDateTime and minimumDate in assert.

I think that in this mode assert should compare just dates without time.

I ready to create PR with fix.

## Steps to Reproduce

1. Run `flutter create bug`.
2. Update `main.dart` as follows:

```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: CupertinoDatePicker(
          initialDateTime: DateTime(2020, 8, 8),
          minimumDate: DateTime(2020, 8, 8, 8),
          mode: CupertinoDatePickerMode.date,
          onDateTimeChanged: (_) {},
        ),
      ),
    );
  }
}
```

3. Run

**Expected results:**  working app

**Actual results:**  exception in assert of CupertinoDatePicker

```
The following assertion was thrown building MyApp(dirty):
initial date 2020-08-08 00:00:00.000 is not greater than or equal to minimumDate 2020-08-08
08:00:00.000
'package:flutter/src/cupertino/date_picker.dart':
Failed assertion: line 277 pos 7: 'mode != CupertinoDatePickerMode.date || minimumDate == null ||
!minimumDate.isAfter(this.initialDateTime)'

The relevant error-causing widget was:
  MyApp file:///Users/sanekyy/Projects/flutter/cupertino_date_picker_assert_bug/lib/main.dart:5:10
```

<details>
  <summary>Logs</summary>

```
Performing hot reload...
Syncing files to device Pixel 4 XL...

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building MyApp(dirty):
initial date 2020-08-08 00:00:00.000 is not greater than or equal to minimumDate 2020-08-08
08:00:00.000
'package:flutter/src/cupertino/date_picker.dart':
Failed assertion: line 277 pos 7: 'mode != CupertinoDatePickerMode.date || minimumDate == null ||
!minimumDate.isAfter(this.initialDateTime)'

The relevant error-causing widget was:
  MyApp file:///Users/sanekyy/Projects/flutter/cupertino_date_picker_assert_bug/lib/main.dart:5:10

When the exception was thrown, this was the stack:
#2      new CupertinoDatePicker (package:flutter/src/cupertino/date_picker.dart:277:7)
#3      MyApp.build (package:cupertino_date_picker_assert_bug/main.dart:13:15)
#4      StatelessElement.build (package:flutter/src/widgets/framework.dart:4631:28)
#5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4557:15)
#6      Element.rebuild (package:flutter/src/widgets/framework.dart:4273:5)
#7      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2667:33)
#8      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:880:20)
#9      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:286:5)
#10     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
#11     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1056:9)
#12     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:865:7)
(elided 6 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, and dart:async-patch)

════════════════════════════════════════════════════════════════════════════════════════════════════
Reloaded 0 of 521 libraries in 81ms.

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building MyApp(dirty):
initial date 2020-08-08 00:00:00.000 is not greater than or equal to minimumDate 2020-08-08 08:00:00.000
'package:flutter/src/cupertino/date_picker.dart':
Failed assertion: line 277 pos 7: 'mode != CupertinoDatePickerMode.date || minimumDate == null || !minimumDate.isAfter(this.initialDateTime)'

The relevant error-causing widget was: 
  MyApp file:///Users/sanekyy/Projects/flutter/cupertino_date_picker_assert_bug/lib/main.dart:5:10
When the exception was thrown, this was the stack: 
#2      new CupertinoDatePicker (package:flutter/src/cupertino/date_picker.dart:277:7)
#3      MyApp.build (package:cupertino_date_picker_assert_bug/main.dart:13:15)
#4      StatelessElement.build (package:flutter/src/widgets/framework.dart:4631:28)
#5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4557:15)
#6      Element.rebuild (package:flutter/src/widgets/framework.dart:4273:5)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

```

```
flutter analyze
Analyzing cupertino_date_picker_assert_bug...                           
No issues found! (ran in 2.2s)

```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G73, locale en-RU)
    • Flutter version 1.21.0-1.0.pre at /Users/sanekyy/Programs/flutter
    • Framework revision f25bd9c55c (3 weeks ago), 2020-07-14 20:26:01 -0400
    • Engine revision 99c2b3a245
    • Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/sanekyy/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • ANDROID_HOME = /Users/sanekyy/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/sanekyy/Library/Android/sdk
    • Java binary at: /Users/sanekyy/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Users/sanekyy/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.2)
    • IntelliJ at /Users/sanekyy/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 47.1.4
    • Dart plugin version 202.6397.47

[!] VS Code (version 1.47.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

 
[✓] Connected device (4 available)            
    • Pixel 4 XL (mobile) • 9C161FFBA001E2 • android-arm64  • Android 10 (API 29)
    • macOS (desktop)     • macos          • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)    • web-server     • web-javascript • Flutter Tools
    • Chrome (web)        • chrome         • web-javascript • Google Chrome 84.0.4147.105

! Doctor found issues in 1 category.
```

</details>