no firebase app ' default ' has been created flutter
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
no firebase app ' default ' has been created flutter
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
no firebase app ' default ' has been created
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
var fsconnect = FirebaseFirestore.instance;
myget() async {
var d = await fsconnect.collection("students").get();
// print(d.docs[0].data());
for (var i in d.docs) {
print(i.data());
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Firebase Firestore App'),
),
body: Column(
children: <Widget>[
RaisedButton(
child: Text('send data'),
onPressed: () {
fsconnect.collection("students").add({
'name': 'sarah',
'title': 'xyz',
'email': '[email protected]',
});
print("send ..");
},
),
RaisedButton(
child: Text('get data'),
onPressed: () {
myget();
print("get data ...");
},
)
],
),
));
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us