cricket team
a flutter application that demonstrate simple crud operations with firebase cloud database.
cricket team
preview
home | empty | swipe |
---|---|---|
add player | update player |
---|---|
add firebase to your app
- create a firebase project. check out the firebase documentation for setting up the firebase in your flutter application.
- create a new firebase console project
- add cloud firestore to the project in the pubspec.yaml
- drop the created google-services.json in android/app
gradles
changes to the android/build.gradle:
buildscript {
repositories {
...
}
dependencies {
...
classpath 'com.google.gms:google-services:3.2.1' // google services plugin
}
}
and then we have the android/app/build.gradle:
//bottom of file
apply plugin: 'com.google.gms.google-services'
ios cocoapods
google services use cocoapods to install and manage dependencies. open a terminal window and navigate to the location of the xcode project for your app.
- create a podfile if you don’t have one:
pod init
- open your podfile and add:
pod 'firebase/core'
- save the file and run:
pod install
- add initialization code
import uikit
import firebase // import the firebase
@uiapplicationmain
class appdelegate: uiresponder, uiapplicationdelegate {
var window: uiwindow?
func application(_ application: uiapplication,
didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?)
-> bool {
firebaseapp.configure() //configure the firebase
return true
}
}
getting started
this project is a starting point for a flutter application.
a few resources to get you started if this is your first flutter project:
for help getting started with flutter, view our
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full api reference.
Comments are closed.