diff --git a/android/app/build.gradle b/android/app/build.gradle
index 56a597e..a334794 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -25,8 +25,8 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 28
-
+ compileSdkVersion 31
+// ndkVersion "23.1.7779620"
lintOptions {
disable 'InvalidPackage'
}
@@ -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 9d9e0a4..50cbcf1 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
+ android:name="io.flutter.embedding.android.SplashScreenDrawable"
+ android:resource="@drawable/launch_background" />
+
+
+
+
diff --git a/android/app/src/main/java/aeologic/flutter_paytm_ui/MainActivity.java b/android/app/src/main/java/aeologic/flutter_paytm_ui/MainActivity.java
index 34dc3ea..679753d 100644
--- a/android/app/src/main/java/aeologic/flutter_paytm_ui/MainActivity.java
+++ b/android/app/src/main/java/aeologic/flutter_paytm_ui/MainActivity.java
@@ -1,13 +1,6 @@
package aeologic.flutter_paytm_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..f06dc3d 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..c0a5958 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:4.2.0'
}
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 8bd86f6..94adc3a 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 2819f02..939efa2 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
diff --git a/lib/constant/Constant.dart b/lib/constant/Constant.dart
index 14b93f0..868c90d 100644
--- a/lib/constant/Constant.dart
+++ b/lib/constant/Constant.dart
@@ -1,3 +1,3 @@
-String SPLASH_SCREEN='/SplashScreen',
-PAY_TM='/Paytm';
+String splashScreen='/SplashScreen',
+payTM='/Paytm';
diff --git a/lib/main.dart b/lib/main.dart
index f10a2d7..1eb158e 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -14,8 +14,8 @@ class MyApp extends StatelessWidget {
theme: new ThemeData(primaryColor: Colors.blue[800],
),
routes: {
- SPLASH_SCREEN: (BuildContext context) => SplashScreen(),
- PAY_TM: (BuildContext context) => Paytm(),
+ splashScreen: (BuildContext context) => SplashScreen(),
+ payTM: (BuildContext context) => Paytm(),
},
diff --git a/lib/ui/paytm.dart b/lib/ui/paytm.dart
index f4cb00b..8d69998 100644
--- a/lib/ui/paytm.dart
+++ b/lib/ui/paytm.dart
@@ -1,10 +1,7 @@
-import 'dart:math';
-
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paytm_ui/model/Gridmodel.dart';
import 'package:flutter_paytm_ui/model/ImageSliderModel.dart';
-import 'package:flutter_swiper/flutter_swiper.dart';
class Paytm extends StatefulWidget {
@override
@@ -21,7 +18,7 @@ class _PaytmState extends State {
appBar: _appBar(),
body: _bodyItem(),
backgroundColor: Colors.grey[200],
- bottomNavigationBar: _bottemTab());
+ bottomNavigationBar: _bottomTab());
}
Widget _appBar() {
@@ -35,20 +32,17 @@ class _PaytmState extends State {
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
height: 40,
- width: MediaQuery
- .of(context)
- .size
- .width / 1.35,
+ width: MediaQuery.of(context).size.width / 1.35,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
-
Padding(
padding: const EdgeInsets.only(left: 20),
- child: Icon(Icons.search,color: Colors.blue,),
+ child: Icon(
+ Icons.search,
+ color: Colors.blue,
+ ),
),
-
-
Padding(
padding: const EdgeInsets.only(right: 20),
child: Image.asset(
@@ -68,56 +62,51 @@ class _PaytmState extends State {
);
}
- Widget _bottemTab() {
+ Widget _bottomTab() {
return new BottomNavigationBar(
currentIndex: 0,
type: BottomNavigationBarType.fixed,
items: [
new BottomNavigationBarItem(
- icon: Image.asset(
- "assets/home.png",
- width: 24.0,
- height: 24.0,
- ),
- title: Text(
- 'Home',
- )),
+ icon: Image.asset(
+ "assets/home.png",
+ width: 24.0,
+ height: 24.0,
+ ),
+ label: 'Home',
+ ),
new BottomNavigationBarItem(
- icon: Image.asset(
- "assets/shopping-bagg.png",
- width: 24.0,
- height: 24.0,
- ),
- title: Text(
- 'Mall',
- )),
+ icon: Image.asset(
+ "assets/shopping-bagg.png",
+ width: 24.0,
+ height: 24.0,
+ ),
+ label: 'Mall',
+ ),
new BottomNavigationBarItem(
- icon: Image.asset(
- "assets/qr-code.png",
- width: 24.0,
- height: 24.0,
- ),
- title: Text(
- 'Scan',
- )),
+ icon: Image.asset(
+ "assets/qr-code.png",
+ width: 24.0,
+ height: 24.0,
+ ),
+ label: 'Scan',
+ ),
new BottomNavigationBarItem(
- icon: Image.asset(
- "assets/bank.png",
- width: 24.0,
- height: 24.0,
- ),
- title: Text(
- 'Bank',
- )),
+ icon: Image.asset(
+ "assets/bank.png",
+ width: 24.0,
+ height: 24.0,
+ ),
+ label: 'Bank',
+ ),
new BottomNavigationBarItem(
- icon: Image.asset(
- "assets/delivery.png",
- width: 24.0,
- height: 24.0,
- ),
- title: Text(
- 'Inbox',
- )),
+ icon: Image.asset(
+ "assets/delivery.png",
+ width: 24.0,
+ height: 24.0,
+ ),
+ label: 'Inbox',
+ ),
]);
}
@@ -129,28 +118,33 @@ class _PaytmState extends State {
width: double.maxFinite,
color: Colors.blue[800],
child: Container(
- child: CarouselSlider(reverse: false,
- aspectRatio: 5,
- viewportFraction: 1.0,
- initialPage: 0,
- enlargeCenterPage: true,
- autoPlay: false,
- onPageChanged: (index) {
- setState(() {
- _currentIndexUp = index;
- print(_currentIndexUp);
- });
- },
+ child: CarouselSlider(
items: List.generate(
- (2), (int index) {
- return GridView.count(
- crossAxisCount: 4,
- children: List.generate((4), (int index) {
- return GridItemTop(
- _getGridList()[index + (_currentIndexUp * 4)]);
- }),
- );
- }),
+ (2),
+ (int index) {
+ return GridView.count(
+ crossAxisCount: 4,
+ children: List.generate((4), (int index) {
+ return GridItemTop(
+ _getGridList()[index + (_currentIndexUp * 4)]);
+ }),
+ );
+ },
+ ),
+ options: CarouselOptions(
+ aspectRatio: 5,
+ viewportFraction: 1.0,
+ initialPage: 0,
+ enlargeCenterPage: true,
+ autoPlay: false,
+ onPageChanged: (int index, reason) {
+ setState(() {
+ _currentIndexUp = index;
+ print(_currentIndexUp);
+ });
+ },
+ reverse: false,
+ ),
),
)
@@ -163,15 +157,14 @@ class _PaytmState extends State {
// return GridList(_getGridList()[index]);
// },
// ),
- ),
-
-
- Container( color: Colors.blue[800],
+ ),
+ Container(
+ color: Colors.blue[800],
child: new Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: List.generate(2, (int index) {
- return dots(_currentIndexUp, index);
- }),
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: List.generate(2, (int index) {
+ return dots(_currentIndexUp, index);
+ }),
),
),
Padding(
@@ -183,10 +176,7 @@ class _PaytmState extends State {
topLeft: Radius.circular(20),
topRight: Radius.circular(20))),
height: 40,
- width: MediaQuery
- .of(context)
- .size
- .width,
+ width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
@@ -215,22 +205,22 @@ class _PaytmState extends State {
child: Container(
color: Colors.white,
child: CarouselSlider(
-
- aspectRatio: 2,
- viewportFraction: 1.0,
- initialPage: 0,
- autoPlayInterval: Duration(seconds: 2),
- autoPlayAnimationDuration: Duration(milliseconds: 800),
- pauseAutoPlayOnTouch: Duration(seconds: 2),
- enlargeCenterPage: true,
- autoPlay: true,
- onPageChanged: (index) {
- setState(() {
- _currentIndex = index;
- print(_currentIndex);
- });
- },
- items: CarouselSliderList(_getImageSliderList()),
+ options: CarouselOptions(
+ aspectRatio: 2,
+ viewportFraction: 1.0,
+ initialPage: 0,
+ autoPlayInterval: Duration(seconds: 2),
+ autoPlayAnimationDuration: Duration(milliseconds: 800),
+ pauseAutoPlayOnTouch: true,
+ enlargeCenterPage: true,
+ autoPlay: true,
+ onPageChanged: (index,reason) {
+ setState(() {
+ _currentIndex = index;
+ });
+ },
+ ),
+ items: carouselSliderList(_getImageSliderList()),
),
),
),
@@ -240,7 +230,7 @@ class _PaytmState extends State {
}
List _getGridItemList() {
- List list = new List();
+ List list = [];
list.add(new GridModel("assets/smartphone.png", "Mobile\nprepaid", null));
list.add(new GridModel("assets/airplane.png", "Flights", null));
list.add(new GridModel("assets/access.png", "Movie Tickets", null));
@@ -261,7 +251,7 @@ class _PaytmState extends State {
}
List _getGridList() {
- List list = new List();
+ List list = [];
list.add(new GridModel("assets/send_money.png", "Pay", Colors.white));
list.add(new GridModel("assets/money_transfer.png", "UPI", Colors.white));
list.add(new GridModel(
@@ -271,14 +261,15 @@ class _PaytmState extends State {
list.add(new GridModel(
"assets/add_money_passbook.png", "Add Money", Colors.white));
list.add(new GridModel("assets/book.png", "Link Account", Colors.white));
- list.add(new GridModel("assets/ic_passbook_header.png", "Link Account", Colors.white));
+ list.add(new GridModel(
+ "assets/ic_passbook_header.png", "Link Account", Colors.white));
list.add(new GridModel("assets/book.png", "Link Account", Colors.white));
return list;
}
List _getImageSliderList() {
- List list = new List();
+ List list = [];
list.add(new ImageSliderModel("assets/real.jpg"));
list.add(new ImageSliderModel("assets/real.jpg"));
@@ -288,7 +279,7 @@ class _PaytmState extends State {
return list;
}
- CarouselSliderList(List getImageSliderList) {
+ List carouselSliderList(List getImageSliderList) {
return getImageSliderList.map((i) {
return Builder(builder: (BuildContext context) {
return imageSliderItem(i);
@@ -322,24 +313,16 @@ class _PaytmState extends State {
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10),
- color: dotColor(index)
- ));
+ color: dotColor(index)));
}
}
-
Widget imageSliderItem(ImageSliderModel i) {
return Container(
padding: EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)),
- width: MediaQuery
- .of(context)
- .size
- .width,
- height: MediaQuery
- .of(context)
- .size
- .height,
+ width: MediaQuery.of(context).size.width,
+ height: MediaQuery.of(context).size.height,
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.asset(
@@ -350,15 +333,12 @@ class _PaytmState extends State {
}
Color dotColor(int index) {
- return _currentIndexUp == index
- ? Colors.white
- : Colors.grey;
+ return _currentIndexUp == index ? Colors.white : Colors.grey;
}
-
}
class GridItem extends StatelessWidget {
- GridModel gridModel;
+ final GridModel gridModel;
GridItem(this.gridModel);
@@ -396,7 +376,7 @@ class GridItem extends StatelessWidget {
}
class GridItemTop extends StatelessWidget {
- GridModel gridModel;
+ final GridModel gridModel;
GridItemTop(this.gridModel);
@@ -405,7 +385,6 @@ class GridItemTop extends StatelessWidget {
return Padding(
padding: const EdgeInsets.all(1 / 2),
child: Container(
-
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -422,7 +401,10 @@ class GridItemTop extends StatelessWidget {
child: Text(
gridModel.title,
textAlign: TextAlign.center,
- style: TextStyle(fontSize: 12, color: Colors.white,),
+ style: TextStyle(
+ fontSize: 12,
+ color: Colors.white,
+ ),
),
),
],
@@ -432,6 +414,3 @@ class GridItemTop extends StatelessWidget {
);
}
}
-
-
-
diff --git a/lib/ui/splashscreen.dart b/lib/ui/splashscreen.dart
index af6b615..4b58323 100644
--- a/lib/ui/splashscreen.dart
+++ b/lib/ui/splashscreen.dart
@@ -1,5 +1,4 @@
import 'dart:async';
-import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paytm_ui/constant/Constant.dart';
@@ -22,7 +21,7 @@ class SplashScreenState extends State
}
void navigationPage() {
- Navigator.of(context).pushReplacementNamed(PAY_TM);
+ Navigator.of(context).pushReplacementNamed(payTM);
}
@override
diff --git a/pubspec.lock b/pubspec.lock
index 0c17227..b9b9179 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -7,35 +7,56 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.0"
+ version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.4"
+ version: "2.1.0"
carousel_slider:
dependency: "direct main"
description:
name: carousel_slider
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.0"
+ version: "4.1.1"
+ characters:
+ dependency: transitive
+ description:
+ name: characters
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.2"
+ version: "1.3.1"
+ clock:
+ dependency: transitive
+ description:
+ name: clock
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.14.11"
+ version: "1.16.0"
+ cross_file:
+ dependency: transitive
+ description:
+ name: cross_file
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.3+2"
cupertino_icons:
dependency: "direct main"
description:
@@ -43,6 +64,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
@@ -55,6 +83,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
+ flutter_plugin_android_lifecycle:
+ dependency: transitive
+ description:
+ name: flutter_plugin_android_lifecycle
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.7"
flutter_swiper:
dependency: "direct main"
description:
@@ -67,48 +102,102 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ http:
+ dependency: transitive
+ description:
+ name: http
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.13.5"
+ http_parser:
+ dependency: transitive
+ description:
+ name: http_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "4.0.2"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.12+1"
+ version: "0.8.6"
+ image_picker_android:
+ dependency: transitive
+ description:
+ name: image_picker_android
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.8.5+3"
+ image_picker_for_web:
+ dependency: transitive
+ description:
+ name: image_picker_for_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.10"
+ image_picker_ios:
+ dependency: transitive
+ description:
+ name: image_picker_ios
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.8.6+1"
+ image_picker_platform_interface:
+ dependency: transitive
+ description:
+ name: image_picker_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.6.2"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
- version: "0.12.5"
- meta:
+ version: "0.12.11"
+ material_color_utilities:
dependency: transitive
description:
- name: meta
+ name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.6"
- path:
+ version: "0.1.4"
+ meta:
dependency: transitive
description:
- name: path
+ name: meta
url: "https://pub.dartlang.org"
source: hosted
- version: "1.6.2"
- pedantic:
+ version: "1.7.0"
+ path:
dependency: transitive
description:
- name: pedantic
+ name: path
url: "https://pub.dartlang.org"
source: hosted
- version: "1.7.0"
- quiver:
+ version: "1.8.1"
+ plugin_platform_interface:
dependency: transitive
description:
- name: quiver
+ name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.3"
+ version: "2.1.3"
sky_engine:
dependency: transitive
description: flutter
@@ -120,42 +209,42 @@ 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.4"
+ 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.5"
+ version: "0.4.9"
transformer_page_view:
dependency: transitive
description:
@@ -169,14 +258,14 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.6"
+ version: "1.3.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.8"
+ version: "2.1.2"
sdks:
- dart: ">=2.2.2 <3.0.0"
- flutter: ">=0.1.4 <2.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
+ flutter: ">=2.10.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index b898233..8791208 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -23,8 +23,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
- image_picker: "^0.4.5"
- carousel_slider: any
+ image_picker: ^0.8.6
+ carousel_slider: ^4.1.1
flutter_swiper : ^1.1.6
dev_dependencies: