Skip to content

Commit 78e6cdd

Browse files
authored
Merge pull request #1 from Sasikumar3595/main
FLUT-4313-Sample updated with null safety.
2 parents 5a7e303 + 09d18f6 commit 78e6cdd

File tree

3 files changed

+38
-51
lines changed

3 files changed

+38
-51
lines changed

lib/main.dart

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,33 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart';
44

55
void main() => runApp(ProgrammaticDateSelection());
66

7-
87
class ProgrammaticDateSelection extends StatefulWidget {
98
@override
109
DateSelectionState createState() => DateSelectionState();
1110
}
1211

1312
class DateSelectionState extends State<ProgrammaticDateSelection> {
14-
DateRangePickerController _controller;
15-
16-
@override
17-
void initState() {
18-
_controller = DateRangePickerController();
19-
super.initState();
20-
}
13+
final DateRangePickerController _controller = DateRangePickerController();
2114

2215
@override
2316
Widget build(BuildContext context) {
24-
return Scaffold(
25-
body: Card(
26-
margin: const EdgeInsets.fromLTRB(50, 150, 50, 110),
27-
child: SfDateRangePicker(
28-
view: DateRangePickerView.month,
29-
controller: _controller,
30-
onViewChanged: viewChanged,
17+
return MaterialApp(
18+
debugShowCheckedModeBanner: false,
19+
home: Scaffold(
20+
body: Card(
21+
margin: const EdgeInsets.fromLTRB(50, 150, 50, 110),
22+
child: SfDateRangePicker(
23+
view: DateRangePickerView.month,
24+
controller: _controller,
25+
onViewChanged: viewChanged,
26+
),
3127
),
3228
),
33-
34-
// This trailing comma makes auto-formatting nicer for build methods.
3529
);
3630
}
3731

3832
void viewChanged(DateRangePickerViewChangedArgs args) {
39-
SchedulerBinding.instance.addPostFrameCallback((Duration duration) {
33+
SchedulerBinding.instance!.addPostFrameCallback((Duration duration) {
4034
_controller.selectedDate = args.visibleDateRange.startDate;
4135
});
4236
}

pubspec.lock

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,56 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0-nullsafety.1"
10+
version: "2.5.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.1.0-nullsafety.1"
17+
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0-nullsafety.3"
24+
version: "1.1.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0-nullsafety.1"
31+
version: "1.2.0"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.1.0-nullsafety.1"
38+
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0-nullsafety.3"
45+
version: "1.15.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
4949
name: cupertino_icons
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "0.1.3"
52+
version: "1.0.2"
5353
fake_async:
5454
dependency: transitive
5555
description:
5656
name: fake_async
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.2.0-nullsafety.1"
59+
version: "1.2.0"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -73,35 +73,28 @@ packages:
7373
name: intl
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "0.16.1"
76+
version: "0.17.0"
7777
matcher:
7878
dependency: transitive
7979
description:
8080
name: matcher
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "0.12.10-nullsafety.1"
83+
version: "0.12.10"
8484
meta:
8585
dependency: transitive
8686
description:
8787
name: meta
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "1.3.0-nullsafety.4"
90+
version: "1.3.0"
9191
path:
9292
dependency: transitive
9393
description:
9494
name: path
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "1.8.0-nullsafety.1"
98-
pedantic:
99-
dependency: transitive
100-
description:
101-
name: pedantic
102-
url: "https://pub.dartlang.org"
103-
source: hosted
104-
version: "1.9.2"
97+
version: "1.8.0"
10598
sky_engine:
10699
dependency: transitive
107100
description: flutter
@@ -113,69 +106,69 @@ packages:
113106
name: source_span
114107
url: "https://pub.dartlang.org"
115108
source: hosted
116-
version: "1.8.0-nullsafety.2"
109+
version: "1.8.1"
117110
stack_trace:
118111
dependency: transitive
119112
description:
120113
name: stack_trace
121114
url: "https://pub.dartlang.org"
122115
source: hosted
123-
version: "1.10.0-nullsafety.2"
116+
version: "1.10.0"
124117
stream_channel:
125118
dependency: transitive
126119
description:
127120
name: stream_channel
128121
url: "https://pub.dartlang.org"
129122
source: hosted
130-
version: "2.1.0-nullsafety.1"
123+
version: "2.1.0"
131124
string_scanner:
132125
dependency: transitive
133126
description:
134127
name: string_scanner
135128
url: "https://pub.dartlang.org"
136129
source: hosted
137-
version: "1.1.0-nullsafety.1"
130+
version: "1.1.0"
138131
syncfusion_flutter_core:
139132
dependency: transitive
140133
description:
141134
name: syncfusion_flutter_core
142135
url: "https://pub.dartlang.org"
143136
source: hosted
144-
version: "18.3.51"
137+
version: "19.1.55"
145138
syncfusion_flutter_datepicker:
146139
dependency: "direct main"
147140
description:
148141
name: syncfusion_flutter_datepicker
149142
url: "https://pub.dartlang.org"
150143
source: hosted
151-
version: "18.3.51-beta"
144+
version: "19.1.55-beta"
152145
term_glyph:
153146
dependency: transitive
154147
description:
155148
name: term_glyph
156149
url: "https://pub.dartlang.org"
157150
source: hosted
158-
version: "1.2.0-nullsafety.1"
151+
version: "1.2.0"
159152
test_api:
160153
dependency: transitive
161154
description:
162155
name: test_api
163156
url: "https://pub.dartlang.org"
164157
source: hosted
165-
version: "0.2.19-nullsafety.2"
158+
version: "0.2.19"
166159
typed_data:
167160
dependency: transitive
168161
description:
169162
name: typed_data
170163
url: "https://pub.dartlang.org"
171164
source: hosted
172-
version: "1.3.0-nullsafety.3"
165+
version: "1.3.0"
173166
vector_math:
174167
dependency: transitive
175168
description:
176169
name: vector_math
177170
url: "https://pub.dartlang.org"
178171
source: hosted
179-
version: "2.1.0-nullsafety.3"
172+
version: "2.1.0"
180173
sdks:
181-
dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
174+
dart: ">=2.12.0 <3.0.0"

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ description: A new Flutter application.
1414
version: 1.0.0+1
1515

1616
environment:
17-
sdk: ">=2.1.0 <3.0.0"
17+
sdk: '>=2.12.0 <3.0.0'
1818

1919
dependencies:
2020
flutter:
2121
sdk: flutter
22-
syncfusion_flutter_datepicker: 18.3.51-beta
22+
syncfusion_flutter_datepicker: ^19.1.55-beta
2323

2424

2525
# The following adds the Cupertino Icons font to your application.
2626
# Use with the CupertinoIcons class for iOS style icons.
27-
cupertino_icons: ^0.1.3
27+
cupertino_icons: ^1.0.2
2828

2929
dev_dependencies:
3030
flutter_test:

0 commit comments

Comments
 (0)