Skip to content

Commit 0dc1eb1

Browse files
authored
Merge pull request #195 from francescoberardi/month-picker
feat(reactive_month_picker_dialog): bump `month_picker_dialog` to ^6.2.3 and adapt to breaking changes
2 parents 734af34 + 6267f69 commit 0dc1eb1

File tree

10 files changed

+117
-103
lines changed

10 files changed

+117
-103
lines changed

packages/reactive_month_picker_dialog/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [4.0.0]
2+
3+
* month_picker_dialog: ^6.2.3
4+
* update example app
5+
16
## [3.0.1]
27

38
* Support `reactive_forms: 18.x`

packages/reactive_month_picker_dialog/example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 60bd88df915880d23877bfc1602e8ddcf4c4dd2a
8-
channel: stable
7+
revision: "b25305a8832cfc6ba632a7f87ad455e319dccce8"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: b25305a8832cfc6ba632a7f87ad455e319dccce8
17+
base_revision: b25305a8832cfc6ba632a7f87ad455e319dccce8
18+
- platform: web
19+
create_revision: b25305a8832cfc6ba632a7f87ad455e319dccce8
20+
base_revision: b25305a8832cfc6ba632a7f87ad455e319dccce8
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

packages/reactive_month_picker_dialog/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ environment:
2323
dependencies:
2424
flutter:
2525
sdk: flutter
26-
reactive_forms: 16.0.1
26+
reactive_forms: ^18.0.0
2727
reactive_month_picker_dialog:
2828
path: ../
2929

3030
# The following adds the Cupertino Icons font to your application.
3131
# Use with the CupertinoIcons class for iOS style icons.
32-
cupertino_icons: ^1.0.5
32+
cupertino_icons: ^1.0.8
3333

3434
dev_dependencies:
3535
flutter_test:
5.46 KB
Loading
20.5 KB
Loading

packages/reactive_month_picker_dialog/example/web/index.html

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,31 @@
88
The path provided below has to start and end with a slash "/" in order for
99
it to work correctly.
1010
11-
Fore more details:
11+
For more details:
1212
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
13+
14+
This is a placeholder for base href that will be replaced by the value of
15+
the `--base-href` argument provided to `flutter build`.
1316
-->
14-
<base href="/">
17+
<base href="$FLUTTER_BASE_HREF">
1518

1619
<meta charset="UTF-8">
1720
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
1821
<meta name="description" content="A new Flutter project.">
1922

2023
<!-- iOS meta tags & icons -->
21-
<meta name="apple-mobile-web-app-capable" content="yes">
24+
<meta name="mobile-web-app-capable" content="yes">
2225
<meta name="apple-mobile-web-app-status-bar-style" content="black">
23-
<meta name="apple-mobile-web-app-title" content="example">
26+
<meta name="apple-mobile-web-app-title" content="reactive_month_picker_dialog_example">
2427
<link rel="apple-touch-icon" href="icons/Icon-192.png">
2528

2629
<!-- Favicon -->
2730
<link rel="icon" type="image/png" href="favicon.png"/>
2831

29-
<title>example</title>
32+
<title>reactive_month_picker_dialog_example</title>
3033
<link rel="manifest" href="manifest.json">
3134
</head>
3235
<body>
33-
<!-- This script installs service_worker.js to provide PWA functionality to
34-
application. For more information, see:
35-
https://developers.google.com/web/fundamentals/primers/service-workers -->
36-
<script>
37-
if ('serviceWorker' in navigator) {
38-
window.addEventListener('flutter-first-frame', function () {
39-
navigator.serviceWorker.register('flutter_service_worker.js');
40-
});
41-
}
42-
</script>
43-
<script src="main.dart.js" type="application/javascript"></script>
36+
<script src="flutter_bootstrap.js" async></script>
4437
</body>
4538
</html>

