From d79d546bdf5714809e3a0f6ba4d1995bee77453b Mon Sep 17 00:00:00 2001 From: Requieem <43446747+Requieem@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:11:31 +0200 Subject: [PATCH] added support for in-between spacing The Info text bullet points were often getting pushed down in the column and it was difficult to control its distance from the "bars" showing the validation steps using height only, as restricting the height would cause the bullet points to overflow. With these changes, elements of the validator are now aligned to the start of the column and a new SizedBox spacer has been added to control spacing between the two validator visual features (the bars / the text) --- lib/Utilities/SizeConfig.dart | 1 + lib/flutter_pw_validator.dart | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Utilities/SizeConfig.dart b/lib/Utilities/SizeConfig.dart index b300ed6..b341ddf 100644 --- a/lib/Utilities/SizeConfig.dart +++ b/lib/Utilities/SizeConfig.dart @@ -4,4 +4,5 @@ class SizeConfig { static double? width; static double? height; + static double? spaceBetween; } diff --git a/lib/flutter_pw_validator.dart b/lib/flutter_pw_validator.dart index b06045c..3167a66 100644 --- a/lib/flutter_pw_validator.dart +++ b/lib/flutter_pw_validator.dart @@ -18,7 +18,7 @@ class FlutterPwValidator extends StatefulWidget { numericCharCount, specialCharCount; final Color defaultColor, successColor, failureColor; - final double width, height; + final double width, height, spaceBetween; final Function onSuccess; final Function? onFail; final TextEditingController controller; @@ -31,6 +31,7 @@ class FlutterPwValidator extends StatefulWidget { required this.minLength, required this.onSuccess, required this.controller, + this.spaceBetween = 0, this.uppercaseCharCount = 0, this.lowercaseCharCount = 0, this.numericCharCount = 0, @@ -45,6 +46,7 @@ class FlutterPwValidator extends StatefulWidget { //Initial entered size for global use SizeConfig.width = width; SizeConfig.height = height; + SizeConfig.spaceBetween = spaceBetween; } @override @@ -168,7 +170,7 @@ class FlutterPwValidatorState extends State { width: SizeConfig.width, height: widget.height, child: new Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: [ new Flexible( flex: 3, @@ -188,6 +190,10 @@ class FlutterPwValidatorState extends State { ], ), ), + new SizedBox( + width: SizeConfig.width, + height: SizeConfig.spaceBetween, + ), new Flexible( flex: 7, child: new Column(