From 68a9e7f81e4509fc49ad31a9a02afdecd1b66ea3 Mon Sep 17 00:00:00 2001 From: Mus2413 Date: Sun, 28 Mar 2021 00:12:11 +0530 Subject: [PATCH 1/4] Overflow problem in Settings Page --- android/app/build.gradle | 4 +- android/build.gradle | 4 +- lib/views/profile/settings/settings_view.dart | 198 +++++------------- lib/widgets/settings_item.dart | 44 ++-- 4 files changed, 79 insertions(+), 171 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 30e8305..b20cdbd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -63,5 +63,5 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:26.6.0') implementation 'com.google.firebase:firebase-analytics' - implementation 'com.google.android.gms:play-services-ads:19.7.0' + implementation 'com.google.android.gms:play-services-ads:19.8.0' } diff --git a/android/build.gradle b/android/build.gradle index c57831d..65a88d4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,8 +7,8 @@ buildscript { dependencies { classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.android.tools.build:gradle:4.0.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:4.0.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61" } } diff --git a/lib/views/profile/settings/settings_view.dart b/lib/views/profile/settings/settings_view.dart index 8db6de8..afce926 100644 --- a/lib/views/profile/settings/settings_view.dart +++ b/lib/views/profile/settings/settings_view.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:retro_shopping/helpers/constants.dart'; import 'package:retro_shopping/widgets/retro_button.dart'; import 'package:retro_shopping/widgets/settings_item.dart'; +import 'package:retro_shopping/widgets/stacked_container.dart'; class Settings extends StatefulWidget { @override @@ -20,11 +21,62 @@ class _SettingsState extends State { @override Widget build(BuildContext context) { + final view = ListView(children: [ + Column(mainAxisAlignment: MainAxisAlignment.center, + children: [ + settingsItem(context, 'Your Orders', Icons.bookmark_border_sharp, + routeName: RouteConstant.ORDERS_SCREEN, push: true,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem(context, 'Change Username/\nPassword', Icons.person, + routeName: RouteConstant.CHANGE_USERNAME_SCREEN, push: true,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem(context, 'FAQs', Icons.question_answer, + routeName: RouteConstant.FAQs_SCREEN, push: true,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem(context, 'Manage Address', Icons.location_pin, + routeName: RouteConstant.ADDRESS_SCREEN, push: true,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem(context, 'T&C', Icons.quick_contacts_dialer, + routeName: RouteConstant.TERMS_CONDITIONS, push: true,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + Row(children: [ + const SizedBox(height: 70,), + Expanded(child: Row(children: const [ + SizedBox(width: 10,), + Icon(Icons.notifications_active, size: 25, color: Colors.white,), + SizedBox(width: 20,), + Expanded(child: Text('Notifications(on/off)', style: TextStyle( + fontWeight: FontWeight.normal, fontSize: 16)),) + ],),), + Switch(value: switchedOn, onChanged: (bool value) { + setState(() { + switchedOn = value; + }); + }, activeColor: Colors.white, activeTrackColor: Colors.black,) + ],), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem(context, 'LogOut', Icons.logout, + routeName: RouteConstant.LOGIN_SCREEN, push: false,), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + settingsItem( + context, 'GitHub Repo Link', Icons.verified_user_outlined), + Padding(padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: divider(),), + ],), + ]); + return Scaffold( appBar: AppBar( backgroundColor: RelicColors.backgroundColor, leading: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.only(left:14.0, right: 10, top: 15, bottom: 10), child: GestureDetector( onTap: () { Navigator.pop(context); @@ -32,8 +84,8 @@ class _SettingsState extends State { child: RetroButton( upperColor: Colors.white, lowerColor: Colors.black, - width: 35, - height: 35, + width: 25, + height: 25, borderColor: Colors.white, child: const Icon( Icons.arrow_back, @@ -46,144 +98,10 @@ class _SettingsState extends State { elevation: 0.0, ), body: Padding( - padding: const EdgeInsets.only(left: 14.0, right: 10.0), + padding: const EdgeInsets.only(left: 20,right: 15,top: 10), child: SingleChildScrollView( - child: Stack( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.92 + 10, - height: MediaQuery.of(context).size.height * 0.85 + 10, - decoration: const BoxDecoration(color: Colors.black), - ), - Container( - padding: - const EdgeInsets.symmetric(vertical: 16, horizontal: 12), - width: MediaQuery.of(context).size.width * 0.92 - 3, - height: MediaQuery.of(context).size.height * 0.85 + 5, - decoration: - const BoxDecoration(color: RelicColors.primaryColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - settingsItem( - context, - 'Your Orders', - Icons.bookmark_border_sharp, - routeName: RouteConstant.ORDERS_SCREEN, - push: true, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem( - context, - 'Change Username/\nPassword', - Icons.person, - routeName: RouteConstant.CHANGE_USERNAME_SCREEN, - push: true, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem( - context, - 'FAQs', - Icons.question_answer, - routeName: RouteConstant.FAQs_SCREEN, - push: true, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem( - context, - 'Manage Address', - Icons.location_pin, - routeName: RouteConstant.ADDRESS_SCREEN, - push: true, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem( - context, - 'T&C', - Icons.quick_contacts_dialer, - routeName: RouteConstant.TERMS_CONDITIONS, - push: true, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - Row( - children: [ - const SizedBox( - height: 70, - ), - Expanded( - child: Row( - children: const [ - SizedBox( - width: 5, - ), - Icon( - Icons.notifications_active, - size: 30, - color: Colors.white, - ), - SizedBox( - width: 5, - ), - Text('Notifications(on/off)', - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 20)) - ], - ), - ), - Switch( - value: switchedOn, - onChanged: (bool value) { - setState(() { - switchedOn = value; - }); - }, - activeColor: Colors.white, - activeTrackColor: Colors.black, - ) - ], - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem( - context, - 'LogOut', - Icons.logout, - routeName: RouteConstant.LOGIN_SCREEN, - push: false, - ), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - settingsItem(context, 'GitHub Repo Link', - Icons.verified_user_outlined), - Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: divider(), - ), - ], - ), - ), - ], - ), + child: StackedContainer( height: MediaQuery.of(context).size.height * 0.82 + 10, + width: MediaQuery.of(context).size.width * 0.92 + 10, child: view,) ), )); } diff --git a/lib/widgets/settings_item.dart b/lib/widgets/settings_item.dart index 04b95df..c59d566 100644 --- a/lib/widgets/settings_item.dart +++ b/lib/widgets/settings_item.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; Widget settingsItem(BuildContext context, String text, IconData ic, @@ -13,36 +14,25 @@ Widget settingsItem(BuildContext context, String text, IconData ic, } } }, - child: Row( - children: [ - const SizedBox( - height: 70, + child: Padding( + padding: const EdgeInsets.only(left: 15,right: 5, top: 10,bottom: 5), + child: ListTile( + contentPadding: EdgeInsets.zero, + dense: true, + leading: Icon( + ic, + size: 20, + color: Colors.white, ), - Expanded( - child: Row( - children: [ - const SizedBox( - width: 5, - ), - Icon( - ic, - size: 30, - color: Colors.white, - ), - const SizedBox( - width: 5, - ), - Text(text, - style: const TextStyle( - fontWeight: FontWeight.normal, fontSize: 20)) - ], - ), + title: Text( + text, style: const TextStyle( + fontWeight: FontWeight.normal, fontSize: 16) , ), - IconButton( - onPressed: () {}, + trailing: IconButton( + onPressed: (){}, icon: const Icon(Icons.keyboard_arrow_right), - ) - ], + ), + ), ), ); } From ba0db583eaea027d0d8d88ef046a9eec3e3630ee Mon Sep 17 00:00:00 2001 From: Muskan Jain <56889261+Mus2413@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:38:51 +0530 Subject: [PATCH 2/4] Delete build.gradle --- android/build.gradle | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 android/build.gradle diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 65a88d4..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.android.tools.build:gradle:4.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61" - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} From 93070868550c805f92ba6dcbb63f16ceb689fc1b Mon Sep 17 00:00:00 2001 From: Muskan Jain <56889261+Mus2413@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:39:26 +0530 Subject: [PATCH 3/4] Delete build.gradle --- android/app/build.gradle | 67 ---------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 android/app/build.gradle diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index b20cdbd..0000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,67 +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: 'com.google.gms.google-services' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 29 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "tech.himanshusharma.relicbazaar" - minSdkVersion 23 - targetSdkVersion 29 - 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" - implementation platform('com.google.firebase:firebase-bom:26.6.0') - implementation 'com.google.firebase:firebase-analytics' - implementation 'com.google.android.gms:play-services-ads:19.8.0' -} From be53d295a3b4d27f3178504ea566d14d77eba3f2 Mon Sep 17 00:00:00 2001 From: Mus2413 Date: Sun, 28 Mar 2021 01:00:28 +0530 Subject: [PATCH 4/4] Overflow problem in Settings Page --- android/app/build.gradle | 6 +++--- android/build.gradle | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b20cdbd..580a8a8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 29 + compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -63,5 +63,5 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:26.6.0') implementation 'com.google.firebase:firebase-analytics' - implementation 'com.google.android.gms:play-services-ads:19.8.0' -} + implementation 'com.google.android.gms:play-services-ads:19.7.0' +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 65a88d4..4988f52 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,8 +7,8 @@ buildscript { dependencies { classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.android.tools.build:gradle:4.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61" + classpath 'com.android.tools.build:gradle:4.0.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -29,4 +29,4 @@ subprojects { task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file