Skip to content

Commit 14876ad

Browse files
committed
FLUT-4313-Sample updated with null safety.
1 parent 88eb6d3 commit 14876ad

File tree

3 files changed

+37
-56
lines changed

3 files changed

+37
-56
lines changed

lib/main.dart

+11-23
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,8 @@ class SwipeSelectionPicker extends StatefulWidget {
2020
}
2121

2222
class SwipeSelectionPickerState extends State<SwipeSelectionPicker> {
23-
bool _swipeSelection;
24-
String _buttonText;
25-
26-
@override
27-
@override
28-
void initState() {
29-
_swipeSelection = true;
30-
_buttonText='Disable swipe selection';
31-
super.initState();
32-
}
23+
bool _swipeSelection = true;
24+
String _buttonText = 'Disable swipe selection';
3325

3426
@override
3527
Widget build(BuildContext context) {
@@ -38,27 +30,23 @@ class SwipeSelectionPickerState extends State<SwipeSelectionPicker> {
3830
children: [
3931
Container(
4032
padding: const EdgeInsets.only(top: 70),
41-
child: RaisedButton(
33+
child: MaterialButton(
4234
child: Text(_buttonText),
4335
onPressed: () {
4436
setState(() {
45-
if(_buttonText=='Disable swipe selection')
46-
{
47-
_buttonText='Enable swipe selection';
48-
_swipeSelection = false;
49-
}
50-
51-
else
52-
{
53-
_buttonText='Disable swipe selection';
54-
_swipeSelection = true;
55-
}
37+
if (_buttonText == 'Disable swipe selection') {
38+
_buttonText = 'Enable swipe selection';
39+
_swipeSelection = false;
40+
} else {
41+
_buttonText = 'Disable swipe selection';
42+
_swipeSelection = true;
43+
}
5644
});
5745
},
5846
),
5947
),
6048
Card(
61-
margin: const EdgeInsets.fromLTRB(40, 80, 40,100),
49+
margin: const EdgeInsets.fromLTRB(40, 80, 40, 100),
6250
child: SfDateRangePicker(
6351
view: DateRangePickerView.month,
6452
selectionMode: DateRangePickerSelectionMode.range,

pubspec.lock

+23-30
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: "1.0.0"
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.7.0 <3.0.0"
21+
sdk: '>=2.12.0 <3.0.0'
2222

2323
dependencies:
2424
flutter:
2525
sdk: flutter
26-
syncfusion_flutter_datepicker: 18.3.51-beta
26+
syncfusion_flutter_datepicker: ^19.1.55-beta
2727

2828

2929
# The following adds the Cupertino Icons font to your application.
3030
# Use with the CupertinoIcons class for iOS style icons.
31-
cupertino_icons: ^1.0.0
31+
cupertino_icons: ^1.0.2
3232

3333
dev_dependencies:
3434
flutter_test:

0 commit comments

Comments
 (0)