flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.32k stars 27.28k forks source link

assertion failure #155953

Open rohanfalcon opened 6 days ago

rohanfalcon commented 6 days ago

Steps to reproduce

@override
    build(BuildContext context) {
      return Scaffold(
        body: Center (
          child: FutureBuilder<String> (
            future:  _onValidate(context) ,
            builder: (context,snapshot) {
              if (snapshot.connectionState == ConnectionState.waiting) {
                return const CircularProgressIndicator(); // Loading indicator
              } else if (snapshot.hasError) {
                return Text('Error: ${snapshot.error}');
              } else {
                return Text(snapshot.data ?? 'No data'); // Display the data
              }
            }

Expected results

New widget to be launched from a future

Actual results

error after widget launched

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console [Paste your output here] ```
darshankawar commented 6 days ago

@rohanfalcon What assertion failure are you getting ? Can you provide entire error log ? Also, provide complete runnable code sample along with flutter doctor -v.