From bf7f4351e7f469bf8ade16e7e4a8f8db1d114d96 Mon Sep 17 00:00:00 2001 From: joshuadeguzman Date: Mon, 31 Aug 2020 15:34:44 +0800 Subject: [PATCH 1/4] feat: Add support for enlarging current highlighted pin --- example/ios/Flutter/Flutter.podspec | 18 ++ .../ios/Flutter/flutter_export_environment.sh | 12 ++ example/ios/Runner.xcodeproj/project.pbxproj | 14 +- .../xcshareddata/WorkspaceSettings.xcsettings | 8 - example/lib/main.dart | 51 ++---- lib/pin_code_text_field.dart | 163 +++++++++++------- 6 files changed, 145 insertions(+), 121 deletions(-) create mode 100644 example/ios/Flutter/Flutter.podspec create mode 100755 example/ios/Flutter/flutter_export_environment.sh delete mode 100644 example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/example/ios/Flutter/Flutter.podspec b/example/ios/Flutter/Flutter.podspec new file mode 100644 index 0000000..5ca3041 --- /dev/null +++ b/example/ios/Flutter/Flutter.podspec @@ -0,0 +1,18 @@ +# +# NOTE: This podspec is NOT to be published. It is only used as a local source! +# + +Pod::Spec.new do |s| + s.name = 'Flutter' + s.version = '1.0.0' + s.summary = 'High-performance, high-fidelity mobile apps.' + s.description = <<-DESC +Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. + DESC + s.homepage = 'https://flutter.io' + s.license = { :type => 'MIT' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } + s.ios.deployment_target = '8.0' + s.vendored_frameworks = 'Flutter.framework' +end diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh new file mode 100755 index 0000000..257cbb0 --- /dev/null +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/joshuadeguzman/Documents/TOOLS/FLUTTER" +export "FLUTTER_APPLICATION_PATH=/Users/joshuadeguzman/Documents/DEV/pin_code_text_field/example" +export "FLUTTER_TARGET=/Users/joshuadeguzman/Documents/DEV/pin_code_text_field/example/lib/main.dart" +export "FLUTTER_BUILD_DIR=build" +export "SYMROOT=${SOURCE_ROOT}/../build/ios" +export "OTHER_LDFLAGS=$(inherited) -framework Flutter" +export "FLUTTER_FRAMEWORK_DIR=/Users/joshuadeguzman/Documents/TOOLS/FLUTTER/bin/cache/artifacts/engine/ios" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "TRACK_WIDGET_CREATION=true" diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 887de94..52fa06a 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,11 +9,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -27,8 +23,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -39,13 +33,11 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -58,8 +50,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,9 +59,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -204,7 +192,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 949b678..0000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - BuildSystemType - Original - - diff --git a/example/lib/main.dart b/example/lib/main.dart index da16586..06b4a32 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -163,40 +163,25 @@ class _MyAppState extends State { }, child: PinCodeTextField( autofocus: true, - controller: controller, - hideCharacter: true, - highlight: true, - highlightColor: Colors.blue, - defaultBorderColor: Colors.black, - hasTextBorderColor: Colors.green, - maxLength: pinLength, - hasError: hasError, - maskCharacter: "😎", - onTextChanged: (text) { - setState(() { - hasError = false; - }); - }, - onDone: (text) { - print("DONE $text"); - print("DONE CONTROLLER ${controller.text}"); - }, - pinBoxWidth: 50, - pinBoxHeight: 64, - hasUnderline: true, - wrapAlignment: WrapAlignment.spaceAround, + maxLength: 6, + pinTextStyle: Theme.of(context) + .textTheme + .headline4 + .copyWith(fontFamily: "OpenSans"), + highlightPinBoxHeight: 24, + highlightPinBoxWidth: 32, + pinBoxWidth: 16, + pinBoxHeight: 16, pinBoxDecoration: - ProvidedPinBoxDecoration.defaultPinBoxDecoration, - pinTextStyle: TextStyle(fontSize: 22.0), - pinTextAnimatedSwitcherTransition: - ProvidedPinBoxTextAnimation.scalingTransition, -// pinBoxColor: Colors.green[100], - pinTextAnimatedSwitcherDuration: - Duration(milliseconds: 300), -// highlightAnimation: true, - highlightAnimationBeginColor: Colors.black, - highlightAnimationEndColor: Colors.white12, - keyboardType: TextInputType.number, + ProvidedPinBoxDecoration.roundedPinBoxDecoration, + highlightColor: Colors.red, + highlightPinBoxColor: Colors.red, + pinBoxColor: Colors.grey.shade300, + defaultBorderColor: Colors.transparent, + hasTextBorderColor: Colors.red, + errorBorderColor: Colors.red, + hasError: false, + hideCharacter: true, ), ), ), diff --git a/lib/pin_code_text_field.dart b/lib/pin_code_text_field.dart index 5989b69..a7b55c1 100644 --- a/lib/pin_code_text_field.dart +++ b/lib/pin_code_text_field.dart @@ -9,20 +9,21 @@ import 'package:flutter/services.dart'; typedef OnDone = void Function(String text); typedef PinBoxDecoration = BoxDecoration Function( - Color borderColor, - Color pinBoxColor, { - double borderWidth, - double radius, - }); + Color borderColor, + Color pinBoxColor, { + double borderWidth, + double radius, +}); /// class to provide some standard PinBoxDecoration such as standard box or underlined class ProvidedPinBoxDecoration { /// Default BoxDecoration - static PinBoxDecoration defaultPinBoxDecoration = (Color borderColor, - Color pinBoxColor, { - double borderWidth = 2.0, - double radius = 5.0, - }) { + static PinBoxDecoration defaultPinBoxDecoration = ( + Color borderColor, + Color pinBoxColor, { + double borderWidth = 2.0, + double radius = 5.0, + }) { return BoxDecoration( border: Border.all( color: borderColor, @@ -33,11 +34,12 @@ class ProvidedPinBoxDecoration { }; /// Underlined BoxDecoration - static PinBoxDecoration underlinedPinBoxDecoration = (Color borderColor, - Color pinBoxColor, { - double borderWidth = 2.0, - double radius, - }) { + static PinBoxDecoration underlinedPinBoxDecoration = ( + Color borderColor, + Color pinBoxColor, { + double borderWidth = 2.0, + double radius, + }) { return BoxDecoration( border: Border( bottom: BorderSide( @@ -48,11 +50,12 @@ class ProvidedPinBoxDecoration { ); }; - static PinBoxDecoration roundedPinBoxDecoration = (Color borderColor, - Color pinBoxColor, { - double borderWidth = 2.0, - double radius, - }) { + static PinBoxDecoration roundedPinBoxDecoration = ( + Color borderColor, + Color pinBoxColor, { + double borderWidth = 2.0, + double radius, + }) { return BoxDecoration( border: Border.all( color: borderColor, @@ -71,8 +74,8 @@ class ProvidedPinBoxTextAnimation { return RotationTransition( child: DefaultTextStyleTransition( style: TextStyleTween( - begin: TextStyle(color: Colors.pink), - end: TextStyle(color: Colors.blue)) + begin: TextStyle(color: Colors.pink), + end: TextStyle(color: Colors.blue)) .animate(animation), child: ScaleTransition( child: child, @@ -124,6 +127,8 @@ class PinCodeTextField extends StatefulWidget { final PinBoxDecoration pinBoxDecoration; final String maskCharacter; final TextStyle pinTextStyle; + final double highlightPinBoxHeight; + final double highlightPinBoxWidth; final double pinBoxHeight; final double pinBoxWidth; final OnDone onDone; @@ -155,6 +160,8 @@ class PinCodeTextField extends StatefulWidget { this.highlightColor: Colors.black, this.pinBoxDecoration, this.maskCharacter: " ", + this.highlightPinBoxHeight = 70.0, + this.highlightPinBoxWidth = 70.0, this.pinBoxWidth: 70.0, this.pinBoxHeight: 70.0, this.pinTextStyle, @@ -239,7 +246,7 @@ class PinCodeTextFieldState extends State _highlightAnimationController = AnimationController( vsync: this, duration: - widget.highlightAnimationDuration ?? Duration(milliseconds: 500)); + widget.highlightAnimationDuration ?? Duration(milliseconds: 500)); _highlightAnimationController.addStatusListener((status) { if (status == AnimationStatus.completed) { _highlightAnimationController.reverse(); @@ -248,8 +255,8 @@ class PinCodeTextFieldState extends State } }); _highlightAnimationColorTween = ColorTween( - begin: widget.highlightAnimationBeginColor, - end: widget.highlightAnimationEndColor) + begin: widget.highlightAnimationBeginColor, + end: widget.highlightAnimationEndColor) .animate(_highlightAnimationController); _highlightAnimationController.forward(); } @@ -301,7 +308,8 @@ class PinCodeTextFieldState extends State double get _width { var width = 0.0; for (var i = 0; i < widget.maxLength; i++) { - width += widget.pinBoxWidth; + // Honor the highlight pin box because it will always be equal or larger than the regular pin box size + width += widget.highlightPinBoxWidth; if (i == 0) { width += widget.pinBoxOuterPadding?.left ?? 0; } else if (i + 1 == widget.maxLength) { @@ -344,19 +352,19 @@ class PinCodeTextFieldState extends State return widget.hideDefaultKeyboard ? _pinBoxRow(context) : GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if (hasFocus) { - FocusScope.of(context).requestFocus(FocusNode()); - Future.delayed(Duration(milliseconds: 100), () { - FocusScope.of(context).requestFocus(focusNode); - }); - } else { - FocusScope.of(context).requestFocus(focusNode); - } - }, - child: _pinBoxRow(context), - ); + behavior: HitTestBehavior.opaque, + onTap: () { + if (hasFocus) { + FocusScope.of(context).requestFocus(FocusNode()); + Future.delayed(Duration(milliseconds: 100), () { + FocusScope.of(context).requestFocus(focusNode); + }); + } else { + FocusScope.of(context).requestFocus(focusNode); + } + }, + child: _pinBoxRow(context), + ); } Widget _fakeTextInput() { @@ -459,23 +467,29 @@ class PinCodeTextFieldState extends State List pinCodes = List.generate(widget.maxLength, (int i) { return _buildPinCode(i, context); }); - return Wrap( - direction: Axis.horizontal, - alignment: widget.wrapAlignment, - verticalDirection: VerticalDirection.down, - textDirection: widget.textDirection, - children: pinCodes, + return Container( + height: widget.highlightPinBoxHeight, + width: widget.highlightPinBoxWidth * widget.maxLength, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + textDirection: widget.textDirection, + children: pinCodes, + ), ); } Widget _buildPinCode(int i, BuildContext context) { Color borderColor; Color pinBoxColor; + double pinBoxHeight = widget.pinBoxHeight; + double pinBoxWidth = widget.pinBoxWidth; BoxDecoration boxDecoration; if (widget.hasError) { borderColor = widget.errorBorderColor; } else if (widget.highlightAnimation && _shouldHighlight(i)) { pinBoxColor = widget.pinBoxColor; + pinBoxHeight = widget.highlightPinBoxHeight; + pinBoxWidth = widget.highlightPinBoxWidth; return Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), child: AnimatedBuilder( @@ -491,27 +505,31 @@ class PinCodeTextFieldState extends State } else { boxDecoration = ProvidedPinBoxDecoration.defaultPinBoxDecoration( - _highlightAnimationColorTween.value, - pinBoxColor, - borderWidth: widget.pinBoxBorderWidth, - radius: widget.pinBoxRadius, - ); + _highlightAnimationColorTween.value, + pinBoxColor, + borderWidth: widget.pinBoxBorderWidth, + radius: widget.pinBoxRadius, + ); } return Container( key: ValueKey("container$i"), child: Center(child: _animatedTextBox(strList[i], i)), decoration: boxDecoration, - width: widget.pinBoxWidth, - height: widget.pinBoxHeight, + width: pinBoxWidth, + height: pinBoxHeight, ); })); } else if (widget.highlight && _shouldHighlight(i)) { borderColor = widget.highlightColor; pinBoxColor = widget.highlightPinBoxColor; + pinBoxHeight = widget.highlightPinBoxHeight; + pinBoxWidth = widget.highlightPinBoxWidth; } else if (i < text.length) { borderColor = widget.hasTextBorderColor; pinBoxColor = widget.highlightPinBoxColor; + pinBoxHeight = widget.highlightPinBoxHeight; + pinBoxWidth = widget.highlightPinBoxWidth; } else { borderColor = widget.defaultBorderColor; pinBoxColor = widget.pinBoxColor; @@ -550,24 +568,35 @@ class PinCodeTextFieldState extends State } else { insets = widget.pinBoxOuterPadding; } - return Padding( - padding: insets, - child: Container( - key: ValueKey("container$i"), + + return Container( + width: widget.highlightPinBoxWidth, + height: widget.highlightPinBoxHeight, + child: Center( child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8), + padding: insets, child: Container( - child: Center(child: _animatedTextBox(strList[i], i)), - decoration: widget.hasUnderline - ? BoxDecoration( - border: Border(bottom: BorderSide(color: borderColor ?? Colors.black,),), - ) - : null, + key: ValueKey("container$i"), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8), + child: Container( + child: Center(child: _animatedTextBox(strList[i], i)), + decoration: widget.hasUnderline + ? BoxDecoration( + border: Border( + bottom: BorderSide( + color: borderColor ?? Colors.black, + ), + ), + ) + : null, + ), + ), + decoration: boxDecoration, + width: pinBoxWidth, + height: pinBoxHeight, ), ), - decoration: boxDecoration, - width: widget.pinBoxWidth, - height: widget.pinBoxHeight, ), ); } @@ -583,7 +612,7 @@ class PinCodeTextFieldState extends State return AnimatedSwitcher( duration: widget.pinTextAnimatedSwitcherDuration, transitionBuilder: widget.pinTextAnimatedSwitcherTransition ?? - (Widget child, Animation animation) { + (Widget child, Animation animation) { return child; }, child: Text( From b40c2988cd82ccbe5c35c8f0c64a67bcb98463ba Mon Sep 17 00:00:00 2001 From: joshuadeguzman Date: Mon, 31 Aug 2020 15:36:04 +0800 Subject: [PATCH 2/4] feat: Add animation when switching height --- lib/pin_code_text_field.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pin_code_text_field.dart b/lib/pin_code_text_field.dart index a7b55c1..b3b6827 100644 --- a/lib/pin_code_text_field.dart +++ b/lib/pin_code_text_field.dart @@ -575,7 +575,10 @@ class PinCodeTextFieldState extends State child: Center( child: Padding( padding: insets, - child: Container( + child: AnimatedContainer( + // TODO: Can be exposed as well for adaptability + duration: Duration(milliseconds: 100), + curve: Curves.easeInSine, key: ValueKey("container$i"), child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8), From c9048541a0558f62042d63b6922de7aff9a89fd1 Mon Sep 17 00:00:00 2001 From: joshuadeguzman Date: Mon, 31 Aug 2020 15:37:28 +0800 Subject: [PATCH 3/4] ptch: Only animate the height --- lib/pin_code_text_field.dart | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/pin_code_text_field.dart b/lib/pin_code_text_field.dart index b3b6827..dffa4d4 100644 --- a/lib/pin_code_text_field.dart +++ b/lib/pin_code_text_field.dart @@ -580,22 +580,27 @@ class PinCodeTextFieldState extends State duration: Duration(milliseconds: 100), curve: Curves.easeInSine, key: ValueKey("container$i"), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8), - child: Container( - child: Center(child: _animatedTextBox(strList[i], i)), - decoration: widget.hasUnderline - ? BoxDecoration( - border: Border( - bottom: BorderSide( - color: borderColor ?? Colors.black, + child: Container( + decoration: boxDecoration, + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 8.0, + horizontal: 8, + ), + child: Container( + child: Center(child: _animatedTextBox(strList[i], i)), + decoration: widget.hasUnderline + ? BoxDecoration( + border: Border( + bottom: BorderSide( + color: borderColor ?? Colors.black, + ), ), - ), - ) - : null, + ) + : null, + ), ), ), - decoration: boxDecoration, width: pinBoxWidth, height: pinBoxHeight, ), From bcf151cf1d64c25dc7dfa84bfff265625ce06ef9 Mon Sep 17 00:00:00 2001 From: joshuadeguzman Date: Mon, 31 Aug 2020 15:38:29 +0800 Subject: [PATCH 4/4] ptch: Update demo for examples --- example/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 06b4a32..1f61c2f 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -169,7 +169,7 @@ class _MyAppState extends State { .headline4 .copyWith(fontFamily: "OpenSans"), highlightPinBoxHeight: 24, - highlightPinBoxWidth: 32, + highlightPinBoxWidth: 40, pinBoxWidth: 16, pinBoxHeight: 16, pinBoxDecoration: