diff --git a/.gitignore b/.gitignore index 446ed0d..e63af0b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .packages .pub/ +.idea build/ ios/.generated/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 970cfef..7635759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,23 @@ -## [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 + +# [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) +- Increase package versions + +# [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 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. 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) - 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/example/example.dart b/example/example.dart index f9eba5d..88f4356 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'; +import 'package:spinner_input_plus/spinner_input_plus.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; @@ -18,122 +20,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: const 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: const 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: const TextStyle(fontSize: 21), + middleNumberBackground: Colors.yellowAccent.withAlpha(128), + 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: const 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: const 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: const Icon(Icons.thumb_up), ), - ) - - - - - ], - ), - )); + minusButton: SpinnerButtonStyle( + color: Colors.red, + borderRadius: BorderRadius.circular(0), + ), + spinnerValue: spinner5, + onChange: (newValue) { + setState(() { + spinner5 = newValue; + }); + }, + ), + ), + + // RTL support + Container( + margin: const EdgeInsets.all(50), + child: SpinnerInput( + direction: TextDirection.rtl, + spinnerValue: spinner6, + onChange: (newValue) { + setState(() { + spinner6 = newValue; + }); + }, + ), + ), + ], + ), + ), + ); } } diff --git a/lib/spinner_input.dart b/lib/spinner_input_plus.dart similarity index 52% rename from lib/spinner_input.dart rename to lib/spinner_input_plus.dart index fa3e9ad..1882ff1 100644 --- a/lib/spinner_input.dart +++ b/lib/spinner_input_plus.dart @@ -1,19 +1,34 @@ import 'package:flutter/material.dart'; import 'dart:async'; +import 'package:intl/intl.dart' as intl; -/// Spinner Input like HTML5 spinners +/// Spinner Input Button Style class SpinnerButtonStyle { - Color color; + /// 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; - Color textColor; - Widget child; - double width; - double height; - BorderRadius borderRadius; - double highlightElevation; - Color highlightColor; - double elevation; + /// Height elevation of the spinner button + double? highlightElevation; + + /// Highlight color of the spinner button + Color? highlightColor; + + /// Elevation of the spinner button + double? elevation; SpinnerButtonStyle( {this.color, @@ -27,92 +42,128 @@ 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; - final double middleNumberWidth; + + /// 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; - final Color middleNumberBackground; + + /// 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; - final Function(double newValue) onChange; + + /// OnChange handler callback + final Function(double newValue)? onChange; + + /// Is long press disabled final bool disabledLongPress; - final SpinnerButtonStyle plusButton; - final SpinnerButtonStyle minusButton; - final SpinnerButtonStyle popupButton; + + /// 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; - SpinnerInput({ - @required this.spinnerValue, + const SpinnerInput({ + Key? key, + required this.spinnerValue, this.middleNumberWidth, 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, this.plusButton, this.minusButton, this.popupButton, + this.numberFormat, 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; + TextEditingController? textEditingController; + AnimationController? popupAnimationController; final _focusNode = FocusNode(); - Timer timer; - double _spinnerValue; + Timer? timer; - SpinnerButtonStyle _plusSpinnerStyle; - SpinnerButtonStyle _minusSpinnerStyle; - SpinnerButtonStyle _popupButtonStyle; + SpinnerButtonStyle _plusSpinnerStyle = SpinnerButtonStyle(); + SpinnerButtonStyle _minusSpinnerStyle = SpinnerButtonStyle(); + SpinnerButtonStyle _popupButtonStyle = SpinnerButtonStyle(); @override void initState() { - - /// initializing variables - _spinnerValue = widget.spinnerValue; - - /// popup textfield - textEditingController = TextEditingController( - text: widget.spinnerValue.toStringAsFixed(widget.fractionDigits)); + /// popup text field + textEditingController = + 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) { - textEditingController.selection = TextSelection( - baseOffset: 0, - extentOffset: textEditingController.value.text.length); + textEditingController?.selection = TextSelection( + baseOffset: 0, + extentOffset: textEditingController?.value.text.length ?? 0, + ); } }); - // 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; @@ -122,8 +173,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; @@ -133,7 +184,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); @@ -149,7 +200,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(); } @@ -162,19 +213,20 @@ class _SpinnerInputState extends State Row( mainAxisSize: MainAxisSize.min, children: [ - Container( + SizedBox( width: _minusSpinnerStyle.width, height: _minusSpinnerStyle.height, child: GestureDetector( - child: RaisedButton( - padding: EdgeInsets.all(0), + child: MaterialButton( + padding: const EdgeInsets.all(0), color: _minusSpinnerStyle.color, textColor: _minusSpinnerStyle.textColor, elevation: _minusSpinnerStyle.elevation, highlightColor: _minusSpinnerStyle.highlightColor, highlightElevation: _minusSpinnerStyle.highlightElevation, - shape: new RoundedRectangleBorder( - borderRadius: _minusSpinnerStyle.borderRadius), + shape: RoundedRectangleBorder( + borderRadius: _minusSpinnerStyle.borderRadius!, + ), onPressed: () { decrease(); }, @@ -188,43 +240,47 @@ class _SpinnerInputState extends State } }, onLongPressUp: () { - if (timer != null) timer.cancel(); + timer?.cancel(); }, ), ), GestureDetector( onTap: () { - if (widget.disabledPopup == false) { - if (popupAnimationController.isDismissed) { - popupAnimationController.forward(); - } else - popupAnimationController.reverse(); + if (widget.disabledPopup == false && + popupAnimationController != null) { + if (popupAnimationController!.isDismissed) { + popupAnimationController!.forward(); + _focusNode.requestFocus(); + } else { + popupAnimationController!.reverse(); + } } }, child: Container( - width: widget.middleNumberWidth, - padding: widget.middleNumberPadding, - color: widget.middleNumberBackground, - child: Text( - widget.spinnerValue - .toStringAsFixed(widget.fractionDigits), - 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( + SizedBox( width: _plusSpinnerStyle.width, height: _plusSpinnerStyle.height, child: GestureDetector( - child: RaisedButton( + child: MaterialButton( 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( - borderRadius: _plusSpinnerStyle.borderRadius), + shape: RoundedRectangleBorder( + borderRadius: _plusSpinnerStyle.borderRadius!, + ), onPressed: () { increase(); }, @@ -238,44 +294,47 @@ class _SpinnerInputState extends State } }, onLongPressUp: () { - if (timer != null) timer.cancel(); + timer?.cancel(); }, ), ), ], ), - 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(), + ), ], ), ); } void increase() { - double value = _spinnerValue; + double value = widget.spinnerValue; value += widget.step; if (value <= widget.maxValue) { - textEditingController.text = value.toStringAsFixed(widget.fractionDigits); - _spinnerValue = value; + textEditingController?.text = _formatted(value); setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } } void decrease() { - double value = _spinnerValue; + double value = widget.spinnerValue; value -= widget.step; if (value >= widget.minValue) { - textEditingController.text = value.toStringAsFixed(widget.fractionDigits); - _spinnerValue = value; + textEditingController?.text = _formatted(value); setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } } @@ -287,15 +346,16 @@ class _SpinnerInputState extends State return ScaleTransition( scale: CurvedAnimation( - parent: popupAnimationController, - curve: Interval(0.0, 1.0, curve: Curves.elasticOut)), + parent: popupAnimationController!, + 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, @@ -307,49 +367,64 @@ 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, textAlign: TextAlign.center, style: widget.popupTextStyle, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(0), - border: InputBorder.none), + decoration: const InputDecoration( + contentPadding: EdgeInsets.all(0), + border: InputBorder.none, + ), controller: textEditingController, ), ), Expanded( - child: Container( + child: SizedBox( width: _popupButtonStyle.width, height: _popupButtonStyle.height, - child: RaisedButton( - padding: EdgeInsets.all(1), + child: MaterialButton( + padding: const EdgeInsets.all(1), color: _popupButtonStyle.color, textColor: _popupButtonStyle.textColor, elevation: _popupButtonStyle.elevation, highlightColor: _popupButtonStyle.highlightColor, highlightElevation: _popupButtonStyle.highlightElevation, - shape: new RoundedRectangleBorder( - borderRadius: _popupButtonStyle.borderRadius), + shape: RoundedRectangleBorder( + borderRadius: _popupButtonStyle.borderRadius!, + ), onPressed: () { - FocusScope.of(context).requestFocus(new FocusNode()); + FocusScope.of(context).requestFocus(FocusNode()); try { - double value = double.parse(textEditingController.text); + double value = widget.numberFormat != null + ? widget.numberFormat! + .parse(textEditingController?.text ?? "0") + .toDouble() + : double.parse(textEditingController?.text ?? "0"); if (value <= widget.maxValue && value >= widget.minValue) { - _spinnerValue = value; setState(() { - widget.onChange(value); + if (widget.onChange != null) { + widget.onChange!(value); + } }); } else { - textEditingController.text = _spinnerValue - .toStringAsFixed(widget.fractionDigits); + textEditingController?.text = + _formatted(widget.spinnerValue); } } catch (e) { - textEditingController.text = _spinnerValue - .toStringAsFixed(widget.fractionDigits); + textEditingController?.text = + _formatted(widget.spinnerValue); } - popupAnimationController.reset(); + popupAnimationController?.reset(); }, child: _popupButtonStyle.child, ), @@ -361,4 +436,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 224c7bb..59bf1af 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,132 +1,301 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "5b7468c326d2f8a4f630056404ca0d291ade42918f4a3c6233618e724f39da8e" + url: "https://pub.dev" + source: hosted + version: "92.0.0" + analyzer: + dependency: "direct dev" + description: + name: analyzer + sha256: "70e4b1ef8003c64793a9e268a551a82869a8a96f39deb73dea28084b0e8bf75e" + url: "https://pub.dev" + source: hosted + version: "9.0.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" source: hosted - version: "1.0.4" - charcode: + version: "2.1.2" + characters: dependency: transitive description: - name: charcode - url: "https://pub.dartlang.org" + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" source: hosted version: "1.1.2" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" source: hosted - version: "1.14.11" + version: "3.0.7" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" source: hosted - version: "0.12.3+1" + version: "0.11.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "1.17.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" source: hosted - version: "1.6.2" - quiver: + version: "1.9.1" + pub_semver: dependency: transitive description: - name: quiver - url: "https://pub.dartlang.org" + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.2.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" source: hosted - version: "1.9.3" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" source: hosted - version: "1.6.8" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.7.7" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "1.4.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" + url: "https://pub.dev" + source: hosted + version: "1.1.4" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "3.1.3" sdks: - dart: ">=2.0.0 <3.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 5a46a0a..5fe60c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,53 +1,18 @@ -name: spinner_input -description: A Spinner Input for flutter. like html5 input-spinners -version: 0.1.0 -author: Ali Azmoude -homepage: https://github.com/Ali-Azmoud/spinner_input +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.4 +homepage: https://github.com/CsabaConsulting/spinner_input_plus environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: '>=2.12.0 <4.0.0' dependencies: + intl: ^0.20.2 flutter: sdk: flutter dev_dependencies: + analyzer: ^9.0.0 + flutter_lints: ^6.0.0 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