diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml deleted file mode 100644 index 0d29021..0000000 --- a/example/analysis_options.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/example/lib/main.dart b/example/lib/main.dart index e965c2c..e3daa49 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -93,8 +93,10 @@ class ExampleApp extends StatelessWidget { onPressed: () { _openSecondSimpleItemPicker(context, countryList); }, - child: Text('Simple Item picker with different theme', - textAlign: TextAlign.center), + child: Text( + 'Simple Item picker with different theme', + textAlign: TextAlign.center, + ), ), ), SizedBox( @@ -112,8 +114,10 @@ class ExampleApp extends StatelessWidget { onPressed: () { _openDatePickerWithButtonStyle(context); }, - child: Text('Date Picker with button style', - textAlign: TextAlign.center), + child: Text( + 'Date Picker with button style', + textAlign: TextAlign.center, + ), ), ), SizedBox( @@ -186,8 +190,10 @@ class ExampleApp extends StatelessWidget { onPressed: () { _openDateTimePickerWithCustomButton(context); }, - child: Text('Bottom picker with custom button', - textAlign: TextAlign.center), + child: Text( + 'Bottom picker with custom button', + textAlign: TextAlign.center, + ), ), ), SizedBox( diff --git a/example/pubspec.lock b/example/pubspec.lock index 7fc366b..3e390fe 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -60,10 +60,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -83,18 +83,18 @@ 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: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -208,10 +208,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" sdks: dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/lib/bottom_picker.dart b/lib/bottom_picker.dart index e0c10c5..bcdea1b 100644 --- a/lib/bottom_picker.dart +++ b/lib/bottom_picker.dart @@ -33,7 +33,7 @@ class BottomPicker extends StatefulWidget { late BottomPickerType bottomPickerType; BottomPicker({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, required this.items, @@ -68,7 +68,7 @@ class BottomPicker extends StatefulWidget { this.buttonStyle, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { dateOrder = null; onRangeDateSubmitPressed = null; bottomPickerType = BottomPickerType.simple; @@ -80,7 +80,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.date({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, this.titlePadding = const EdgeInsets.all(0), @@ -116,7 +116,7 @@ class BottomPicker extends StatefulWidget { this.itemExtent = 35.0, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.date; bottomPickerType = BottomPickerType.dateTime; use24hFormat = false; @@ -125,7 +125,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.monthYear({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, this.titlePadding = const EdgeInsets.all(0), @@ -160,7 +160,7 @@ class BottomPicker extends StatefulWidget { this.itemExtent = 35.0, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.monthYear; bottomPickerType = BottomPickerType.dateTime; use24hFormat = false; @@ -170,7 +170,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.dateTime({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, this.titlePadding = const EdgeInsets.all(0), @@ -209,7 +209,7 @@ class BottomPicker extends StatefulWidget { this.showTimeSeparator = false, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.dateAndTime; bottomPickerType = BottomPickerType.dateTime; onRangeDateSubmitPressed = null; @@ -217,7 +217,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.time({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, required this.initialTime, @@ -255,7 +255,7 @@ class BottomPicker extends StatefulWidget { this.itemExtent = 30, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.time; bottomPickerType = BottomPickerType.time; dateOrder = null; @@ -265,7 +265,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.timer({ - Key? key, + super.key, required this.pickerTitle, this.timerPickerMode = CupertinoTimerPickerMode.hm, this.timerSecondsInterval = 1, @@ -301,7 +301,7 @@ class BottomPicker extends StatefulWidget { this.buttonStyle, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { dateOrder = null; onRangeDateSubmitPressed = null; bottomPickerType = BottomPickerType.timer; @@ -311,7 +311,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.range({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, required this.onRangeDateSubmitPressed, @@ -348,7 +348,7 @@ class BottomPicker extends StatefulWidget { this.itemExtent = 30, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.date; bottomPickerType = BottomPickerType.rangeDate; dateOrder = null; @@ -372,7 +372,7 @@ class BottomPicker extends StatefulWidget { } BottomPicker.rangeTime({ - Key? key, + super.key, required this.pickerTitle, this.pickerDescription, required this.onRangeTimeSubmitPressed, @@ -411,7 +411,7 @@ class BottomPicker extends StatefulWidget { this.itemExtent = 30, this.closeWidget, this.closeOnSubmit = true, - }) : super(key: key) { + }) { datePickerMode = CupertinoDatePickerMode.time; bottomPickerType = BottomPickerType.rangeTime; dateOrder = null; @@ -693,9 +693,9 @@ class BottomPicker extends StatefulWidget { /// Indicates whether the time seperator (":") will be shown or not. bool showTimeSeparator = false; - /// Indiacate whether the bottom picker will be closed (poped out of the Navigator) + /// Indiacate whether the bottom picker will be closed (poped out of the Navigator) /// when the submit button is pressed. - /// + /// /// By default closeOnSubmit = true. final bool closeOnSubmit; @@ -724,10 +724,10 @@ class BottomPicker extends StatefulWidget { } @override - _BottomPickerState createState() => _BottomPickerState(); + BottomPickerState createState() => BottomPickerState(); } -class _BottomPickerState extends State { +class BottomPickerState extends State { late int selectedItemIndex; late DateTime selectedDateTime; @@ -997,7 +997,7 @@ class _BottomPickerState extends State { } /// Handle the key press event - bool _onKeyPressed(final keyData) { + bool _onKeyPressed(KeyData keyData) { if (keyData.logical == LogicalKeyboardKey.escape.keyId && !disposed && widget.dismissable) { diff --git a/lib/widgets/bottom_picker_button.dart b/lib/widgets/bottom_picker_button.dart index 8d22f06..7d00bac 100644 --- a/lib/widgets/bottom_picker_button.dart +++ b/lib/widgets/bottom_picker_button.dart @@ -12,7 +12,7 @@ class BottomPickerButton extends StatelessWidget { final BoxDecoration? style; const BottomPickerButton({ - Key? key, + super.key, required this.onClick, this.theme = BottomPickerTheme.blue, this.gradients, @@ -21,7 +21,7 @@ class BottomPickerButton extends StatelessWidget { this.buttonWidth, this.buttonChild, this.style, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/close_icon.dart b/lib/widgets/close_icon.dart index a44be49..deaaa07 100644 --- a/lib/widgets/close_icon.dart +++ b/lib/widgets/close_icon.dart @@ -6,11 +6,11 @@ class CloseIcon extends StatelessWidget { final double closeIconSize; const CloseIcon({ - Key? key, + super.key, required this.onPress, required this.iconColor, required this.closeIconSize, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/date_picker.dart b/lib/widgets/date_picker.dart index 1300bad..8dbcd41 100644 --- a/lib/widgets/date_picker.dart +++ b/lib/widgets/date_picker.dart @@ -15,7 +15,7 @@ class DatePicker extends StatelessWidget { final bool showTimeSeparator; const DatePicker({ - Key? key, + super.key, required this.initialDateTime, this.minuteInterval = 1, this.maxDateTime, @@ -27,7 +27,7 @@ class DatePicker extends StatelessWidget { this.dateOrder, this.itemExtent = 0, this.showTimeSeparator = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/range_picker.dart b/lib/widgets/range_picker.dart index a3b297a..9feae3a 100644 --- a/lib/widgets/range_picker.dart +++ b/lib/widgets/range_picker.dart @@ -19,7 +19,7 @@ class RangePicker extends StatefulWidget { final bool showTimeSeperator; const RangePicker({ - Key? key, + super.key, required this.initialFirstDateTime, required this.initialSecondDateTime, required this.maxFirstDate, @@ -35,7 +35,7 @@ class RangePicker extends StatefulWidget { this.minuteInterval, this.itemExtent, this.showTimeSeperator = false, - }) : super(key: key); + }); @override State createState() => _RangePickerState(); diff --git a/lib/widgets/simple_picker.dart b/lib/widgets/simple_picker.dart index 2fdb5fa..193d38f 100644 --- a/lib/widgets/simple_picker.dart +++ b/lib/widgets/simple_picker.dart @@ -12,14 +12,14 @@ class SimplePicker extends StatelessWidget { final Widget? selectionOverlay; const SimplePicker({ - Key? key, + super.key, required this.items, required this.onChange, required this.selectedItemIndex, required this.textStyle, required this.itemExtent, this.selectionOverlay, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/time_picker.dart b/lib/widgets/time_picker.dart index da790fc..973c210 100644 --- a/lib/widgets/time_picker.dart +++ b/lib/widgets/time_picker.dart @@ -11,7 +11,7 @@ class TimePicker extends StatelessWidget { final int secondInterval; const TimePicker({ - Key? key, + super.key, this.minuteInterval = 1, required this.mode, required this.textStyle, @@ -19,7 +19,7 @@ class TimePicker extends StatelessWidget { required this.onChange, required this.initialDuration, this.secondInterval = 1, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/pubspec.lock b/pubspec.lock index 12252f1..45ad492 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -58,10 +58,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -71,10 +71,10 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -95,10 +95,10 @@ packages: dependency: transitive description: name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "6.0.0" matcher: dependency: transitive description: @@ -196,10 +196,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.8.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 8938957..0ffc5e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,5 +11,5 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.4 + flutter_lints: ^6.0.0 flutter: null