From 2d0b6230ae0ac9e3669fcb65c90363bb1bf1c0fe Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 9 Jul 2019 12:44:05 +0100 Subject: [PATCH] slightly nicer login page (no icon although it can be easily added back) --- ios/Podfile.lock | 4 ++-- ios/Runner.xcodeproj/project.pbxproj | 2 +- lib/common/widgets/labeled_checkbox.dart | 19 +++++++++++------- lib/pages/login_page.dart | 25 ++++++++++++++++++------ 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f5bffe1..81f2036 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -6,13 +6,13 @@ PODS: - Flutter DEPENDENCIES: - - Flutter (from `.symlinks/flutter/ios`) + - Flutter (from `.symlinks/flutter/ios-profile`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) EXTERNAL SOURCES: Flutter: - :path: ".symlinks/flutter/ios" + :path: ".symlinks/flutter/ios-profile" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" url_launcher: diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a83a4d3..dff0209 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -281,7 +281,7 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", + "${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( diff --git a/lib/common/widgets/labeled_checkbox.dart b/lib/common/widgets/labeled_checkbox.dart index ad39d8c..a97d9c9 100644 --- a/lib/common/widgets/labeled_checkbox.dart +++ b/lib/common/widgets/labeled_checkbox.dart @@ -6,7 +6,7 @@ class LabeledCheckboxWithIcon extends StatelessWidget { this.label, this.textStyle, this.icon, -// this.iconSize, + this.iconSize, this.iconColor, this.padding, this.value, @@ -16,7 +16,7 @@ class LabeledCheckboxWithIcon extends StatelessWidget { final String label; final TextStyle textStyle; final IconData icon; -// final double iconSize; + final double iconSize; final Color iconColor; final EdgeInsets padding; final bool value; @@ -34,14 +34,16 @@ class LabeledCheckboxWithIcon extends StatelessWidget { padding: padding, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.center, //doesn't do anything children: [ - Padding( - padding: EdgeInsets.fromLTRB(0, 0, 0, 0), + Container( + padding: EdgeInsets.all(0), + width: iconSize, + child : Icon( icon, -// size: iconSize, + // size: iconSize, color: iconColor, ), ), @@ -92,8 +94,11 @@ class LabeledCheckbox extends StatelessWidget { children: [ Expanded(child: Text(label, style: textStyle)), - Checkbox( + CustomCheckbox( + //custom checkbox removes padding so the form looks nice + value: value, + useTapTarget: false, onChanged: (bool newValue) { onChanged(newValue); }, diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 4f478ad..e50c9f8 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -86,7 +86,7 @@ class LoginPageState extends State { body: Container( decoration: BoxDecoration(color: Colors.white), child: Container( - margin: EdgeInsets.fromLTRB(60,0,60,0), + margin: EdgeInsets.fromLTRB(60,30,60,0), child: Column( children: [ Expanded( @@ -165,7 +165,7 @@ class LoginPageState extends State { // ), // ), Padding( - padding: EdgeInsets.fromLTRB(0.0, 25.0, 0.0, 15.0), + padding: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 30.0), child : Material( child : InkWell( @@ -191,12 +191,9 @@ class LoginPageState extends State { Padding( padding: EdgeInsets.fromLTRB(0, 10, 0, 50), - child: LabeledCheckboxWithIcon( + child: LabeledCheckbox( label : "SAVE LOGIN", textStyle: TextStyle(fontSize: 18, color: Colors.black54, fontWeight: FontWeight.bold), - icon: Icons.account_box, -// iconSize: 18, - iconColor: Colors.black54, padding: const EdgeInsets.fromLTRB(0,0,0,0), value : _saveLoginDetails, @@ -206,6 +203,22 @@ class LoginPageState extends State { }); }, ), + + /*child: LabeledCheckboxWithIcon( + label : "SAVE LOGIN", + textStyle: TextStyle(fontSize: 18, color: Colors.black54, fontWeight: FontWeight.bold), + icon: Icons.account_box, // need to remove icon padding!! + iconSize: 18, + iconColor: Colors.black54, + padding: const EdgeInsets.fromLTRB(0,0,0,0), + value : _saveLoginDetails, + + onChanged: (bool newValue) { + setState(() { + _saveLoginDetails = newValue; + }); + }, + ),*/ ), ], ),