Skip to content

Commit 9fbe7e2

Browse files
committed
feat: updated example app
1 parent f1937d0 commit 9fbe7e2

56 files changed

Lines changed: 737 additions & 328 deletions

Some content is hidden

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

example/.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.24.3"
3+
}

example/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ app.*.map.json
4444
/android/app/debug
4545
/android/app/profile
4646
/android/app/release
47+
48+
# FVM Version Cache
49+
.fvm/

example/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# phone_auth_handler_demo
1+
# Firebase Phone Auth Handler Demo
22

3-
Demo for the package firebase_phone_auth_handler on pub.dev
3+
Build the app and run it.
44

5-
## Getting Started
5+
## How to test the app
66

7-
This project is a starting point for a Flutter application.
8-
9-
A few resources to get you started if this is your first Flutter project:
10-
11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13-
14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
7+
To test the example app, you can use "+91 9999999999" as the phone number and "000000" as the OTP.

example/analysis_options.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ linter:
1313
# The lint rules applied to this project can be customized in the
1414
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
1515
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
16+
# and their documentation is published at https://dart.dev/lints.
1817
#
1918
# Instead of disabling a lint rule for the entire project in the
2019
# section below, it can also be suppressed for a single line of code
2120
# or a specific dart file by using the `// ignore: name_of_lint` and
2221
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
2322
# producing the lint.
2423
rules:
25-
prefer_single_quotes: true
2624
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
2726

2827
# Additional information about this file can be found at
2928
# https://dart.dev/guides/language/analysis-options

example/android/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gradle-wrapper.jar
77
GeneratedPluginRegistrant.java
88

99
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
10+
# See https://flutter.dev/to/reference-keystore
1111
key.properties
1212
**/*.keystore
1313
**/*.jks

example/android/app/build.gradle

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,53 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
176
}
187

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
22-
}
23-
24-
apply plugin: 'com.android.application'
25-
apply plugin: 'com.google.gms.google-services'
26-
apply plugin: 'kotlin-android'
27-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
28-
298
android {
30-
compileSdkVersion flutter.compileSdkVersion
9+
namespace = "com.example.phone_auth_handler_demo"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3112

3213
compileOptions {
33-
sourceCompatibility JavaVersion.VERSION_1_8
34-
targetCompatibility JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
3516
}
3617

3718
kotlinOptions {
38-
jvmTarget = '1.8'
39-
}
40-
41-
sourceSets {
42-
main.java.srcDirs += 'src/main/kotlin'
19+
jvmTarget = JavaVersion.VERSION_1_8
4320
}
4421

4522
defaultConfig {
4623
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47-
applicationId "com.example.phone_auth_handler_demo"
48-
minSdkVersion flutter.minSdkVersion
49-
targetSdkVersion flutter.targetSdkVersion
50-
versionCode flutterVersionCode.toInteger()
51-
versionName flutterVersionName
24+
applicationId = "com.example.phone_auth_handler_demo"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = 23
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
5231
}
5332

5433
buildTypes {
5534
release {
5635
// TODO: Add your own signing config for the release build.
5736
// Signing with the debug keys for now, so `flutter run --release` works.
58-
signingConfig signingConfigs.debug
37+
signingConfig = signingConfigs.debug
5938
}
6039
}
6140
}
6241

42+
flutter {
43+
source = "../.."
44+
}
45+
6346
dependencies {
6447
// Import the Firebase BoM
6548
implementation platform('com.google.firebase:firebase-bom:29.3.1')
6649

6750

6851
// Add the dependencies for the desired Firebase products
6952
// https://firebase.google.com/docs/android/setup#available-libraries
70-
}
71-
72-
flutter {
73-
source '../..'
74-
}
75-
76-
dependencies {
77-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
78-
}
53+
}

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.phone_auth_handler_demo">
3-
<!-- Flutter needs it to communicate with the running application
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
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>

example/android/app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.phone_auth_handler_demo">
3-
<application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
43
android:label="FirebasePhoneAuthHandler Demo"
54
android:name="${applicationName}"
65
android:icon="@mipmap/ic_launcher">
76
<activity
87
android:name=".MainActivity"
98
android:exported="true"
109
android:launchMode="singleTop"
10+
android:taskAffinity=""
1111
android:theme="@style/LaunchTheme"
1212
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1313
android:hardwareAccelerated="true"
@@ -31,4 +31,15 @@
3131
android:name="flutterEmbedding"
3232
android:value="2" />
3333
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
3445
</manifest>

example/android/app/src/main/kotlin/com/example/phone_auth_handler_demo/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package com.example.phone_auth_handler_demo
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity() {
6-
}
5+
class MainActivity: FlutterActivity()

example/android/app/src/main/res/values-night/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
</style>
99
<!-- Theme applied to the Android Window as soon as the process has started.

0 commit comments

Comments
 (0)