From a08095f0cd0ceb87c841d0cda7ebd2fb0a8772e7 Mon Sep 17 00:00:00 2001 From: Apoorv_Wadhwa Date: Tue, 15 Nov 2022 22:00:45 +0530 Subject: [PATCH 1/2] android v2 embedding added, project migrated to androidx --- android/app/build.gradle | 6 +- android/app/src/main/AndroidManifest.xml | 18 ++- .../flipkart_flutter_ui/MainActivity.java | 10 +- android/app/src/main/res/values/styles.xml | 6 + android/build.gradle | 2 +- android/gradle.properties | 2 + ios/Flutter/flutter_export_environment.sh | 13 +- pubspec.lock | 116 ++++++------------ 8 files changed, 73 insertions(+), 100 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index bfb917a..c9ff2ab 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,7 +38,7 @@ android { targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -56,6 +56,6 @@ flutter { dependencies { testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test:runner:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9cd5b2a..8f9f42c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ FlutterApplication and put your custom class here. --> @@ -19,17 +19,27 @@ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> + + + + + - + diff --git a/android/app/src/main/java/com/example/flipkart_flutter_ui/MainActivity.java b/android/app/src/main/java/com/example/flipkart_flutter_ui/MainActivity.java index 2b3806a..7652d32 100644 --- a/android/app/src/main/java/com/example/flipkart_flutter_ui/MainActivity.java +++ b/android/app/src/main/java/com/example/flipkart_flutter_ui/MainActivity.java @@ -1,13 +1,7 @@ package com.example.flipkart_flutter_ui; -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; +import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } + } diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 00fa441..8120dda 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -5,4 +5,10 @@ Flutter draws its first frame --> @drawable/launch_background + + + + diff --git a/android/build.gradle b/android/build.gradle index bb8a303..541636c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.0' } } diff --git a/android/gradle.properties b/android/gradle.properties index 7be3d8b..38c8d45 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,2 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index c743a0a..2ea9adc 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,10 +1,13 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/home/shivanchal/flutter" -export "FLUTTER_APPLICATION_PATH=/home/shivanchal/projects_flutter/flutter_Flipkart_UI_clone_original" -export "FLUTTER_TARGET=lib/main.dart" +export "FLUTTER_ROOT=D:\Flutter\Flutter-3.0.5\flutter" +export "FLUTTER_APPLICATION_PATH=D:\work\flutter_ecommerce_UI_clone" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" -export "SYMROOT=${SOURCE_ROOT}/../build/ios" -export "FLUTTER_FRAMEWORK_DIR=/home/shivanchal/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/pubspec.lock b/pubspec.lock index a48c6ef..03c8537 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,62 +1,48 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" - charcode: + version: "2.1.0" + characters: dependency: transitive description: - name: charcode + name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" - collection: + version: "1.2.0" + charcode: dependency: transitive description: - name: collection + name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" - convert: + version: "1.3.1" + clock: dependency: transitive description: - name: convert + name: clock url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - crypto: + version: "1.1.0" + collection: dependency: transitive description: - name: crypto + name: collection url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -64,6 +50,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -74,55 +67,34 @@ packages: description: flutter source: sdk version: "0.0.0" - image: + matcher: dependency: transitive description: - name: image + name: matcher url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" - matcher: + version: "0.12.11" + material_color_utilities: dependency: transitive description: - name: matcher + name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.7.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -134,62 +106,48 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" + version: "2.1.2" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" From b1282930451791c3ceb7db9f4e53b04a9777d936 Mon Sep 17 00:00:00 2001 From: Apoorv_Wadhwa Date: Wed, 16 Nov 2022 15:28:06 +0530 Subject: [PATCH 2/2] dart analyser cleared --- lib/main.dart | 4 ++-- lib/src/Constant/Constant.dart | 4 ++-- lib/src/splash/splash_screens.dart | 3 +-- lib/src/ui/widgets/DealsOfTheDay.dart | 2 +- lib/src/ui/widgets/Drawerfile.dart | 3 +-- lib/src/ui/widgets/DualCameraPhones.dart | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 6d32c46..0d4407b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,8 +15,8 @@ class MyApp extends StatelessWidget { primaryColor: Color(0xff2874F0), ), routes: { - SPLASH_SCREEN: (BuildContext context)=> AnimatedSplashScreen(), - HOME_SCREEN: (BuildContext context)=> HomePage(), + splashScreen: (BuildContext context)=> AnimatedSplashScreen(), + homeScreen: (BuildContext context)=> HomePage(), }, home: AnimatedSplashScreen(), ); diff --git a/lib/src/Constant/Constant.dart b/lib/src/Constant/Constant.dart index 5277f3d..6929dbd 100644 --- a/lib/src/Constant/Constant.dart +++ b/lib/src/Constant/Constant.dart @@ -1,2 +1,2 @@ -String SPLASH_SCREEN = '/AnimatedSplashScreen', - HOME_SCREEN='/HomePage'; \ No newline at end of file +String splashScreen = '/AnimatedSplashScreen', + homeScreen='/HomePage'; \ No newline at end of file diff --git a/lib/src/splash/splash_screens.dart b/lib/src/splash/splash_screens.dart index e6441d8..f3cabd9 100644 --- a/lib/src/splash/splash_screens.dart +++ b/lib/src/splash/splash_screens.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flipkart_flutter_ui/src/Constant/Constant.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AnimatedSplashScreen extends StatefulWidget { @@ -22,7 +21,7 @@ class SplashScreenState extends State } void navigationPage() { - Navigator.of(context).pushReplacementNamed(HOME_SCREEN); + Navigator.of(context).pushReplacementNamed(homeScreen); } @override diff --git a/lib/src/ui/widgets/DealsOfTheDay.dart b/lib/src/ui/widgets/DealsOfTheDay.dart index 696b68c..fe978b7 100644 --- a/lib/src/ui/widgets/DealsOfTheDay.dart +++ b/lib/src/ui/widgets/DealsOfTheDay.dart @@ -16,7 +16,7 @@ class _FourthlistState extends State { } addDealItem() { - deal = List(); + deal = []; deal.add(deals( "assets/female.png", 'Dresses & Tops', diff --git a/lib/src/ui/widgets/Drawerfile.dart b/lib/src/ui/widgets/Drawerfile.dart index a173edf..3900b60 100644 --- a/lib/src/ui/widgets/Drawerfile.dart +++ b/lib/src/ui/widgets/Drawerfile.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'Drawerfile.dart'; class Drawerfile extends StatefulWidget { @override @@ -17,7 +16,7 @@ class _DrawerfileState extends State { } addDrawerItem() { - drawerItemModel = List(); + drawerItemModel = []; drawerItemModel.add(DrawerItemModel("Flutter Devs Plus Zone", "https://rukminim1.flixcart.com/www/50/50/promos/11/07/2018/70e5346e-fce4-4718-8e56-27be8492faa5.png?q=80")); drawerItemModel.add(DrawerItemModel("Electronics", diff --git a/lib/src/ui/widgets/DualCameraPhones.dart b/lib/src/ui/widgets/DualCameraPhones.dart index 5a404e3..e5764e1 100644 --- a/lib/src/ui/widgets/DualCameraPhones.dart +++ b/lib/src/ui/widgets/DualCameraPhones.dart @@ -16,7 +16,7 @@ class _SeventhlistState extends State { } addDealItem() { - deal = List(); + deal = []; deal.add(deals( "assets/phone.png", 'Redmi Note 7 Pro',