packages/reactive_month_picker_dialog/example/web/manifest.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "example",
3-
"short_name": "example",
2+
"name": "reactive_month_picker_dialog_example",
3+
"short_name": "reactive_month_picker_dialog_example",
44
"start_url": ".",
55
"display": "standalone",
66
"background_color": "#0175C2",
@@ -18,6 +18,18 @@
1818
"src": "icons/Icon-512.png",
1919
"sizes": "512x512",
2020
"type": "image/png"
21+
},
22+
{
23+
"src": "icons/Icon-maskable-192.png",
24+
"sizes": "192x192",
25+
"type": "image/png",
26+
"purpose": "maskable"
27+
},
28+
{
29+
"src": "icons/Icon-maskable-512.png",
30+
"sizes": "512x512",
31+
"type": "image/png",
32+
"purpose": "maskable"
2133
}
2234
]
2335
}

packages/reactive_month_picker_dialog/lib/reactive_month_picker_dialog.dart

Lines changed: 35 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import 'package:reactive_forms/reactive_forms.dart';
1212
/// that is bound to [ReactiveMonthPickerDialog].
1313
1414
/// This is a convenience widget that wraps the function
15-
/// [showDatePicker] and [showTimePicker] in a [ReactiveMonthPickerDialog].
15+
/// [showMonthPicker] in a [ReactiveMonthPickerDialog].
1616
///
1717
/// The [formControlName] is required to bind this [ReactiveMonthPickerDialog]
1818
/// to a [FormControl].
1919
///
20-
/// For documentation about the various parameters, see the [showDatePicker]
21-
/// and [showTimePicker] function parameters.
20+
/// For documentation about the various parameters, see the [showMonthPicker]
21+
/// function parameters.
2222
///
2323
/// ## Example:
2424
///
@@ -28,7 +28,7 @@ import 'package:reactive_forms/reactive_forms.dart';
2828
/// )
2929
/// ```
3030
class ReactiveMonthPickerDialog extends ReactiveFormField<DateTime, String> {
31-
/// Creates a [ReactiveMonthPickerDialog] that wraps the function [showDatePicker].
31+
/// Creates a [ReactiveMonthPickerDialog] that wraps the function [showMonthPicker].
3232
///
3333
/// Can optionally provide a [formControl] to bind this widget to a control.
3434
///
@@ -38,59 +38,37 @@ class ReactiveMonthPickerDialog extends ReactiveFormField<DateTime, String> {
3838
/// Must provide one of the arguments [formControl] or a [formControlName],
3939
/// but not both at the same time.
4040
///
41-
/// The parameter [transitionBuilder] is the equivalent of [builder]
42-
/// parameter in the [showTimePicker].
43-
///
44-
/// For documentation about the various parameters, see the [showTimePicker]
41+
/// For documentation about the various parameters, see the [showMonthPicker]
4542
/// function parameters.
46-
ReactiveMonthPickerDialog(
47-
{super.key,
48-
super.formControlName,
49-
super.formControl,
50-
super.validationMessages,
51-
ControlValueAccessor<DateTime, String>? valueAccessor,
52-
super.showErrors,
43+
ReactiveMonthPickerDialog({
44+
super.key,
45+
super.formControlName,
46+
super.formControl,
47+
super.validationMessages,
48+
ControlValueAccessor<DateTime, String>? valueAccessor,
49+
super.showErrors,
5350

54-
////////////////////////////////////////////////////////////////////////////
55-
InputDecoration? decoration,
56-
bool showClearIcon = true,
57-
Widget clearIcon = const Icon(Icons.clear),
58-
TextStyle? style,
59-
DateTime? firstDate,
60-
DateTime? lastDate,
61-
Locale? locale,
62-
bool Function(DateTime)? selectableMonthPredicate,
63-
bool capitalizeFirstLetter = true,
64-
Color? headerColor,
65-
Color? headerTextColor,
66-
Color? selectedMonthBackgroundColor,
67-
Color? backgroundColor,
68-
Color? selectedMonthTextColor,
69-
Color? unselectedMonthTextColor,
70-
Color? currentMonthTextColor,
71-
Widget? confirmText,
72-
Widget? cancelText,
73-
double? customHeight,
74-
double customWidth = 320,
75-
bool yearFirst = false,
76-
bool dismissible = false,
77-
double roundedCornersRadius = 0,
78-
bool forceSelectedDate = false,
79-
ButtonStyle? Function(DateTime)? monthStylePredicate,
80-
ButtonStyle? Function(int)? yearStylePredicate,
81-
double selectedMonthPadding = 0,
82-
int animationMilliseconds = 450,
83-
bool hideHeaderRow = false,
84-
double? textScaleFactor,
85-
double? arrowSize,
86-
bool forcePortrait = false,
87-
Widget? customDivider,
88-
bool blockScrolling = true,
89-
BorderSide dialogBorderSide = BorderSide.none})
90-
: super(
51+
////////////////////////////////////////////////////////////////////////////
52+
InputDecoration? decoration,
53+
bool showClearIcon = true,
54+
Widget clearIcon = const Icon(Icons.clear),
55+
TextStyle? style,
56+
DateTime? firstDate,
57+
DateTime? lastDate,
58+
Locale? locale,
59+
bool Function(DateTime)? selectableMonthPredicate,
60+
bool Function(int)? selectableYearPredicate,
61+
ButtonStyle? Function(DateTime)? monthStylePredicate,
62+
ButtonStyle? Function(int)? yearStylePredicate,
63+
Widget? headerTitle,
64+
bool onlyYear = false,
65+
MonthPickerDialogSettings monthPickerDialogSettings =
66+
defaultMonthPickerDialogSettings,
67+
}) : super(
9168
valueAccessor: valueAccessor ??
9269
DateTimeValueAccessor(
93-
dateTimeFormat: DateFormat('yyyy/MM'),
70+
dateTimeFormat:
71+
onlyYear ? DateFormat.y() : DateFormat('yyyy/MM'),
9472
),
9573
builder: (field) {
9674
Widget? suffixIcon = decoration?.suffixIcon;
@@ -127,35 +105,13 @@ class ReactiveMonthPickerDialog extends ReactiveFormField<DateTime, String> {
127105
),
128106
firstDate: firstDate ?? DateTime(1900),
129107
lastDate: effectiveLastDate,
130-
locale: locale,
131108
selectableMonthPredicate: selectableMonthPredicate,
132-
capitalizeFirstLetter: capitalizeFirstLetter,
133-
headerColor: headerColor,
134-
headerTextColor: headerTextColor,
135-
selectedMonthBackgroundColor: selectedMonthBackgroundColor,
136-
selectedMonthTextColor: selectedMonthTextColor,
137-
unselectedMonthTextColor: unselectedMonthTextColor,
138-
confirmWidget: confirmText,
139-
cancelWidget: cancelText,
140-
customHeight: customHeight,
141-
customWidth: customWidth,
142-
yearFirst: yearFirst,
143-
dismissible: dismissible,
144-
roundedCornersRadius: roundedCornersRadius,
145-
forceSelectedDate: forceSelectedDate,
146-
backgroundColor: backgroundColor,
109+
selectableYearPredicate: selectableYearPredicate,
147110
monthStylePredicate: monthStylePredicate,
148111
yearStylePredicate: yearStylePredicate,
149-
currentMonthTextColor: currentMonthTextColor,
150-
selectedMonthPadding: selectedMonthPadding,
151-
animationMilliseconds: animationMilliseconds,
152-
hideHeaderRow: hideHeaderRow,
153-
textScaleFactor: textScaleFactor,
154-
arrowSize: arrowSize,
155-
forcePortrait: forcePortrait,
156-
customDivider: customDivider,
157-
blockScrolling: blockScrolling,
158-
dialogBorderSide: dialogBorderSide,
112+
headerTitle: headerTitle,
113+
monthPickerDialogSettings: monthPickerDialogSettings,
114+
onlyYear: onlyYear,
159115
);
160116

161117
field.didChange(

packages/reactive_month_picker_dialog/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: reactive_month_picker_dialog
22
description: Wrapper around month_picker_dialog to use with reactive_forms.
3-
version: 3.0.1
3+
version: 4.0.0
44
repository: https://github.com/artflutter/reactive_forms_widgets/tree/master/packages/reactive_month_picker_dialog
55
issue_tracker: https://github.com/artflutter/reactive_forms_widgets/issues
66

@@ -11,7 +11,7 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
month_picker_dialog: ^3.0.0
14+
month_picker_dialog: ^6.2.3
1515
reactive_forms: ">=16.0.0 <19.0.0"
1616
intl: ">=0.18.0 <1.0.0"
1717

0 commit comments

Comments
 (0)