Skip to content

Commit f3d0a79

Browse files
committed
Migrate to null-safety
1 parent 17bb083 commit f3d0a79

File tree

16 files changed

+154
-232
lines changed

16 files changed

+154
-232
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v2.0.0
2+
* Migrate to null-safety
3+
14
## v1.0.0 - Initial Release
25

36
* Create first version of the widget

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@
241241
/* Begin XCBuildConfiguration section */
242242
249021D3217E4FDB00AE95B9 /* Profile */ = {
243243
isa = XCBuildConfiguration;
244-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
245244
buildSettings = {
246245
ALWAYS_SEARCH_USER_PATHS = NO;
247246
CLANG_ANALYZER_NONNULL = YES;
@@ -318,7 +317,6 @@
318317
};
319318
97C147031CF9000F007C117D /* Debug */ = {
320319
isa = XCBuildConfiguration;
321-
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
322320
buildSettings = {
323321
ALWAYS_SEARCH_USER_PATHS = NO;
324322
CLANG_ANALYZER_NONNULL = YES;
@@ -374,7 +372,6 @@
374372
};
375373
97C147041CF9000F007C117D /* Release */ = {
376374
isa = XCBuildConfiguration;
377-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
378375
buildSettings = {
379376
ALWAYS_SEARCH_USER_PATHS = NO;
380377
CLANG_ANALYZER_NONNULL = YES;

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/examples/event_indicator.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class _EventIndicatorState extends State<EventIndicator> {
2525
final now = DateTime.now();
2626

2727
Map<Date, int> indicators = {
28-
Date(now.year, now.month, 12): 1,
29-
Date(now.year, now.month, 17): 1,
30-
Date(now.year, now.month, 13): 1,
31-
Date(now.year, now.month, 19): 1,
32-
Date(now.year, now.month, 23): 1,
28+
Date(year: now.year, month: now.month, day: 12): 1,
29+
Date(year: now.year, month: now.month, day: 17): 1,
30+
Date(year: now.year, month: now.month, day: 13): 1,
31+
Date(year: now.year, month: now.month, day: 19): 1,
32+
Date(year: now.year, month: now.month, day: 23): 1,
3333
};
3434

3535
return indicators;

example/lib/main.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,31 @@ class _ExampleHomeState extends State<ExampleHome> {
3838
padding: const EdgeInsets.all(8.0),
3939
child: ListView(
4040
children: <Widget>[
41-
RaisedButton(
41+
ElevatedButton(
4242
child: Text('Simple Usage'),
4343
onPressed: () => _navigate(SimpleCalendar()),
4444
),
45-
RaisedButton(
45+
ElevatedButton(
4646
child: Text('Custom Title & Weekdays'),
4747
onPressed: () => _navigate(CustomTitleAndWeekDays()),
4848
),
49-
RaisedButton(
49+
ElevatedButton(
5050
child: Text('Month & Day Change Event'),
5151
onPressed: () => _navigate(MonthAndDayChangeEvent()),
5252
),
53-
RaisedButton(
53+
ElevatedButton(
5454
child: Text('Custom First Day of Week'),
5555
onPressed: () => _navigate(CustomFirstDayOfWeek()),
5656
),
57-
RaisedButton(
57+
ElevatedButton(
5858
child: Text('Custom Calendar Header'),
5959
onPressed: () => _navigate(CustomCalendarHeader()),
6060
),
61-
RaisedButton(
61+
ElevatedButton(
6262
child: Text('With Event Indicators'),
6363
onPressed: () => _navigate(EventIndicator()),
6464
),
65-
RaisedButton(
65+
ElevatedButton(
6666
child: Text('Month Picker Modes'),
6767
onPressed: () => _navigate(MonthPickerModes()),
6868
),

example/pubspec.lock

Lines changed: 35 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,62 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4-
archive:
5-
dependency: transitive
6-
description:
7-
name: archive
8-
url: "https://pub.dartlang.org"
9-
source: hosted
10-
version: "2.0.13"
11-
args:
12-
dependency: transitive
13-
description:
14-
name: args
15-
url: "https://pub.dartlang.org"
16-
source: hosted
17-
version: "1.6.0"
184
async:
195
dependency: transitive
206
description:
217
name: async
228
url: "https://pub.dartlang.org"
239
source: hosted
24-
version: "2.4.1"
10+
version: "2.6.1"
2511
boolean_selector:
2612
dependency: transitive
2713
description:
2814
name: boolean_selector
2915
url: "https://pub.dartlang.org"
3016
source: hosted
31-
version: "2.0.0"
32-
charcode:
17+
version: "2.1.0"
18+
characters:
3319
dependency: transitive
3420
description:
35-
name: charcode
21+
name: characters
3622
url: "https://pub.dartlang.org"
3723
source: hosted
38-
version: "1.1.3"
39-
collection:
24+
version: "1.1.0"
25+
charcode:
4026
dependency: transitive
4127
description:
42-
name: collection
28+
name: charcode
4329
url: "https://pub.dartlang.org"
4430
source: hosted
45-
version: "1.14.12"
46-
convert:
31+
version: "1.2.0"
32+
clock:
4733
dependency: transitive
4834
description:
49-
name: convert
35+
name: clock
5036
url: "https://pub.dartlang.org"
5137
source: hosted
52-
version: "2.1.1"
53-
crypto:
38+
version: "1.1.0"
39+
collection:
5440
dependency: transitive
5541
description:
56-
name: crypto
42+
name: collection
5743
url: "https://pub.dartlang.org"
5844
source: hosted
59-
version: "2.1.4"
45+
version: "1.15.0"
6046
cupertino_icons:
6147
dependency: "direct main"
6248
description:
6349
name: cupertino_icons
6450
url: "https://pub.dartlang.org"
6551
source: hosted
6652
version: "0.1.3"
53+
fake_async:
54+
dependency: transitive
55+
description:
56+
name: fake_async
57+
url: "https://pub.dartlang.org"
58+
source: hosted
59+
version: "1.2.0"
6760
flutter:
6861
dependency: "direct main"
6962
description: flutter
@@ -74,34 +67,27 @@ packages:
7467
description: flutter
7568
source: sdk
7669
version: "0.0.0"
77-
image:
78-
dependency: transitive
79-
description:
80-
name: image
81-
url: "https://pub.dartlang.org"
82-
source: hosted
83-
version: "2.1.12"
8470
intl:
8571
dependency: "direct main"
8672
description:
8773
name: intl
8874
url: "https://pub.dartlang.org"
8975
source: hosted
90-
version: "0.16.1"
76+
version: "0.17.0"
9177
matcher:
9278
dependency: transitive
9379
description:
9480
name: matcher
9581
url: "https://pub.dartlang.org"
9682
source: hosted
97-
version: "0.12.6"
83+
version: "0.12.10"
9884
meta:
9985
dependency: transitive
10086
description:
10187
name: meta
10288
url: "https://pub.dartlang.org"
10389
source: hosted
104-
version: "1.1.8"
90+
version: "1.3.0"
10591
month_picker_strip:
10692
dependency: "direct main"
10793
description:
@@ -122,21 +108,7 @@ packages:
122108
name: path
123109
url: "https://pub.dartlang.org"
124110
source: hosted
125-
version: "1.6.4"
126-
petitparser:
127-
dependency: transitive
128-
description:
129-
name: petitparser
130-
url: "https://pub.dartlang.org"
131-
source: hosted
132-
version: "2.4.0"
133-
quiver:
134-
dependency: transitive
135-
description:
136-
name: quiver
137-
url: "https://pub.dartlang.org"
138-
source: hosted
139-
version: "2.1.3"
111+
version: "1.8.0"
140112
sky_engine:
141113
dependency: transitive
142114
description: flutter
@@ -148,62 +120,56 @@ packages:
148120
name: source_span
149121
url: "https://pub.dartlang.org"
150122
source: hosted
151-
version: "1.7.0"
123+
version: "1.8.1"
152124
stack_trace:
153125
dependency: transitive
154126
description:
155127
name: stack_trace
156128
url: "https://pub.dartlang.org"
157129
source: hosted
158-
version: "1.9.3"
130+
version: "1.10.0"
159131
stream_channel:
160132
dependency: transitive
161133
description:
162134
name: stream_channel
163135
url: "https://pub.dartlang.org"
164136
source: hosted
165-
version: "2.0.0"
137+
version: "2.1.0"
166138
string_scanner:
167139
dependency: transitive
168140
description:
169141
name: string_scanner
170142
url: "https://pub.dartlang.org"
171143
source: hosted
172-
version: "1.0.5"
144+
version: "1.1.0"
173145
term_glyph:
174146
dependency: transitive
175147
description:
176148
name: term_glyph
177149
url: "https://pub.dartlang.org"
178150
source: hosted
179-
version: "1.1.0"
151+
version: "1.2.0"
180152
test_api:
181153
dependency: transitive
182154
description:
183155
name: test_api
184156
url: "https://pub.dartlang.org"
185157
source: hosted
186-
version: "0.2.15"
158+
version: "0.3.0"
187159
typed_data:
188160
dependency: transitive
189161
description:
190162
name: typed_data
191163
url: "https://pub.dartlang.org"
192164
source: hosted
193-
version: "1.1.6"
165+
version: "1.3.0"
194166
vector_math:
195167
dependency: transitive
196168
description:
197169
name: vector_math
198170
url: "https://pub.dartlang.org"
199171
source: hosted
200-
version: "2.0.8"
201-
xml:
202-
dependency: transitive
203-
description:
204-
name: xml
205-
url: "https://pub.dartlang.org"
206-
source: hosted
207-
version: "3.6.1"
172+
version: "2.1.0"
208173
sdks:
209-
dart: ">=2.7.0 <3.0.0"
174+
dart: ">=2.12.0 <3.0.0"
175+
flutter: ">=1.12.0"

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ dependencies:
3232
# Use with the CupertinoIcons class for iOS style icons.
3333
cupertino_icons: ^0.1.3
3434

35-
intl: ^0.16.1
35+
intl: ^0.17.0
3636
month_picker_strip: ^0.0.3
3737

3838
dev_dependencies:
3939
flutter_test:
4040
sdk: flutter
4141

4242
dependency_overrides:
43-
intl: ^0.16.1
43+
intl: ^0.17.0
4444

4545
# For information on the generic Dart part of this file, see the
4646
# following page: https://dart.dev/tools/pub/pubspec

lib/src/internal/calendar_header.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ class _CalendarHeader extends StatelessWidget {
55
final CalendarTitleBuilder titleBuilder;
66
final MonthPickerMode monthPickerMode;
77
final TextStyle titleStyle;
8-
final VoidCallback onPrevSelected;
9-
final VoidCallback onNextSelected;
8+
final VoidCallback? onPrevSelected;
9+
final VoidCallback? onNextSelected;
1010

1111
/// when a user taps on the header & jump to a specific month & year
1212
final MonthChangedCallBack onMonthChanged;
1313

1414
const _CalendarHeader({
15-
@required this.monthAndYear,
16-
@required this.titleBuilder,
17-
@required this.monthPickerMode,
18-
@required this.titleStyle,
19-
@required this.onPrevSelected,
20-
@required this.onNextSelected,
21-
@required this.onMonthChanged,
15+
required this.monthAndYear,
16+
required this.titleBuilder,
17+
required this.monthPickerMode,
18+
required this.titleStyle,
19+
required this.onPrevSelected,
20+
required this.onNextSelected,
21+
required this.onMonthChanged,
2222
});
2323

2424
@override

0 commit comments

Comments
 (0)