Search code examples
flutterdartflutter-web

Method not found: 'guard'. return internals.guard(


i am new to flutter.when i run this code on flutter web this error occurs. .pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-1.0.7/lib/src/internals.dart:10:20:

some one help to get rid of the problem


Solution

  • If you updated your flutter sdk to Beta channel, Downgrade your flutter sdk to Stable Channel. Current stable version is 2.10.3

    Flutter downgrade command

    flutter downgrade v2.10.3
    

    and than

    Downgrade flutter to version 2.10.3
    ? [y|n]:
    Type y for Yes to confirm changes
    

    If the above method does'nt work try this

    cloud_firestore: ^3.1.13 
    cloud_firestore_web: ^2.6.13 
    

    add the above the packages to your pubspec.yaml file with updated version