From 261c30773881e28900c7a5cbc8a7bfd84c462585 Mon Sep 17 00:00:00 2001
From: Bhargav <46953122+bhargavraviya@users.noreply.github.com>
Date: Mon, 15 Sep 2025 21:16:12 +0530
Subject: [PATCH] example code upgrade flutter
---
example/.gitignore | 11 +--
example/.metadata | 10 +--
example/analysis_options.yaml | 28 -------
example/android/.gitignore | 3 +-
example/android/app/build.gradle | 68 ----------------
example/android/app/build.gradle.kts | 44 ++++++++++
.../android/app/src/debug/AndroidManifest.xml | 8 +-
.../android/app/src/main/AndroidManifest.xml | 43 +++++-----
.../com/simform/example/MainActivity.kt | 3 +-
.../app/src/main/res/values-night/styles.xml | 4 +-
.../app/src/main/res/values/styles.xml | 4 +-
.../app/src/profile/AndroidManifest.xml | 8 +-
example/android/build.gradle | 29 -------
example/android/build.gradle.kts | 24 ++++++
example/android/gradle.properties | 2 +-
.../gradle/wrapper/gradle-wrapper.properties | 3 +-
example/android/settings.gradle | 11 ---
example/android/settings.gradle.kts | 26 ++++++
example/lib/main.dart | 75 +++++++-----------
example/pubspec.yaml | 9 +--
example/test/widget_test.dart | 4 +-
example/web/favicon.png | Bin 793 -> 917 bytes
example/web/icons/Icon-192.png | Bin 26882 -> 5292 bytes
example/web/icons/Icon-512.png | Bin 130449 -> 8252 bytes
example/web/icons/Icon-maskable-192.png | Bin 26882 -> 5594 bytes
example/web/icons/Icon-maskable-512.png | Bin 130449 -> 20998 bytes
example/web/index.html | 27 +------
example/web/manifest.json | 2 +-
28 files changed, 180 insertions(+), 266 deletions(-)
delete mode 100644 example/android/app/build.gradle
create mode 100644 example/android/app/build.gradle.kts
delete mode 100644 example/android/build.gradle
create mode 100644 example/android/build.gradle.kts
delete mode 100644 example/android/settings.gradle
create mode 100644 example/android/settings.gradle.kts
diff --git a/example/.gitignore b/example/.gitignore
index e57dbe60..3820a95c 100644
--- a/example/.gitignore
+++ b/example/.gitignore
@@ -5,9 +5,12 @@
*.swp
.DS_Store
.atom/
+.build/
.buildlog/
.history
.svn/
+.swiftpm/
+migrate_working_dir/
# IntelliJ related
*.iml
@@ -24,14 +27,11 @@
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
-.flutter-plugins
.flutter-plugins-dependencies
-.packages
.pub-cache/
.pub/
/build/
-
-# Web related
+/coverage/
# Symbolication related
app.*.symbols
@@ -43,6 +43,3 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
-
-# IOS files
-ios/Podfile.lock
diff --git a/example/.metadata b/example/.metadata
index bcd1a600..8c395df3 100644
--- a/example/.metadata
+++ b/example/.metadata
@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: "78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9"
+ revision: "a402d9a4376add5bc2d6b1e33e53edaae58c07f8"
channel: "stable"
project_type: app
@@ -13,11 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: 78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9
- base_revision: 78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9
+ create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
+ base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
- platform: web
- create_revision: 78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9
- base_revision: 78666c8dc57e9f7548ca9f8dd0740fbf0c658dc9
+ create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
+ base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
# User provided section
diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml
index 61b6c4de..f9b30346 100644
--- a/example/analysis_options.yaml
+++ b/example/analysis_options.yaml
@@ -1,29 +1 @@
-# This file configures the analyzer, which statically analyzes Dart code to
-# check for errors, warnings, and lints.
-#
-# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
-# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
-# invoked from the command line by running `flutter analyze`.
-
-# The following line activates a set of recommended lints for Flutter apps,
-# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
-
-linter:
- # The lint rules applied to this project can be customized in the
- # section below to disable rules from the `package:flutter_lints/flutter.yaml`
- # included above or to enable additional rules. A list of all available lints
- # and their documentation is published at
- # https://dart-lang.github.io/linter/lints/index.html.
- #
- # Instead of disabling a lint rule for the entire project in the
- # section below, it can also be suppressed for a single line of code
- # or a specific dart file by using the `// ignore: name_of_lint` and
- # `// ignore_for_file: name_of_lint` syntax on the line or in the file
- # producing the lint.
- rules:
- # avoid_print: false # Uncomment to disable the `avoid_print` rule
- # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
-# Additional information about this file can be found at
-# https://dart.dev/guides/language/analysis-options
diff --git a/example/android/.gitignore b/example/android/.gitignore
index 6f568019..be3943c9 100644
--- a/example/android/.gitignore
+++ b/example/android/.gitignore
@@ -5,9 +5,10 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
+.cxx/
# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
deleted file mode 100644
index b130996b..00000000
--- a/example/android/app/build.gradle
+++ /dev/null
@@ -1,68 +0,0 @@
-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
- throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
-
-apply plugin: 'com.android.application'
-apply plugin: 'kotlin-android'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
-
-android {
- compileSdkVersion 34
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- kotlinOptions {
- jvmTarget = '1.8'
- }
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
-
- defaultConfig {
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.simform.example"
- minSdkVersion 21
- targetSdkVersion 33
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- }
-
- buildTypes {
- release {
- // TODO: Add your own signing config for the release build.
- // Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig signingConfigs.debug
- }
- }
-}
-
-flutter {
- source '../..'
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts
new file mode 100644
index 00000000..c16095fa
--- /dev/null
+++ b/example/android/app/build.gradle.kts
@@ -0,0 +1,44 @@
+plugins {
+ id("com.android.application")
+ id("kotlin-android")
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id("dev.flutter.flutter-gradle-plugin")
+}
+
+android {
+ namespace = "com.simform.example"
+ compileSdk = flutter.compileSdkVersion
+ ndkVersion = flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
+ }
+
+ kotlinOptions {
+ jvmTarget = JavaVersion.VERSION_11.toString()
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId = "com.simform.example"
+ // You can update the following values to match your application needs.
+ // For more information, see: https://flutter.dev/to/review-gradle-config.
+ minSdk = flutter.minSdkVersion
+ targetSdk = flutter.targetSdkVersion
+ versionCode = flutter.versionCode
+ versionName = flutter.versionName
+ }
+
+ buildTypes {
+ release {
+ // TODO: Add your own signing config for the release build.
+ // Signing with the debug keys for now, so `flutter run --release` works.
+ signingConfig = signingConfigs.getByName("debug")
+ }
+ }
+}
+
+flutter {
+ source = "../.."
+}
diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml
index 5f768db8..399f6981 100644
--- a/example/android/app/src/debug/AndroidManifest.xml
+++ b/example/android/app/src/debug/AndroidManifest.xml
@@ -1,7 +1,7 @@
-
-
-
+
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 120ee706..ffea9244 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -1,20 +1,13 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
@@ -47,4 +31,23 @@
android:name="flutterEmbedding"
android:value="2" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/kotlin/com/simform/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/simform/example/MainActivity.kt
index bff659de..62f33af8 100644
--- a/example/android/app/src/main/kotlin/com/simform/example/MainActivity.kt
+++ b/example/android/app/src/main/kotlin/com/simform/example/MainActivity.kt
@@ -2,5 +2,4 @@ package com.simform.example
import io.flutter.embedding.android.FlutterActivity
-class MainActivity: FlutterActivity() {
-}
+class MainActivity : FlutterActivity()
diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml
index 449a9f93..06952be7 100644
--- a/example/android/app/src/main/res/values-night/styles.xml
+++ b/example/android/app/src/main/res/values-night/styles.xml
@@ -3,14 +3,14 @@