From 72cb0410e107f7ae41ec37d1bb4ff83a57b5cb2d Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Sun, 16 Aug 2020 17:39:20 +0100 Subject: [PATCH 01/38] Remove internal state for spinner value --- lib/spinner_input.dart | 18 +++---------- pubspec.lock | 60 ++++++++++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index fa3e9ad..0ee5892 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'dart:async'; - /// Spinner Input like HTML5 spinners class SpinnerButtonStyle { Color color; @@ -80,7 +79,6 @@ class _SpinnerInputState extends State final _focusNode = FocusNode(); Timer timer; - double _spinnerValue; SpinnerButtonStyle _plusSpinnerStyle; SpinnerButtonStyle _minusSpinnerStyle; @@ -88,10 +86,6 @@ class _SpinnerInputState extends State @override void initState() { - - /// initializing variables - _spinnerValue = widget.spinnerValue; - /// popup textfield textEditingController = TextEditingController( text: widget.spinnerValue.toStringAsFixed(widget.fractionDigits)); @@ -108,7 +102,6 @@ class _SpinnerInputState extends State } }); - // initialize buttons _plusSpinnerStyle = widget.plusButton ?? SpinnerButtonStyle(); _plusSpinnerStyle.child ??= Icon(Icons.add); @@ -257,11 +250,10 @@ class _SpinnerInputState extends State } void increase() { - double value = _spinnerValue; + double value = widget.spinnerValue; value += widget.step; if (value <= widget.maxValue) { textEditingController.text = value.toStringAsFixed(widget.fractionDigits); - _spinnerValue = value; setState(() { widget.onChange(value); }); @@ -269,11 +261,10 @@ class _SpinnerInputState extends State } void decrease() { - double value = _spinnerValue; + double value = widget.spinnerValue; value -= widget.step; if (value >= widget.minValue) { textEditingController.text = value.toStringAsFixed(widget.fractionDigits); - _spinnerValue = value; setState(() { widget.onChange(value); }); @@ -337,16 +328,15 @@ class _SpinnerInputState extends State double value = double.parse(textEditingController.text); if (value <= widget.maxValue && value >= widget.minValue) { - _spinnerValue = value; setState(() { widget.onChange(value); }); } else { - textEditingController.text = _spinnerValue + textEditingController.text = widget.spinnerValue .toStringAsFixed(widget.fractionDigits); } } catch (e) { - textEditingController.text = _spinnerValue + textEditingController.text = widget.spinnerValue .toStringAsFixed(widget.fractionDigits); } popupAnimationController.reset(); diff --git a/pubspec.lock b/pubspec.lock index 224c7bb..9477cdd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: async: dependency: transitive @@ -7,28 +7,49 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.4.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.13" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -45,28 +66,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.8" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.1.8" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" + version: "1.7.0" sky_engine: dependency: transitive description: flutter @@ -78,49 +92,49 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.7.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.2.17" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" vector_math: dependency: transitive description: @@ -129,4 +143,4 @@ packages: source: hosted version: "2.0.8" sdks: - dart: ">=2.0.0 <3.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" From 2e30229d8ecee2c1ab26bc7f33b8695c27181d33 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Sun, 16 Aug 2020 19:34:38 +0100 Subject: [PATCH 02/38] request focus when popup is shown, optimize --- lib/spinner_input.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index 0ee5892..1ecef77 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -190,6 +190,7 @@ class _SpinnerInputState extends State if (widget.disabledPopup == false) { if (popupAnimationController.isDismissed) { popupAnimationController.forward(); + _focusNode.requestFocus(); } else popupAnimationController.reverse(); } @@ -237,13 +238,14 @@ class _SpinnerInputState extends State ), ], ), - Positioned( - left: 0, - top: 0, - right: 0, - bottom: 0, - child: textFieldPopUp(), - ), + if (widget.disabledPopup == false) + Positioned( + left: 0, + top: 0, + right: 0, + bottom: 0, + child: textFieldPopUp(), + ), ], ), ); From cccf4ba217e4c64fa668ff94e7011ec41c4d2418 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 21 May 2021 07:32:46 +0100 Subject: [PATCH 03/38] Number formatter --- lib/spinner_input.dart | 43 +++++++++++++++++++++++++++++----------- pubspec.lock | 45 ++++++++++++++++++++++++------------------ pubspec.yaml | 1 + 3 files changed, 59 insertions(+), 30 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index 1ecef77..6464d8f 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -1,6 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'dart:async'; +import 'package:intl/intl.dart' as intl; + /// Spinner Input like HTML5 spinners class SpinnerButtonStyle { Color color; @@ -43,6 +46,7 @@ class SpinnerInput extends StatefulWidget { final SpinnerButtonStyle plusButton; final SpinnerButtonStyle minusButton; final SpinnerButtonStyle popupButton; + final intl.NumberFormat numberFormat; final TextStyle popupTextStyle; final TextDirection direction; @@ -63,6 +67,7 @@ class SpinnerInput extends StatefulWidget { this.plusButton, this.minusButton, this.popupButton, + this.numberFormat, this.direction = TextDirection.ltr, this.popupTextStyle = const TextStyle(fontSize: 18, color: Colors.black87, height: 1.15), @@ -87,8 +92,8 @@ class _SpinnerInputState extends State @override void initState() { /// popup textfield - textEditingController = TextEditingController( - text: widget.spinnerValue.toStringAsFixed(widget.fractionDigits)); + textEditingController = + TextEditingController(text: _formatted(widget.spinnerValue)); /// popup animation controller popupAnimationController = @@ -200,8 +205,7 @@ class _SpinnerInputState extends State padding: widget.middleNumberPadding, color: widget.middleNumberBackground, child: Text( - widget.spinnerValue - .toStringAsFixed(widget.fractionDigits), + _formatted(widget.spinnerValue), textAlign: TextAlign.center, style: widget.middleNumberStyle, )), @@ -255,7 +259,7 @@ class _SpinnerInputState extends State double value = widget.spinnerValue; value += widget.step; if (value <= widget.maxValue) { - textEditingController.text = value.toStringAsFixed(widget.fractionDigits); + textEditingController.text = _formatted(value); setState(() { widget.onChange(value); }); @@ -266,7 +270,7 @@ class _SpinnerInputState extends State double value = widget.spinnerValue; value -= widget.step; if (value >= widget.minValue) { - textEditingController.text = value.toStringAsFixed(widget.fractionDigits); + textEditingController.text = _formatted(value); setState(() { widget.onChange(value); }); @@ -300,6 +304,14 @@ class _SpinnerInputState extends State children: [ Expanded( child: TextField( + // inputFormatters: [ + // TextInputFormatter.withFunction((oldValue, newValue) { + // if (widget.numberFormat != null) { + // return TextEditingValue(text: ); + // } + // return newValue; + // }) + // ], maxLength: maxLength, focusNode: _focusNode, keyboardType: TextInputType.number, @@ -327,19 +339,22 @@ class _SpinnerInputState extends State onPressed: () { FocusScope.of(context).requestFocus(new FocusNode()); try { - double value = double.parse(textEditingController.text); + double value = widget.numberFormat != null + ? widget.numberFormat + .parse(textEditingController.text) + : double.parse(textEditingController.text); if (value <= widget.maxValue && value >= widget.minValue) { setState(() { widget.onChange(value); }); } else { - textEditingController.text = widget.spinnerValue - .toStringAsFixed(widget.fractionDigits); + textEditingController.text = + _formatted(widget.spinnerValue); } } catch (e) { - textEditingController.text = widget.spinnerValue - .toStringAsFixed(widget.fractionDigits); + textEditingController.text = + _formatted(widget.spinnerValue); } popupAnimationController.reset(); }, @@ -353,4 +368,10 @@ class _SpinnerInputState extends State ), ); } + + String _formatted(double value) { + return widget.numberFormat != null + ? widget.numberFormat.format(value) + : value.toStringAsFixed(widget.fractionDigits); + } } diff --git a/pubspec.lock b/pubspec.lock index 9477cdd..cda6e0d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,49 +7,49 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.6.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.13" + version: "1.15.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -60,27 +60,34 @@ packages: description: flutter source: sdk version: "0.0.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.3.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -92,55 +99,55 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + 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.5" + 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.17" + version: "0.3.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" + dart: ">=2.12.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 5a46a0a..b693421 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,6 +8,7 @@ environment: sdk: ">=2.0.0-dev.68.0 <3.0.0" dependencies: + intl: flutter: sdk: flutter From 28f8d9ddbee6e5c0848d9734d5a080b481031213 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 6 Jun 2021 22:59:58 -0700 Subject: [PATCH 04/38] Towards sound null safety --- lib/spinner_input.dart | 76 +++++++++++++++++++++++------------------- pubspec.lock | 1 + pubspec.yaml | 5 +-- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index 6464d8f..c1aa074 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -6,16 +6,16 @@ import 'package:intl/intl.dart' as intl; /// Spinner Input like HTML5 spinners class SpinnerButtonStyle { - Color color; + Color? color; - Color textColor; - Widget child; - double width; - double height; - BorderRadius borderRadius; - double highlightElevation; - Color highlightColor; - double elevation; + Color? textColor; + Widget? child; + double? width; + double? height; + BorderRadius? borderRadius; + double? highlightElevation; + Color? highlightColor; + double? elevation; SpinnerButtonStyle( {this.color, @@ -32,26 +32,26 @@ class SpinnerButtonStyle { class SpinnerInput extends StatefulWidget { final bool disabledPopup; final double spinnerValue; - final double middleNumberWidth; + final double? middleNumberWidth; final EdgeInsets middleNumberPadding; final TextStyle middleNumberStyle; - final Color middleNumberBackground; + final Color? middleNumberBackground; final double minValue; final double maxValue; final double step; final int fractionDigits; final Duration longPressSpeed; - final Function(double newValue) onChange; + final Function(double newValue)? onChange; final bool disabledLongPress; - final SpinnerButtonStyle plusButton; - final SpinnerButtonStyle minusButton; - final SpinnerButtonStyle popupButton; - final intl.NumberFormat numberFormat; + final SpinnerButtonStyle? plusButton; + final SpinnerButtonStyle? minusButton; + final SpinnerButtonStyle? popupButton; + final intl.NumberFormat? numberFormat; final TextStyle popupTextStyle; final TextDirection direction; SpinnerInput({ - @required this.spinnerValue, + required this.spinnerValue, this.middleNumberWidth, this.middleNumberBackground, this.middleNumberPadding = const EdgeInsets.all(5), @@ -79,19 +79,19 @@ class SpinnerInput extends StatefulWidget { class _SpinnerInputState extends State with TickerProviderStateMixin { - TextEditingController textEditingController; - AnimationController popupAnimationController; + late TextEditingController textEditingController; + late AnimationController popupAnimationController; final _focusNode = FocusNode(); - Timer timer; + Timer? timer; - SpinnerButtonStyle _plusSpinnerStyle; - SpinnerButtonStyle _minusSpinnerStyle; - SpinnerButtonStyle _popupButtonStyle; + late SpinnerButtonStyle _plusSpinnerStyle; + late SpinnerButtonStyle _minusSpinnerStyle; + late SpinnerButtonStyle _popupButtonStyle; @override void initState() { - /// popup textfield + /// popup text field textEditingController = TextEditingController(text: _formatted(widget.spinnerValue)); @@ -172,7 +172,7 @@ class _SpinnerInputState extends State highlightColor: _minusSpinnerStyle.highlightColor, highlightElevation: _minusSpinnerStyle.highlightElevation, shape: new RoundedRectangleBorder( - borderRadius: _minusSpinnerStyle.borderRadius), + borderRadius: _minusSpinnerStyle.borderRadius!), onPressed: () { decrease(); }, @@ -186,7 +186,7 @@ class _SpinnerInputState extends State } }, onLongPressUp: () { - if (timer != null) timer.cancel(); + timer?.cancel(); }, ), ), @@ -222,7 +222,7 @@ class _SpinnerInputState extends State color: _plusSpinnerStyle.color, textColor: _plusSpinnerStyle.textColor, shape: new RoundedRectangleBorder( - borderRadius: _plusSpinnerStyle.borderRadius), + borderRadius: _plusSpinnerStyle.borderRadius!), onPressed: () { increase(); }, @@ -236,7 +236,7 @@ class _SpinnerInputState extends State } }, onLongPressUp: () { - if (timer != null) timer.cancel(); + timer?.cancel(); }, ), ), @@ -261,7 +261,9 @@ class _SpinnerInputState extends State if (value <= widget.maxValue) { textEditingController.text = _formatted(value); setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } } @@ -272,7 +274,9 @@ class _SpinnerInputState extends State if (value >= widget.minValue) { textEditingController.text = _formatted(value); setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } } @@ -335,18 +339,20 @@ class _SpinnerInputState extends State highlightColor: _popupButtonStyle.highlightColor, highlightElevation: _popupButtonStyle.highlightElevation, shape: new RoundedRectangleBorder( - borderRadius: _popupButtonStyle.borderRadius), + borderRadius: _popupButtonStyle.borderRadius!), onPressed: () { FocusScope.of(context).requestFocus(new FocusNode()); try { double value = widget.numberFormat != null - ? widget.numberFormat - .parse(textEditingController.text) + ? widget.numberFormat! + .parse(textEditingController.text).toDouble() : double.parse(textEditingController.text); if (value <= widget.maxValue && value >= widget.minValue) { setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } else { textEditingController.text = @@ -371,7 +377,7 @@ class _SpinnerInputState extends State String _formatted(double value) { return widget.numberFormat != null - ? widget.numberFormat.format(value) + ? widget.numberFormat!.format(value) : value.toStringAsFixed(widget.fractionDigits); } } diff --git a/pubspec.lock b/pubspec.lock index cda6e0d..0103ccb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -151,3 +151,4 @@ packages: version: "2.1.0" sdks: dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/pubspec.yaml b/pubspec.yaml index b693421..596d78a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,12 @@ name: spinner_input description: A Spinner Input for flutter. like html5 input-spinners -version: 0.1.0 +version: 0.1.1 author: Ali Azmoude homepage: https://github.com/Ali-Azmoud/spinner_input environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" dependencies: intl: From e08b82024cace0e7f26a84a8137dc73025e803b2 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Wed, 9 Jun 2021 13:40:01 -0700 Subject: [PATCH 05/38] Eliminating lates, because they are not initialized in the constructor but rather in initState --- lib/spinner_input.dart | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index c1aa074..cbec76e 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -79,15 +79,15 @@ class SpinnerInput extends StatefulWidget { class _SpinnerInputState extends State with TickerProviderStateMixin { - late TextEditingController textEditingController; - late AnimationController popupAnimationController; + TextEditingController? textEditingController; + AnimationController? popupAnimationController; final _focusNode = FocusNode(); Timer? timer; - late SpinnerButtonStyle _plusSpinnerStyle; - late SpinnerButtonStyle _minusSpinnerStyle; - late SpinnerButtonStyle _popupButtonStyle; + SpinnerButtonStyle _plusSpinnerStyle = SpinnerButtonStyle(); + SpinnerButtonStyle _minusSpinnerStyle = SpinnerButtonStyle(); + SpinnerButtonStyle _popupButtonStyle = SpinnerButtonStyle(); @override void initState() { @@ -101,9 +101,9 @@ class _SpinnerInputState extends State _focusNode.addListener(() { if (_focusNode.hasFocus) { - textEditingController.selection = TextSelection( + textEditingController?.selection = TextSelection( baseOffset: 0, - extentOffset: textEditingController.value.text.length); + extentOffset: textEditingController?.value.text.length ?? 0); } }); @@ -147,7 +147,7 @@ class _SpinnerInputState extends State @override void dispose() { // Clean up the controller when the Widget is removed from the Widget tree - textEditingController.dispose(); + textEditingController?.dispose(); super.dispose(); } @@ -192,12 +192,12 @@ class _SpinnerInputState extends State ), GestureDetector( onTap: () { - if (widget.disabledPopup == false) { - if (popupAnimationController.isDismissed) { - popupAnimationController.forward(); + if (widget.disabledPopup == false && popupAnimationController != null) { + if (popupAnimationController!.isDismissed) { + popupAnimationController!.forward(); _focusNode.requestFocus(); } else - popupAnimationController.reverse(); + popupAnimationController!.reverse(); } }, child: Container( @@ -259,7 +259,7 @@ class _SpinnerInputState extends State double value = widget.spinnerValue; value += widget.step; if (value <= widget.maxValue) { - textEditingController.text = _formatted(value); + textEditingController?.text = _formatted(value); setState(() { if (widget.onChange != null) { widget.onChange!(value); @@ -272,7 +272,7 @@ class _SpinnerInputState extends State double value = widget.spinnerValue; value -= widget.step; if (value >= widget.minValue) { - textEditingController.text = _formatted(value); + textEditingController?.text = _formatted(value); setState(() { if (widget.onChange != null) { widget.onChange!(value); @@ -288,7 +288,7 @@ class _SpinnerInputState extends State return ScaleTransition( scale: CurvedAnimation( - parent: popupAnimationController, + parent: popupAnimationController!, curve: Interval(0.0, 1.0, curve: Curves.elasticOut)), child: Center( child: Container( @@ -345,8 +345,8 @@ class _SpinnerInputState extends State try { double value = widget.numberFormat != null ? widget.numberFormat! - .parse(textEditingController.text).toDouble() - : double.parse(textEditingController.text); + .parse(textEditingController?.text ?? "0").toDouble() + : double.parse(textEditingController?.text ?? "0"); if (value <= widget.maxValue && value >= widget.minValue) { setState(() { @@ -355,14 +355,14 @@ class _SpinnerInputState extends State } }); } else { - textEditingController.text = + textEditingController?.text = _formatted(widget.spinnerValue); } } catch (e) { - textEditingController.text = + textEditingController?.text = _formatted(widget.spinnerValue); } - popupAnimationController.reset(); + popupAnimationController?.reset(); }, child: _popupButtonStyle.child, ), From 3540b46ba561332c7df2df3fb2cbd2b306b6bb9b Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Wed, 9 Jun 2021 13:40:33 -0700 Subject: [PATCH 06/38] Version bump for latest change --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 596d78a..902a822 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spinner_input description: A Spinner Input for flutter. like html5 input-spinners -version: 0.1.1 +version: 0.1.2 author: Ali Azmoude homepage: https://github.com/Ali-Azmoud/spinner_input From 81cb0ae508d29b61f831d2b24bdebf4f1a0fe959 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 15:32:54 -0700 Subject: [PATCH 07/38] Exclude idea (IntelliJ IDEA) metadata folder from source control --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 446ed0d..e63af0b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .packages .pub/ +.idea build/ ios/.generated/ From 32e9b6ffa67a3faa3c79acbc1417721b80101513 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 15:46:06 -0700 Subject: [PATCH 08/38] Very old package version bumps --- pubspec.lock | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 0103ccb..67c83b1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -21,35 +21,28 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" + version: "1.2.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -73,21 +66,28 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.8.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -99,7 +99,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -120,35 +120,28 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.12" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0" From f820a4e355863569b14850f97394e837769c8a0f Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 15:55:43 -0700 Subject: [PATCH 09/38] Simple overcoming of RaisedButton deprecation with MaterialButton, fixes #2 --- lib/spinner_input.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index cbec76e..2f31b69 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -164,7 +164,7 @@ class _SpinnerInputState extends State width: _minusSpinnerStyle.width, height: _minusSpinnerStyle.height, child: GestureDetector( - child: RaisedButton( + child: MaterialButton( padding: EdgeInsets.all(0), color: _minusSpinnerStyle.color, textColor: _minusSpinnerStyle.textColor, @@ -214,7 +214,7 @@ class _SpinnerInputState extends State width: _plusSpinnerStyle.width, height: _plusSpinnerStyle.height, child: GestureDetector( - child: RaisedButton( + child: MaterialButton( elevation: _plusSpinnerStyle.elevation, highlightColor: _plusSpinnerStyle.highlightColor, highlightElevation: _plusSpinnerStyle.highlightElevation, @@ -331,7 +331,7 @@ class _SpinnerInputState extends State child: Container( width: _popupButtonStyle.width, height: _popupButtonStyle.height, - child: RaisedButton( + child: MaterialButton( padding: EdgeInsets.all(1), color: _popupButtonStyle.color, textColor: _popupButtonStyle.textColor, From 38255e9abfcf6f4378448d78bc4989b2885f5c6a Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 15:55:58 -0700 Subject: [PATCH 10/38] Analyzer reported warnings --- lib/spinner_input.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index 2f31b69..ce0feb3 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'dart:async'; import 'package:intl/intl.dart' as intl; @@ -56,11 +55,11 @@ class SpinnerInput extends StatefulWidget { this.middleNumberBackground, this.middleNumberPadding = const EdgeInsets.all(5), this.middleNumberStyle = const TextStyle(fontSize: 20), - this.maxValue: 100, - this.minValue: 0, - this.step: 1, - this.fractionDigits: 0, - this.longPressSpeed: const Duration(milliseconds: 50), + this.maxValue = 100, + this.minValue = 0, + this.step = 1, + this.fractionDigits = 0, + this.longPressSpeed = const Duration(milliseconds: 50), this.disabledLongPress = false, this.disabledPopup = false, this.onChange, From 851fda7cce8959fb31b90137c68fe3e8a6f4c922 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 15:56:19 -0700 Subject: [PATCH 11/38] Analyzer: The 'author' field is no longer used and can be removed. --- pubspec.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 902a822..729920d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,6 @@ name: spinner_input description: A Spinner Input for flutter. like html5 input-spinners version: 0.1.2 -author: Ali Azmoude homepage: https://github.com/Ali-Azmoud/spinner_input environment: From c4b7a095c78df06cb30a92002c02f71d847172bf Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:07:47 -0700 Subject: [PATCH 12/38] Allow Flutter SDK 3.0 and above as well --- pubspec.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 729920d..5f993a9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,8 +4,7 @@ version: 0.1.2 homepage: https://github.com/Ali-Azmoud/spinner_input environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + sdk: '>=2.12.0 <4.0.0' dependencies: intl: From d2491a6d8af3ff9a066208e51480e0e0b058b699 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:10:02 -0700 Subject: [PATCH 13/38] More package version bumps (transitive) --- pubspec.lock | 93 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 67c83b1..62b0cfb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,42 +5,48 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" flutter: @@ -57,37 +63,42 @@ packages: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted version: "0.17.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -97,51 +108,65 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "0.1.4-beta" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.20.0" + dart: ">=3.1.0-185.0.dev <4.0.0" From 94db7b91fccda43116f8783ff99e733ef47912d0 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:11:45 -0700 Subject: [PATCH 14/38] intl lagging package version reported by outdated --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 62b0cfb..92bd5a5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -63,10 +63,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5f993a9..528d27c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=2.12.0 <4.0.0' dependencies: - intl: + intl: ^0.18.1 flutter: sdk: flutter From 859fe30c7b328b730832583fa621646df3422626 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:30:51 -0700 Subject: [PATCH 15/38] Flutter (Dart) format example --- example/example.dart | 217 +++++++++++++++++++++---------------------- 1 file changed, 106 insertions(+), 111 deletions(-) diff --git a/example/example.dart b/example/example.dart index f9eba5d..bc8fc50 100644 --- a/example/example.dart +++ b/example/example.dart @@ -18,122 +18,117 @@ class _MySpinnerState extends State { @override Widget build(BuildContext context) { return MaterialApp( - home: Scaffold( - appBar: AppBar(), - body: Column( - children: [ - - - // default spinner - Container( - margin: EdgeInsets.all(20), - child: SpinnerInput( - spinnerValue: spinner, -// minValue: 0, -// maxValue: 200, - onChange: (newValue) { - setState(() { - spinner = newValue; - }); - }, - ), + home: Scaffold( + appBar: AppBar(), + body: Column( + children: [ + // default spinner + Container( + margin: EdgeInsets.all(20), + child: SpinnerInput( + spinnerValue: spinner, + // minValue: 0, + // maxValue: 200, + onChange: (newValue) { + setState(() { + spinner = newValue; + }); + }, ), - - - - // Set step ( can be int or double ) - Container( - margin: EdgeInsets.all(20), - child: SpinnerInput( - minValue: 0, - maxValue: 200, - step: 5, - plusButton: SpinnerButtonStyle(elevation: 0, color: Colors.blue, borderRadius: BorderRadius.circular(0)), - minusButton: SpinnerButtonStyle(elevation: 0, color: Colors.red, borderRadius: BorderRadius.circular(0)), - middleNumberWidth: 70, - middleNumberStyle: TextStyle(fontSize: 21), - middleNumberBackground: Colors.yellowAccent.withOpacity(0.5), - spinnerValue: spinner3, - onChange: (newValue) { - setState(() { - spinner3 = newValue; - }); - }, + ), + + // Set step ( can be int or double ) + Container( + margin: EdgeInsets.all(20), + child: SpinnerInput( + minValue: 0, + maxValue: 200, + step: 5, + plusButton: SpinnerButtonStyle( + elevation: 0, + color: Colors.blue, + borderRadius: BorderRadius.circular(0), ), - ), - - - - - // Disable long press and input-popup - Container( - margin: EdgeInsets.all(20), - child: SpinnerInput( - minValue: 0, - maxValue: 200, - disabledLongPress: true, - disabledPopup: true, - step: 5, - spinnerValue: spinner4, - onChange: (newValue) { - setState(() { - spinner4 = newValue; - }); - }, + minusButton: SpinnerButtonStyle( + elevation: 0, + color: Colors.red, + borderRadius: BorderRadius.circular(0), ), + middleNumberWidth: 70, + middleNumberStyle: TextStyle(fontSize: 21), + middleNumberBackground: Colors.yellowAccent.withOpacity(0.5), + spinnerValue: spinner3, + onChange: (newValue) { + setState(() { + spinner3 = newValue; + }); + }, ), - - - // A little more customized buttons - Container( - margin: EdgeInsets.all(20), - child: SpinnerInput( - minValue: 0, - maxValue: 200, - step: 5.524, - fractionDigits: 3, - plusButton: SpinnerButtonStyle( - color: Colors.green, - height: 60, - width: 60, - elevation: 1, - highlightElevation: 10, - child: Icon(Icons.thumb_up) - ), - minusButton: SpinnerButtonStyle( - color: Colors.red, - borderRadius: BorderRadius.circular(0), - ), - spinnerValue: spinner5, - onChange: (newValue) { - setState(() { - spinner5 = newValue; - }); - }, - ), + ), + + // Disable long press and input-popup + Container( + margin: EdgeInsets.all(20), + child: SpinnerInput( + minValue: 0, + maxValue: 200, + disabledLongPress: true, + disabledPopup: true, + step: 5, + spinnerValue: spinner4, + onChange: (newValue) { + setState(() { + spinner4 = newValue; + }); + }, ), - - - - // RTL support - Container( - margin: EdgeInsets.all(50), - child: SpinnerInput( - direction: TextDirection.rtl, - spinnerValue: spinner6, - onChange: (newValue) { - setState(() { - spinner6 = newValue; - }); - }, + ), + + // A little more customized buttons + Container( + margin: EdgeInsets.all(20), + child: SpinnerInput( + minValue: 0, + maxValue: 200, + step: 5.524, + fractionDigits: 3, + plusButton: SpinnerButtonStyle( + color: Colors.green, + height: 60, + width: 60, + elevation: 1, + highlightElevation: 10, + child: Icon(Icons.thumb_up), ), - ) - - - - - ], - ), - )); + minusButton: SpinnerButtonStyle( + color: Colors.red, + borderRadius: BorderRadius.circular(0), + ), + spinnerValue: spinner5, + onChange: (newValue) { + setState(() { + spinner5 = newValue; + }); + }, + ), + ), + + // RTL support + Container( + margin: EdgeInsets.all(50), + child: SpinnerInput( + direction: TextDirection.rtl, + spinnerValue: spinner6, + onChange: (newValue) { + setState(() { + spinner6 = newValue; + }); + }, + ), + ), + ], + ), + ), + ); } } From 67a17da0c5e36cef1872ef6a276dd6d7759b6749 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:33:26 -0700 Subject: [PATCH 16/38] Flutter (Dart) format main file --- lib/spinner_input.dart | 50 +++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index ce0feb3..a136476 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -101,8 +101,9 @@ class _SpinnerInputState extends State _focusNode.addListener(() { if (_focusNode.hasFocus) { textEditingController?.selection = TextSelection( - baseOffset: 0, - extentOffset: textEditingController?.value.text.length ?? 0); + baseOffset: 0, + extentOffset: textEditingController?.value.text.length ?? 0, + ); } }); @@ -171,7 +172,8 @@ class _SpinnerInputState extends State highlightColor: _minusSpinnerStyle.highlightColor, highlightElevation: _minusSpinnerStyle.highlightElevation, shape: new RoundedRectangleBorder( - borderRadius: _minusSpinnerStyle.borderRadius!), + borderRadius: _minusSpinnerStyle.borderRadius!, + ), onPressed: () { decrease(); }, @@ -191,23 +193,26 @@ class _SpinnerInputState extends State ), GestureDetector( onTap: () { - if (widget.disabledPopup == false && popupAnimationController != null) { + if (widget.disabledPopup == false && + popupAnimationController != null) { if (popupAnimationController!.isDismissed) { popupAnimationController!.forward(); _focusNode.requestFocus(); - } else + } else { popupAnimationController!.reverse(); + } } }, child: Container( - width: widget.middleNumberWidth, - padding: widget.middleNumberPadding, - color: widget.middleNumberBackground, - child: Text( - _formatted(widget.spinnerValue), - textAlign: TextAlign.center, - style: widget.middleNumberStyle, - )), + width: widget.middleNumberWidth, + padding: widget.middleNumberPadding, + color: widget.middleNumberBackground, + child: Text( + _formatted(widget.spinnerValue), + textAlign: TextAlign.center, + style: widget.middleNumberStyle, + ), + ), ), Container( width: _plusSpinnerStyle.width, @@ -221,7 +226,8 @@ class _SpinnerInputState extends State color: _plusSpinnerStyle.color, textColor: _plusSpinnerStyle.textColor, shape: new RoundedRectangleBorder( - borderRadius: _plusSpinnerStyle.borderRadius!), + borderRadius: _plusSpinnerStyle.borderRadius!, + ), onPressed: () { increase(); }, @@ -287,8 +293,9 @@ class _SpinnerInputState extends State return ScaleTransition( scale: CurvedAnimation( - parent: popupAnimationController!, - curve: Interval(0.0, 1.0, curve: Curves.elasticOut)), + parent: popupAnimationController!, + curve: Interval(0.0, 1.0, curve: Curves.elasticOut), + ), child: Center( child: Container( padding: EdgeInsets.all(5), @@ -321,8 +328,9 @@ class _SpinnerInputState extends State textAlign: TextAlign.center, style: widget.popupTextStyle, decoration: InputDecoration( - contentPadding: EdgeInsets.all(0), - border: InputBorder.none), + contentPadding: EdgeInsets.all(0), + border: InputBorder.none, + ), controller: textEditingController, ), ), @@ -338,13 +346,15 @@ class _SpinnerInputState extends State highlightColor: _popupButtonStyle.highlightColor, highlightElevation: _popupButtonStyle.highlightElevation, shape: new RoundedRectangleBorder( - borderRadius: _popupButtonStyle.borderRadius!), + borderRadius: _popupButtonStyle.borderRadius!, + ), onPressed: () { FocusScope.of(context).requestFocus(new FocusNode()); try { double value = widget.numberFormat != null ? widget.numberFormat! - .parse(textEditingController?.text ?? "0").toDouble() + .parse(textEditingController?.text ?? "0") + .toDouble() : double.parse(textEditingController?.text ?? "0"); if (value <= widget.maxValue && value >= widget.minValue) { From 1c1b3c22ea4391456d8df74bb5209b659d2f1aae Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:38:13 -0700 Subject: [PATCH 17/38] Filling license. To follow my other two plugins, it's MIT --- LICENSE | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ba75c69..2a4c522 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,21 @@ -TODO: Add your license here. +MIT License + +2023 Copyright (c) Csaba Tóth. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 39ab3950b46f49354b3b48e0c20ad2f1d5b9bea7 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:39:34 -0700 Subject: [PATCH 18/38] Extra empty line end removal --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 50e3d7e..4e33878 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,3 @@ A Spinner Input for flutter like HTML5 input-spinner You can find examples in example directory ![](intro.gif) - From 38abde6b845a8a44c93e8b5e15cd2d76a53aa243 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 16:51:21 -0700 Subject: [PATCH 19/38] Start articulating the new spinner_input_plus plugin --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 528d27c..af365b2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ -name: spinner_input +name: spinner_input_plus description: A Spinner Input for flutter. like html5 input-spinners version: 0.1.2 -homepage: https://github.com/Ali-Azmoud/spinner_input +homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: sdk: '>=2.12.0 <4.0.0' From f3817070a96c6b6a2907fec5eb21b8beec306925 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:05:31 -0700 Subject: [PATCH 20/38] Introducing linter and analyzer --- analysis_options.yaml | 8 ++++ pubspec.lock | 104 ++++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 4 +- 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 analysis_options.yaml diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..91cdf64 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,8 @@ +include: package:flutter_lints/flutter.yaml + +# https://dart-lang.github.io/linter/lints/index.html +# https://dart.dev/guides/language/analysis-options +linter: + rules: + +analyzer: diff --git a/pubspec.lock b/pubspec.lock index 92bd5a5..dc72272 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,22 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" + source: hosted + version: "64.0.0" + analyzer: + dependency: "direct dev" + description: + name: analyzer + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" + source: hosted + version: "6.2.0" async: dependency: transitive description: @@ -41,6 +57,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.2" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" fake_async: dependency: transitive description: @@ -49,16 +81,40 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" intl: dependency: "direct main" description: @@ -67,6 +123,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" matcher: dependency: transitive description: @@ -91,6 +155,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -99,6 +171,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" sky_engine: dependency: transitive description: flutter @@ -152,6 +232,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" vector_math: dependency: transitive description: @@ -160,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" web: dependency: transitive description: @@ -168,5 +264,13 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.4-beta" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index af365b2..bba78cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spinner_input_plus description: A Spinner Input for flutter. like html5 input-spinners -version: 0.1.2 +version: 0.0.1 homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: @@ -12,6 +12,8 @@ dependencies: sdk: flutter dev_dependencies: + analyzer: ^6.2.0 + flutter_lints: ^2.0.2 flutter_test: sdk: flutter From 0d387c68d79f69a883f48a40870ec43e51929675 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:06:12 -0700 Subject: [PATCH 21/38] Remove lengthy comments form pubspec --- pubspec.yaml | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index bba78cc..2f8f789 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,39 +17,4 @@ dev_dependencies: flutter_test: sdk: flutter -# For information on the generic Dart part of this file, see the -# following page: https://www.dartlang.org/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.io/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.io/assets-and-images/#resolution-aware. - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.io/custom-fonts/#from-packages From 71374e727b4e3758f19de07f7232106d66d0c462 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:06:47 -0700 Subject: [PATCH 22/38] Analyzer and linter reported changes --- example/example.dart | 22 +++++++++--------- lib/spinner_input.dart | 51 +++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/example/example.dart b/example/example.dart index bc8fc50..ba035a5 100644 --- a/example/example.dart +++ b/example/example.dart @@ -1,14 +1,16 @@ import 'package:flutter/material.dart'; import 'package:spinner_input/spinner_input.dart'; -void main() => runApp(MySpinner()); +void main() => runApp(const MySpinner()); class MySpinner extends StatefulWidget { + const MySpinner({Key? key}) : super(key: key); + @override - _MySpinnerState createState() => _MySpinnerState(); + MySpinnerState createState() => MySpinnerState(); } -class _MySpinnerState extends State { +class MySpinnerState extends State { double spinner = 0; double spinner3 = -5; double spinner4 = 20; @@ -24,7 +26,7 @@ class _MySpinnerState extends State { children: [ // default spinner Container( - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: SpinnerInput( spinnerValue: spinner, // minValue: 0, @@ -39,7 +41,7 @@ class _MySpinnerState extends State { // Set step ( can be int or double ) Container( - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: SpinnerInput( minValue: 0, maxValue: 200, @@ -55,7 +57,7 @@ class _MySpinnerState extends State { borderRadius: BorderRadius.circular(0), ), middleNumberWidth: 70, - middleNumberStyle: TextStyle(fontSize: 21), + middleNumberStyle: const TextStyle(fontSize: 21), middleNumberBackground: Colors.yellowAccent.withOpacity(0.5), spinnerValue: spinner3, onChange: (newValue) { @@ -68,7 +70,7 @@ class _MySpinnerState extends State { // Disable long press and input-popup Container( - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: SpinnerInput( minValue: 0, maxValue: 200, @@ -86,7 +88,7 @@ class _MySpinnerState extends State { // A little more customized buttons Container( - margin: EdgeInsets.all(20), + margin: const EdgeInsets.all(20), child: SpinnerInput( minValue: 0, maxValue: 200, @@ -98,7 +100,7 @@ class _MySpinnerState extends State { width: 60, elevation: 1, highlightElevation: 10, - child: Icon(Icons.thumb_up), + child: const Icon(Icons.thumb_up), ), minusButton: SpinnerButtonStyle( color: Colors.red, @@ -115,7 +117,7 @@ class _MySpinnerState extends State { // RTL support Container( - margin: EdgeInsets.all(50), + margin: const EdgeInsets.all(50), child: SpinnerInput( direction: TextDirection.rtl, spinnerValue: spinner6, diff --git a/lib/spinner_input.dart b/lib/spinner_input.dart index a136476..58593e1 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input.dart @@ -49,7 +49,8 @@ class SpinnerInput extends StatefulWidget { final TextStyle popupTextStyle; final TextDirection direction; - SpinnerInput({ + const SpinnerInput({ + Key? key, required this.spinnerValue, this.middleNumberWidth, this.middleNumberBackground, @@ -70,13 +71,13 @@ class SpinnerInput extends StatefulWidget { this.direction = TextDirection.ltr, this.popupTextStyle = const TextStyle(fontSize: 18, color: Colors.black87, height: 1.15), - }); + }) : super(key: key); @override - _SpinnerInputState createState() => _SpinnerInputState(); + SpinnerInputState createState() => SpinnerInputState(); } -class _SpinnerInputState extends State +class SpinnerInputState extends State with TickerProviderStateMixin { TextEditingController? textEditingController; AnimationController? popupAnimationController; @@ -95,8 +96,8 @@ class _SpinnerInputState extends State TextEditingController(text: _formatted(widget.spinnerValue)); /// popup animation controller - popupAnimationController = - AnimationController(vsync: this, duration: Duration(milliseconds: 500)); + popupAnimationController = AnimationController( + vsync: this, duration: const Duration(milliseconds: 500)); _focusNode.addListener(() { if (_focusNode.hasFocus) { @@ -109,8 +110,8 @@ class _SpinnerInputState extends State // initialize buttons _plusSpinnerStyle = widget.plusButton ?? SpinnerButtonStyle(); - _plusSpinnerStyle.child ??= Icon(Icons.add); - _plusSpinnerStyle.color ??= Color(0xff9EA8F0); + _plusSpinnerStyle.child ??= const Icon(Icons.add); + _plusSpinnerStyle.color ??= const Color(0xff9EA8F0); _plusSpinnerStyle.textColor ??= Colors.white; _plusSpinnerStyle.borderRadius ??= BorderRadius.circular(50); _plusSpinnerStyle.width ??= 35; @@ -120,8 +121,8 @@ class _SpinnerInputState extends State _plusSpinnerStyle.highlightElevation ??= null; _minusSpinnerStyle = widget.minusButton ?? SpinnerButtonStyle(); - _minusSpinnerStyle.child ??= Icon(Icons.remove); - _minusSpinnerStyle.color ??= Color(0xff9EA8F0); + _minusSpinnerStyle.child ??= const Icon(Icons.remove); + _minusSpinnerStyle.color ??= const Color(0xff9EA8F0); _minusSpinnerStyle.textColor ??= Colors.white; _minusSpinnerStyle.borderRadius ??= BorderRadius.circular(50); _minusSpinnerStyle.width ??= 35; @@ -131,7 +132,7 @@ class _SpinnerInputState extends State _minusSpinnerStyle.highlightElevation ??= null; _popupButtonStyle = widget.popupButton ?? SpinnerButtonStyle(); - _popupButtonStyle.child ??= Icon(Icons.check); + _popupButtonStyle.child ??= const Icon(Icons.check); _popupButtonStyle.color ??= Colors.lightGreen; _popupButtonStyle.textColor ??= Colors.white; _popupButtonStyle.borderRadius ??= BorderRadius.circular(5); @@ -160,18 +161,18 @@ class _SpinnerInputState extends State Row( mainAxisSize: MainAxisSize.min, children: [ - Container( + SizedBox( width: _minusSpinnerStyle.width, height: _minusSpinnerStyle.height, child: GestureDetector( child: MaterialButton( - padding: EdgeInsets.all(0), + padding: const EdgeInsets.all(0), color: _minusSpinnerStyle.color, textColor: _minusSpinnerStyle.textColor, elevation: _minusSpinnerStyle.elevation, highlightColor: _minusSpinnerStyle.highlightColor, highlightElevation: _minusSpinnerStyle.highlightElevation, - shape: new RoundedRectangleBorder( + shape: RoundedRectangleBorder( borderRadius: _minusSpinnerStyle.borderRadius!, ), onPressed: () { @@ -214,7 +215,7 @@ class _SpinnerInputState extends State ), ), ), - Container( + SizedBox( width: _plusSpinnerStyle.width, height: _plusSpinnerStyle.height, child: GestureDetector( @@ -222,10 +223,10 @@ class _SpinnerInputState extends State elevation: _plusSpinnerStyle.elevation, highlightColor: _plusSpinnerStyle.highlightColor, highlightElevation: _plusSpinnerStyle.highlightElevation, - padding: EdgeInsets.all(0), + padding: const EdgeInsets.all(0), color: _plusSpinnerStyle.color, textColor: _plusSpinnerStyle.textColor, - shape: new RoundedRectangleBorder( + shape: RoundedRectangleBorder( borderRadius: _plusSpinnerStyle.borderRadius!, ), onPressed: () { @@ -294,15 +295,15 @@ class _SpinnerInputState extends State return ScaleTransition( scale: CurvedAnimation( parent: popupAnimationController!, - curve: Interval(0.0, 1.0, curve: Curves.elasticOut), + curve: const Interval(0.0, 1.0, curve: Curves.elasticOut), ), child: Center( child: Container( - padding: EdgeInsets.all(5), + padding: const EdgeInsets.all(5), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5), - boxShadow: [ + boxShadow: const [ BoxShadow( color: Colors.black12, blurRadius: 10, @@ -327,7 +328,7 @@ class _SpinnerInputState extends State keyboardType: TextInputType.number, textAlign: TextAlign.center, style: widget.popupTextStyle, - decoration: InputDecoration( + decoration: const InputDecoration( contentPadding: EdgeInsets.all(0), border: InputBorder.none, ), @@ -335,21 +336,21 @@ class _SpinnerInputState extends State ), ), Expanded( - child: Container( + child: SizedBox( width: _popupButtonStyle.width, height: _popupButtonStyle.height, child: MaterialButton( - padding: EdgeInsets.all(1), + padding: const EdgeInsets.all(1), color: _popupButtonStyle.color, textColor: _popupButtonStyle.textColor, elevation: _popupButtonStyle.elevation, highlightColor: _popupButtonStyle.highlightColor, highlightElevation: _popupButtonStyle.highlightElevation, - shape: new RoundedRectangleBorder( + shape: RoundedRectangleBorder( borderRadius: _popupButtonStyle.borderRadius!, ), onPressed: () { - FocusScope.of(context).requestFocus(new FocusNode()); + FocusScope.of(context).requestFocus(FocusNode()); try { double value = widget.numberFormat != null ? widget.numberFormat! From 65dd28e9f1b604ab4a489b4a52b345a56f61a582 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:07:21 -0700 Subject: [PATCH 23/38] Moving towards the new plugin --- example/example.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/example.dart b/example/example.dart index ba035a5..75f82f7 100644 --- a/example/example.dart +++ b/example/example.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spinner_input/spinner_input.dart'; +import 'package:spinner_input_plus/spinner_input.dart'; void main() => runApp(const MySpinner()); From 40a444b3d4cb546662ddb98997a2b08ae96dbb18 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:07:33 -0700 Subject: [PATCH 24/38] Initial changelog --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 970cfef..9c23278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,9 @@ -## [0.0.1] - 02/09/2019. +## [0.0.1] - 08/20/2023 + +- Initial release +- Fork a fork of [spinner_inout](https://pub.dev/packages/spinner_input) +- Original: [spinner_input](https://github.com/Ali-Azmoud/spinner_input) +- The fork source: [spinner_input](https://github.com/ened/spinner_input) +- Upgrade dependencies +- Brush up code +- Introducing Analyzer and Linter and fixing reported issue From c72c43cfe3fccb0fb8fc8f3d20ccf215940632a1 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sun, 20 Aug 2023 17:08:21 -0700 Subject: [PATCH 25/38] Moving further towards the new plugin --- example/example.dart | 2 +- lib/{spinner_input.dart => spinner_input_plus.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/{spinner_input.dart => spinner_input_plus.dart} (100%) diff --git a/example/example.dart b/example/example.dart index 75f82f7..ff71222 100644 --- a/example/example.dart +++ b/example/example.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spinner_input_plus/spinner_input.dart'; +import 'package:spinner_input_plus/spinner_input_plus.dart'; void main() => runApp(const MySpinner()); diff --git a/lib/spinner_input.dart b/lib/spinner_input_plus.dart similarity index 100% rename from lib/spinner_input.dart rename to lib/spinner_input_plus.dart From 6818740af98faa83225650073a6837175beb7de6 Mon Sep 17 00:00:00 2001 From: Csaba Toth Date: Mon, 1 Jan 2024 15:10:33 -0800 Subject: [PATCH 26/38] Longer description (60-180 chars) to increase pub score Message "The package description is too short. " Ref https://github.com/dart-lang/pana/issues/416 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 2f8f789..f91d996 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: spinner_input_plus -description: A Spinner Input for flutter. like html5 input-spinners +description: A Spinner Input for flutter. Almost like html5 input-spinners, it has up/down buttons and also explicit value edit capability. version: 0.0.1 homepage: https://github.com/CsabaConsulting/spinner_input_plus From 2eccbddcbc3feecd8fc63b7a82c816a7acb3fecf Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 15:20:17 -0800 Subject: [PATCH 27/38] Upgrade dependencies to latest --- pubspec.lock | 74 ++++++++++++++++++++++++++++++++++------------------ pubspec.yaml | 6 ++--- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index dc72272..d765ede 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49" url: "https://pub.dev" source: hosted - version: "64.0.0" + version: "65.0.0" analyzer: dependency: "direct dev" description: name: analyzer - sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07 url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "6.3.0" async: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -98,10 +98,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -119,18 +119,34 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739" + url: "https://pub.dev" + source: hosted + version: "9.0.16" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff + url: "https://pub.dev" + source: hosted + version: "1.0.5" lints: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" matcher: dependency: transitive description: @@ -143,18 +159,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" package_config: dependency: transitive description: @@ -196,18 +212,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -228,10 +244,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" typed_data: dependency: transitive description: @@ -248,6 +264,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: @@ -260,10 +284,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.4.0" yaml: dependency: transitive description: @@ -273,4 +297,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index f91d996..e2acd0d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,13 +7,13 @@ environment: sdk: '>=2.12.0 <4.0.0' dependencies: - intl: ^0.18.1 + intl: ^0.19.0 flutter: sdk: flutter dev_dependencies: - analyzer: ^6.2.0 - flutter_lints: ^2.0.2 + analyzer: ^6.3.0 + flutter_lints: ^3.0.1 flutter_test: sdk: flutter From 62a33bea511c914ab61d8bcbfe7110d050535775 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 16:39:05 -0800 Subject: [PATCH 28/38] Adding code comments, fixes #4 --- lib/spinner_input_plus.dart | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/spinner_input_plus.dart b/lib/spinner_input_plus.dart index 58593e1..2a8e783 100644 --- a/lib/spinner_input_plus.dart +++ b/lib/spinner_input_plus.dart @@ -3,17 +3,25 @@ import 'dart:async'; import 'package:intl/intl.dart' as intl; -/// Spinner Input like HTML5 spinners +/// Spinner Input Button Style class SpinnerButtonStyle { + /// Color of the spinner button Color? color; + /// Text color of the spinner button Color? textColor; Widget? child; + /// Width of the spinner button double? width; + /// Height of the spinner button double? height; + /// Border radius of the spinner button BorderRadius? borderRadius; + /// Height elevation of the spinner button double? highlightElevation; + /// Highlight color of the spinner button Color? highlightColor; + /// Elevation of the spinner button double? elevation; SpinnerButtonStyle( @@ -28,25 +36,45 @@ class SpinnerButtonStyle { this.elevation}); } +/// Spinner Input like HTML5 spinners class SpinnerInput extends StatefulWidget { + /// Disable the value edit popup final bool disabledPopup; + /// The initial spinner value final double spinnerValue; + /// Width of the text in the middle (displaying current value) final double? middleNumberWidth; + /// Padding of the text in the middle (displaying current value) final EdgeInsets middleNumberPadding; + /// Text style in the middle (displaying current value) final TextStyle middleNumberStyle; + /// Background of the text in the middle (displaying current value) final Color? middleNumberBackground; + /// The minimum allowed spinner value final double minValue; + /// The maximum allowed spinner value final double maxValue; + /// Step size of one spinner tick final double step; + /// Number of fractional digits displayed final int fractionDigits; + /// Speed of the long press (duration) final Duration longPressSpeed; + /// OnChange handler callback final Function(double newValue)? onChange; + /// Is long press disabled final bool disabledLongPress; + /// Plus button's style final SpinnerButtonStyle? plusButton; + /// Minus button's style final SpinnerButtonStyle? minusButton; + /// Popup button's style final SpinnerButtonStyle? popupButton; + /// Number format of the spinner value final intl.NumberFormat? numberFormat; + /// Text style of the value edit popup final TextStyle popupTextStyle; + /// Text direction of the value edit popup final TextDirection direction; const SpinnerInput({ From 02a29a45bd1acae6b59ba57038fc27fc9f1c35e1 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 16:43:58 -0800 Subject: [PATCH 29/38] Version bump for new release --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e2acd0d..a626fbf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spinner_input_plus description: A Spinner Input for flutter. Almost like html5 input-spinners, it has up/down buttons and also explicit value edit capability. -version: 0.0.1 +version: 0.0.2 homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: From 82b415d74630568d2a6189709925bf6503737d6a Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 16:44:12 -0800 Subject: [PATCH 30/38] Changelog for new release --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c23278..c1809f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,8 @@ - Upgrade dependencies - Brush up code - Introducing Analyzer and Linter and fixing reported issue + +# [0.0.2] - 01/01/2024 + +- Increase description length to fall between 60-180 to increase pub score. +- Adding code comments (partially the goal is to increase pub score) From 1f3e72f80fe7e6a56dad548dfc00b00a2132a7f5 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 17:22:04 -0800 Subject: [PATCH 31/38] Completing changelog (package version increases) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1809f1..17c2984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,3 +12,4 @@ - Increase description length to fall between 60-180 to increase pub score. - Adding code comments (partially the goal is to increase pub score) +- Increase package versions From 4b14859b48420dc2429ecbc0c6f85d270562acfc Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 17:25:51 -0800 Subject: [PATCH 32/38] New release to correct code format after code documentation --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a626fbf..6f82a1b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spinner_input_plus description: A Spinner Input for flutter. Almost like html5 input-spinners, it has up/down buttons and also explicit value edit capability. -version: 0.0.2 +version: 0.0.3 homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: From 160ed487473ada5c143a659820e7cbfd7cea992c Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 17:28:32 -0800 Subject: [PATCH 33/38] Correct code format after code documentation: fields require now extra new line separation, fixes #5 --- lib/spinner_input_plus.dart | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/spinner_input_plus.dart b/lib/spinner_input_plus.dart index 2a8e783..1882ff1 100644 --- a/lib/spinner_input_plus.dart +++ b/lib/spinner_input_plus.dart @@ -11,16 +11,22 @@ class SpinnerButtonStyle { /// Text color of the spinner button Color? textColor; Widget? child; + /// Width of the spinner button double? width; + /// Height of the spinner button double? height; + /// Border radius of the spinner button BorderRadius? borderRadius; + /// Height elevation of the spinner button double? highlightElevation; + /// Highlight color of the spinner button Color? highlightColor; + /// Elevation of the spinner button double? elevation; @@ -40,40 +46,58 @@ class SpinnerButtonStyle { class SpinnerInput extends StatefulWidget { /// Disable the value edit popup final bool disabledPopup; + /// The initial spinner value final double spinnerValue; + /// Width of the text in the middle (displaying current value) final double? middleNumberWidth; + /// Padding of the text in the middle (displaying current value) final EdgeInsets middleNumberPadding; + /// Text style in the middle (displaying current value) final TextStyle middleNumberStyle; + /// Background of the text in the middle (displaying current value) final Color? middleNumberBackground; + /// The minimum allowed spinner value final double minValue; + /// The maximum allowed spinner value final double maxValue; + /// Step size of one spinner tick final double step; + /// Number of fractional digits displayed final int fractionDigits; + /// Speed of the long press (duration) final Duration longPressSpeed; + /// OnChange handler callback final Function(double newValue)? onChange; + /// Is long press disabled final bool disabledLongPress; + /// Plus button's style final SpinnerButtonStyle? plusButton; + /// Minus button's style final SpinnerButtonStyle? minusButton; + /// Popup button's style final SpinnerButtonStyle? popupButton; + /// Number format of the spinner value final intl.NumberFormat? numberFormat; + /// Text style of the value edit popup final TextStyle popupTextStyle; + /// Text direction of the value edit popup final TextDirection direction; From 3d8471f5538811e25eb3f6686f139201a73166cd Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Mon, 1 Jan 2024 17:28:57 -0800 Subject: [PATCH 34/38] Adding changelog for 0.0.3 release (code formatting) --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17c2984..62ea207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,3 +13,7 @@ - Increase description length to fall between 60-180 to increase pub score. - Adding code comments (partially the goal is to increase pub score) - Increase package versions + +# [0.0.3] - 01/01/2024 + +- Correct code format after code documentation: fields require now extra new line separation From 0bdaab8f486e8daf89a9624a01119c1e889f3f35 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sat, 25 Jan 2025 23:03:57 -0800 Subject: [PATCH 35/38] Upgrade package versions --- pubspec.lock | 98 ++++++++++++++++++++++++++++++---------------------- pubspec.yaml | 10 +++--- 2 files changed, 60 insertions(+), 48 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index d765ede..86cfff4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49" + sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c" url: "https://pub.dev" source: hosted - version: "65.0.0" + version: "79.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" analyzer: dependency: "direct dev" description: name: analyzer - sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07 + sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "7.2.0" async: dependency: transitive description: @@ -53,10 +58,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: @@ -98,10 +103,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "5.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -119,58 +124,74 @@ packages: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "9.0.16" + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "3.0.1" lints: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "0.1.3-main.0" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.15.0" package_config: dependency: transitive description: @@ -183,10 +204,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" pub_semver: dependency: transitive description: @@ -199,7 +220,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -212,10 +233,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -228,10 +249,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -244,10 +265,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.3" typed_data: dependency: transitive description: @@ -268,10 +289,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.3.0" watcher: dependency: transitive description: @@ -280,14 +301,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa - url: "https://pub.dev" - source: hosted - version: "0.4.0" yaml: dependency: transitive description: @@ -297,4 +310,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 6f82a1b..e63d79d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,20 +1,18 @@ name: spinner_input_plus description: A Spinner Input for flutter. Almost like html5 input-spinners, it has up/down buttons and also explicit value edit capability. -version: 0.0.3 +version: 0.0.4 homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: sdk: '>=2.12.0 <4.0.0' dependencies: - intl: ^0.19.0 + intl: ^0.20.2 flutter: sdk: flutter dev_dependencies: - analyzer: ^6.3.0 - flutter_lints: ^3.0.1 + analyzer: ^7.2.0 + flutter_lints: ^5.0.0 flutter_test: sdk: flutter - -flutter: From 947c78a44e09aca36a1791381b05709dd19a4474 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sat, 25 Jan 2025 23:04:19 -0800 Subject: [PATCH 36/38] Sooth Flutter lint / analyzer issue --- example/example.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/example.dart b/example/example.dart index ff71222..88f4356 100644 --- a/example/example.dart +++ b/example/example.dart @@ -58,7 +58,7 @@ class MySpinnerState extends State { ), middleNumberWidth: 70, middleNumberStyle: const TextStyle(fontSize: 21), - middleNumberBackground: Colors.yellowAccent.withOpacity(0.5), + middleNumberBackground: Colors.yellowAccent.withAlpha(128), spinnerValue: spinner3, onChange: (newValue) { setState(() { From 686dc426e8ec3b6589f3d627a16a7cfca338e88d Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sat, 25 Jan 2025 23:04:30 -0800 Subject: [PATCH 37/38] Changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62ea207..7635759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,3 +17,7 @@ # [0.0.3] - 01/01/2024 - Correct code format after code documentation: fields require now extra new line separation + +# [0.0.4] - 01/25/2024 + +- Increase package versions From 09d3059296fcf745b7a970dd2f33e528b6ce97a8 Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sat, 6 Dec 2025 12:53:04 -0800 Subject: [PATCH 38/38] Upgrade analyzer, linter, and Flutter SDK to check for deprecations and warnings --- pubspec.lock | 147 +++++++++++++++++++++++---------------------------- pubspec.yaml | 4 +- 2 files changed, 69 insertions(+), 82 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 86cfff4..59bf1af 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,95 +5,90 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c" + sha256: "5b7468c326d2f8a4f630056404ca0d291ade42918f4a3c6233618e724f39da8e" url: "https://pub.dev" source: hosted - version: "79.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" + version: "92.0.0" analyzer: dependency: "direct dev" description: name: analyzer - sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643 + sha256: "70e4b1ef8003c64793a9e268a551a82869a8a96f39deb73dea28084b0e8bf75e" url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "9.0.0" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.7" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" file: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" flutter: dependency: "direct main" description: flutter @@ -103,10 +98,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -116,10 +111,10 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" intl: dependency: "direct main" description: @@ -132,50 +127,42 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 - url: "https://pub.dev" - source: hosted - version: "5.1.1" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "0.1.3-main.0" + version: "6.0.0" matcher: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -188,34 +175,34 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" package_config: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" pub_semver: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" sky_engine: dependency: transitive description: flutter @@ -225,90 +212,90 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.7" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "15.0.2" watcher: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.4" yaml: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.6.0 <4.0.0" + dart: ">=3.9.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index e63d79d..5fe60c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter dev_dependencies: - analyzer: ^7.2.0 - flutter_lints: ^5.0.0 + analyzer: ^9.0.0 + flutter_lints: ^6.0.0 flutter_test: sdk: flutter