Repository: flutter
Issue: Async task is skipped when the assert fails
Labels: framework,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

I use [Firebase Core](https://pub.dartlang.org/packages/firebase_core#-readme-tab-) and spot one potential issue (maybe) about [FutureBuilder](https://docs.flutter.io/flutter/widgets/FutureBuilder-class.html) and [Firebase Core](https://pub.dartlang.org/packages/firebase_core#-readme-tab-) itself.

When async is combined with assert and it's used inside FutureBuilder, if the assert is not true, somehow the rest of the async task is skipped without notifying, and snapshot's connection state will be "done", here is my scripts

**Async with assert**
```dart
_test() async {
    assert(1 == 3);
    await Future.delayed(Duration(milliseconds: 1000));
    return "test";
  }

  getPrefs() async {
    print("before");
    print("_test => ${await _test()}");
    print("after");
  }

  @override
  Widget build(BuildContext context) {
    print("main executed!");
    return FutureBuilder(
      future: getPrefs(),
      builder: (BuildContext context, AsyncSnapshot snapshot) {
        switch (snapshot.connectionState) {
          case ConnectionState.active:
            print("Active!");
            break;
          case ConnectionState.none:
            print("None!");
            break;
          case ConnectionState.waiting:
            print("Waiting!");
            break;
          case ConnectionState.done:
            print("Done!");
            break;
          default:
            print("Default!");
        }
        return MaterialApp(
          home: Scaffold(body: Center(child: CircularProgressIndicator())),
        );
      },
    );
  }
```
will print
```
flutter: main executed!
flutter: before
flutter: Waiting!
flutter: Done!
```

**Async without assert**
```dart
_test() async {
    await Future.delayed(Duration(milliseconds: 1000));
    return "test";
  }

  getPrefs() async {
    print("before");
    print("_test => ${await _test()}");
    print("after");
  }

  @override
  Widget build(BuildContext context) {
    print("main executed!");
    return FutureBuilder(
      future: getPrefs(),
      builder: (BuildContext context, AsyncSnapshot snapshot) {
        switch (snapshot.connectionState) {
          case ConnectionState.active:
            print("Active!");
            break;
          case ConnectionState.none:
            print("None!");
            break;
          case ConnectionState.waiting:
            print("Waiting!");
            break;
          case ConnectionState.done:
            print("Done!");
            break;
          default:
            print("Default!");
        }
        return MaterialApp(
          home: Scaffold(body: Center(child: CircularProgressIndicator())),
        );
      },
    );
  }
```
will print
```
flutter: main executed!
flutter: before
flutter: Waiting!
flutter: _test => test
flutter: after
flutter: Done!
```

**Note**
- I called this a potential issue for `FutureBuilder`, because sure it is programmer's fault that the assert is occurred, but maybe in the future, it would be nice to have a log to notify us..