Skip to content

Commit fbc8114

Browse files
Update sample and dependency
1 parent a9fdbdb commit fbc8114

File tree

89 files changed

+1928
-637
lines changed

Some content is hidden

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

89 files changed

+1928
-637
lines changed

android/.gitignore

+13
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

android/app/build.gradle

+20-44
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,44 @@
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'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
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"
226
}
237

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
29-
compileSdkVersion 30
9+
namespace = "com.example.myflutterapp"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3012

3113
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
3416
}
3517

3618
kotlinOptions {
37-
jvmTarget = '1.8'
38-
}
39-
40-
sourceSets {
41-
main.java.srcDirs += 'src/main/kotlin'
19+
jvmTarget = JavaVersion.VERSION_1_8
4220
}
4321

4422
defaultConfig {
4523
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "com.example.myflutterapp"
47-
minSdkVersion 16
48-
targetSdkVersion 30
49-
versionCode flutterVersionCode.toInteger()
50-
versionName flutterVersionName
24+
applicationId = "com.example.myflutterapp"
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 = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
5131
}
5232

5333
buildTypes {
5434
release {
5535
// TODO: Add your own signing config for the release build.
5636
// Signing with the debug keys for now, so `flutter run --release` works.
57-
signingConfig signingConfigs.debug
37+
signingConfig = signingConfigs.debug
5838
}
5939
}
6040
}
6141

6242
flutter {
63-
source '../..'
64-
}
65-
66-
dependencies {
67-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
43+
source = "../.."
6844
}

android/app/src/debug/AndroidManifest.xml

+3-3
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.myflutterapp">
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"/>
+16-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.myflutterapp">
3-
<application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
43
android:label="myflutterapp"
4+
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity
77
android:name=".MainActivity"
8+
android:exported="true"
89
android:launchMode="singleTop"
10+
android:taskAffinity=""
911
android:theme="@style/LaunchTheme"
1012
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1113
android:hardwareAccelerated="true"
@@ -18,15 +20,6 @@
1820
android:name="io.flutter.embedding.android.NormalTheme"
1921
android:resource="@style/NormalTheme"
2022
/>
21-
<!-- Displays an Android View that continues showing the launch screen
22-
Drawable until Flutter paints its first frame, then this splash
23-
screen fades out. A splash screen is useful to avoid any visual
24-
gap between the end of Android's launch screen and the painting of
25-
Flutter's first frame. -->
26-
<meta-data
27-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
28-
android:resource="@drawable/launch_background"
29-
/>
3023
<intent-filter>
3124
<action android:name="android.intent.action.MAIN"/>
3225
<category android:name="android.intent.category.LAUNCHER"/>
@@ -38,4 +31,15 @@
3831
android:name="flutterEmbedding"
3932
android:value="2" />
4033
</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>
4145
</manifest>

android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

-18
This file was deleted.

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package com.example.myflutterapp
22

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

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
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.
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1515
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
1616
<item name="android:windowBackground">?android:colorBackground</item>

android/app/src/main/res/values/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Light.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.
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1515
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
1616
<item name="android:windowBackground">?android:colorBackground</item>

android/app/src/profile/AndroidManifest.xml

+3-3
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.myflutterapp">
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"/>

android/build.gradle

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
buildscript {
2-
ext.kotlin_version = '1.3.50'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
196
}
207

21-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
229
subprojects {
2310
project.buildDir = "${rootProject.buildDir}/${project.name}"
24-
project.evaluationDependsOn(':app')
11+
}
12+
subprojects {
13+
project.evaluationDependsOn(":app")
2514
}
2615

27-
task clean(type: Delete) {
16+
tasks.register("clean", Delete) {
2817
delete rootProject.buildDir
2918
}

android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

android/local.properties

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
sdk.dir=C:\\Users\\ArulrajA\\AppData\\Local\\Android\\sdk
2-
flutter.sdk=C:\\src\\flutter
3-
flutter.buildMode=debug
4-
flutter.versionName=1.0.0
5-
flutter.versionCode=1
1+
sdk.dir=C:\\sdk\\android-sdk
2+
flutter.sdk=C:\\sdk\\flutter

android/settings.gradle

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
}
24+
25+
include ":app"

ios/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/dgph
2+
*.mode1v3
3+
*.mode2v3
4+
*.moved-aside
5+
*.pbxuser
6+
*.perspectivev3
7+
**/*sync/
8+
.sconsign.dblite
9+
.tags*
10+
**/.vagrant/
11+
**/DerivedData/
12+
Icon?
13+
**/Pods/
14+
**/.symlinks/
15+
profile
16+
xcuserdata
17+
**/.generated/
18+
Flutter/App.framework
19+
Flutter/Flutter.framework
20+
Flutter/Flutter.podspec
21+
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
23+
Flutter/app.flx
24+
Flutter/app.zip
25+
Flutter/flutter_assets/
26+
Flutter/flutter_export_environment.sh
27+
ServiceDefinitions.json
28+
Runner/GeneratedPluginRegistrant.*
29+
30+
# Exceptions to above rules.
31+
!default.mode1v3
32+
!default.mode2v3
33+
!default.pbxuser
34+
!default.perspectivev3

ios/Flutter/AppFrameworkInfo.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

ios/Flutter/Generated.xcconfig

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// This is a generated file; do not edit or check into version control.
2-
FLUTTER_ROOT=C:\src\flutter
3-
FLUTTER_APPLICATION_PATH=C:\Users\ArulrajA\Desktop\Samples\myflutterapp
2+
FLUTTER_ROOT=C:\sdk\flutter
3+
FLUTTER_APPLICATION_PATH=C:\Users\ImmanKumarPPalanikum\Desktop\GitHub\z\how-to-add-a-flutter-pdfviewer-widget-to-a-flutter-app\myflutterapp
44
COCOAPODS_PARALLEL_CODE_SIGN=true
55
FLUTTER_TARGET=lib\main.dart
66
FLUTTER_BUILD_DIR=build
7-
SYMROOT=${SOURCE_ROOT}/../build\ios
87
FLUTTER_BUILD_NAME=1.0.0
98
FLUTTER_BUILD_NUMBER=1
10-
EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64 i386
9+
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
10+
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
1111
DART_OBFUSCATION=false
12-
TRACK_WIDGET_CREATION=false
12+
TRACK_WIDGET_CREATION=true
1313
TREE_SHAKE_ICONS=false
14-
PACKAGE_CONFIG=.packages
14+
PACKAGE_CONFIG=.dart_tool/package_config.json

0 commit comments

Comments
 (0)