Skip to content

Commit 4a9d883

Browse files
authored
Merge pull request #95 from firebase/mtewani/sample-changes
Created FDC Quickstart
2 parents 58f92d3 + 4bdd4b5 commit 4a9d883

File tree

181 files changed

+11203
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+11203
-0
lines changed

.firebase/.graphqlrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"schema":["../dataconnect/schema/**/*.gql","../dataconnect/.dataconnect/**/*.gql"],"document":["../dataconnect/connector/**/*.gql"]}

data_connect/.firebase/.graphqlrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"schema":["../dataconnect/schema/**/*.gql","../dataconnect/.dataconnect/**/*.gql"],"document":["../dataconnect/connector/**/*.gql"]}

data_connect/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
**/ios/Flutter/.last_build_id
29+
.dart_tool/
30+
.flutter-plugins
31+
.flutter-plugins-dependencies
32+
.pub-cache/
33+
.pub/
34+
/build/
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release

data_connect/.metadata

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "603104015dd692ea3403755b55d07813d5cf8965"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
17+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
18+
- platform: android
19+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
20+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
21+
- platform: ios
22+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
23+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
24+
- platform: linux
25+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
26+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
27+
- platform: macos
28+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
29+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
30+
- platform: web
31+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
32+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
33+
- platform: windows
34+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
35+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

data_connect/.vscode/launch.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "dataconnect",
9+
"request": "launch",
10+
"type": "dart"
11+
},
12+
{
13+
"name": "dataconnect (profile mode)",
14+
"request": "launch",
15+
"type": "dart",
16+
"flutterMode": "profile"
17+
},
18+
{
19+
"name": "dataconnect (release mode)",
20+
"request": "launch",
21+
"type": "dart",
22+
"flutterMode": "release"
23+
}
24+
]
25+
}

data_connect/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Firebase Data Connect Quickstart
2+
3+
## Introduction
4+
5+
This quickstart is a movie review app to demonstrate the use of Firebase Data Connect with a Cloud SQL database. For more information about Firebase Data Connect visit [the docs](https://firebase.google.com/docs/data-connect/).
6+
7+
8+
## Getting Started
9+
10+
Follow these steps to get up and running with Firebase Data Connect. For more detailed instructions, check out the [official documentation](https://firebase.google.com/docs/data-connect/quickstart).
11+
12+
### 0. Prerequisites
13+
- Flutter 3.5.3 or above
14+
- Latest version of [Visual Studio Code](https://code.visualstudio.com/)
15+
- The [Firebase Data Connect VS Code Extension](https://marketplace.visualstudio.com/items?itemName=GoogleCloudTools.firebase-dataconnect-vscode)
16+
17+
### 1. Connect to your Firebase project
18+
19+
1. If you haven't already, create a Firebase project.
20+
1. In the [Firebase console](https://console.firebase.google.com), click
21+
**Add project**, then follow the on-screen instructions.
22+
2. Install flutterfire:
23+
```sh
24+
dart pub global activate flutterfire_cli
25+
```
26+
### 2. Cloning the repository
27+
28+
1. Clone this repository to your local machine:
29+
```sh
30+
git clone https://github.com/firebase/quickstart-flutter.git
31+
```
32+
2. Configure flutterfire
33+
This will automatically download and set up firebase for your project:
34+
```sh
35+
flutterfire configure -y -a com.example.dataconnect
36+
```
37+
38+
39+
### 3. Open in Visual Studio Code (VS Code)
40+
41+
1. Open the `quickstart-flutter/dataconnect` directory in VS Code.
42+
2. Click on the Firebase Data Connect icon on the VS Code sidebar to load the Extension.
43+
a. Sign in with your Google Account if you haven't already.
44+
3. Click on "Connect a Firebase project" and choose the project where you have set up Data Connect.
45+
4. Click on "Start Emulators" - this should generate the Kotlin SDK for you and start the emulators.
46+
47+
### 4. Populate the database
48+
In VS Code, open the `quickstart-flutter/dataconnect/dataconnect/moviedata_insert.gql` file and click the
49+
`Run (local)` button at the top of the file.
50+
51+
If you’d like to confirm that the data was correctly inserted,
52+
open `quickstart-flutter/dataconnect/movie-connector/queries.gql` and run the `ListMovies` query.
53+
54+
### 5. Running the app
55+
56+
Press the Run button in VS Code to run the sample app on your device.

data_connect/analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
analyzer:
12+
exclude:
13+
lib/movies_connector/**
14+
linter:
15+
# The lint rules applied to this project can be customized in the
16+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
17+
# included above or to enable additional rules. A list of all available lints
18+
# and their documentation is published at https://dart.dev/lints.
19+
#
20+
# Instead of disabling a lint rule for the entire project in the
21+
# section below, it can also be suppressed for a single line of code
22+
# or a specific dart file by using the `// ignore: name_of_lint` and
23+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
24+
# producing the lint.
25+
rules:
26+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
27+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
28+
29+
# Additional information about this file can be found at
30+
# https://dart.dev/guides/language/analysis-options

data_connect/android/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/to/reference-keystore
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id "com.android.application"
3+
// START: FlutterFire Configuration
4+
id 'com.google.gms.google-services'
5+
// END: FlutterFire Configuration
6+
id "kotlin-android"
7+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
8+
id "dev.flutter.flutter-gradle-plugin"
9+
}
10+
11+
android {
12+
namespace = "com.example.dataconnect"
13+
compileSdk = flutter.compileSdkVersion
14+
ndkVersion = flutter.ndkVersion
15+
16+
compileOptions {
17+
sourceCompatibility = JavaVersion.VERSION_1_8
18+
targetCompatibility = JavaVersion.VERSION_1_8
19+
}
20+
21+
kotlinOptions {
22+
jvmTarget = JavaVersion.VERSION_1_8
23+
}
24+
25+
defaultConfig {
26+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
27+
applicationId = "com.example.dataconnect"
28+
// You can update the following values to match your application needs.
29+
// For more information, see: https://flutter.dev/to/review-gradle-config.
30+
minSdk = 23
31+
targetSdk = flutter.targetSdkVersion
32+
versionCode = flutter.versionCode
33+
versionName = flutter.versionName
34+
}
35+
36+
buildTypes {
37+
release {
38+
// TODO: Add your own signing config for the release build.
39+
// Signing with the debug keys for now, so `flutter run --release` works.
40+
signingConfig = signingConfigs.debug
41+
}
42+
}
43+
}
44+
45+
flutter {
46+
source = "../.."
47+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>

0 commit comments

Comments
 (0)