Create a new flutter app

  1. Create repository
  2. Initiate new app
    • flutter create --org com.yourdomain appname
  3. Initiate json-model
    • Setup standard Directories
      • fluttertool setupdirs
    • Design model with json
    • Convert json to dart-models
  4. Add Firebase Authentication
    • flutter pub add firebase_core See pub.dev
    • flutter pub add firebase_auth See pub.dev
  5. Add Firestore
    • flutter pub add uuid See pub.dev
    • flutter pub add cloud_firestore See pub.dev
    • flutter pub add firebase_storage See pub.dev
  6. Add Fire UI
    • flutter pub add flutterfire_ui See pub.dev

    • Sign app:

      • Do not alter, just write:
      • cd C:\Program Files\Android\Android Studio1\jre\bin
      • Create a key: keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64
      • keytool.exe -list -v \ -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore
      • Link: Authenticating Your Client
    • Convert via openssl

      • C:\openssl\bin\openssl.exe eller brug tomeko.net
  7. flutter pub upgrade to ensure and install all packages
  8. Setup setting
    • Go to \android/app/build.gradle and change "minSdkVersion" to 21
  9. SPLASH Screen
    • flutter pub add flutter_native_splash See pub.dev
  10. CORS
flutter_native_splash: # https://pub.dev/packages/flutter_native_splash
color: "#70d4e3"
branding: assets/logo.png
fullscreen: true
android_gravity: center_vertical
ios_content_mode: scaleToFill
* <code>flutter pub run flutter_native_splash:create</code>
  1. Register at firebase Firebare projects
  2. Register at facebook

Firebase configure

flutterfire configure

Riverpod generator

in pubspec.yaml

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

  # a tool for running code generators
  build_runner:  
  # the code generator
  riverpod_generator: ^2.2.3
  # riverpod_lint makes it easier to work with Riverpod
  riverpod_lint:
  # import custom_lint too as riverpod_lint depends on it
  custom_lint:

Google Bucket CORS

Gå til dashboard: Dachboard

Åben console: Kig efter lille knap øverst til højre der ser sårn her ud ">_".

Google: CORS configuration examples

Opret en json-fil, fx: <bucketid - exsite-c6bf0>_cors_file.json

Cmd: echo "[ { "origin": ["*"], "method": ["GET"], "maxAgeSeconds": 3600 }]" > <bucketid - exsite-c6bf0>_cors_file.json

Cmd: gcloud storage buckets update gs://<bucketid - exsite-c6bf0>.appspot.com --cors-file=<bucketid - exsite-c6bf0>_cors_file.json