First of all, this is the error that I encountered:
/C:/Users/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_auth_web-5.2.2/lib/firebase_auth_web.dart:92:45: Error: The argument type 'Future Function()' can't be assigned to the parameter type 'Future Function(App)?'.
Failed to compile application.
I am trying to run a flutter login application on web. I have pasted the required creditentials as on the web>index.html file. The main.dart file looks like this:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: "AIzaSyDZvxw2LXy05hLkcH_fpPWWa5RzwVlbQro",
projectId: "messageapp-acf7a",
messagingSenderId: "72207922701",
appId: "1:72207922701:web:d84fe3144a7f2de5dd4744"
),
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: SignupPage(),
);
}
}
The relevant parts of pubspec.yaml file is this:
name: frontend_msngr
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=2.19.2 <3.0.0'
dependencies:
flutter:
sdk: flutter
chat_bubbles:
firebase_core:
cupertino_icons: ^1.0.2
firebase_auth:
firebase_auth_web:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true```
Since,the file that got the error is lib/firebase_auth_web.dart , I don't know how I passed incorrect parameters (as suggested by the error).
I tried changing the versions a bitbut it didn't work for me.
Run
flutter pub upgrade --major-versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With