Skip to content

Commit 2d8b123

Browse files
rjahnluckyrat
authored andcommitted
support for flutter 3.27 and removed deprecation warnings
1 parent 41356d7 commit 2d8b123

File tree

7 files changed

+115
-79
lines changed

7 files changed

+115
-79
lines changed

lib/src/expander_theme_data.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ class ExpanderThemeData {
5555

5656
const ExpanderThemeData({
5757
this.color,
58-
this.position: ExpanderPosition.start,
59-
this.type: ExpanderType.caret,
60-
this.size: _kDefaultExpanderSize,
61-
this.modifier: ExpanderModifier.none,
62-
this.animated: true,
58+
this.position = ExpanderPosition.start,
59+
this.type = ExpanderType.caret,
60+
this.size = _kDefaultExpanderSize,
61+
this.modifier = ExpanderModifier.none,
62+
this.animated = true,
6363
});
6464

6565
/// Creates an expander icon theme with some reasonable default values.
@@ -129,5 +129,5 @@ class ExpanderThemeData {
129129

130130
@override
131131
int get hashCode =>
132-
hashValues(color, position, type, size, modifier, animated);
132+
Object.hash(color, position, type, size, modifier, animated);
133133
}

lib/src/models/node.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class Node<T> {
4141
const Node({
4242
required this.key,
4343
required this.label,
44-
this.children: const [],
45-
this.expanded: false,
46-
this.parent: false,
44+
this.children = const [],
45+
this.expanded = false,
46+
this.parent = false,
4747
this.icon,
4848
this.data,
4949
});
@@ -152,7 +152,7 @@ class Node<T> {
152152

153153
@override
154154
int get hashCode {
155-
return hashValues(
155+
return Object.hash(
156156
key,
157157
label,
158158
icon,

lib/src/tree_view.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ class TreeView<T> extends InheritedWidget {
8787
this.onNodeLongPress,
8888
this.physics,
8989
this.onExpansionChanged,
90-
this.allowParentSelect: false,
91-
this.supportParentDoubleTap: false,
92-
this.shrinkWrap: false,
93-
this.primary: true,
90+
this.allowParentSelect = false,
91+
this.supportParentDoubleTap = false,
92+
this.shrinkWrap = false,
93+
this.primary = true,
9494
this.nodeBuilder,
9595
TreeViewTheme? theme,
9696
}) : this.theme = theme ?? const TreeViewTheme(),

lib/src/tree_view_controller.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TreeViewController<T> {
3838
final String? selectedKey;
3939

4040
TreeViewController({
41-
this.children: const [],
41+
this.children = const [],
4242
this.selectedKey,
4343
});
4444

@@ -60,7 +60,7 @@ class TreeViewController<T> {
6060
/// controller = controller.loadJSON(json: jsonString);
6161
/// });
6262
/// ```
63-
TreeViewController loadJSON({String json: '[]'}) {
63+
TreeViewController loadJSON({String json = '[]'}) {
6464
List jsonList = jsonDecode(json);
6565
List<Map<String, dynamic>> list = List<Map<String, dynamic>>.from(jsonList);
6666
return loadMap(list: list);
@@ -74,7 +74,7 @@ class TreeViewController<T> {
7474
/// controller = controller.loadMap(map: dataMap);
7575
/// });
7676
/// ```
77-
TreeViewController loadMap({List<Map<String, dynamic>> list: const []}) {
77+
TreeViewController loadMap({List<Map<String, dynamic>> list = const []}) {
7878
List<Node<T>> treeData =
7979
list.map((Map<String, dynamic> item) => Node<T>.fromMap(item)).toList();
8080
return TreeViewController(
@@ -100,7 +100,7 @@ class TreeViewController<T> {
100100
Node<T> newNode, {
101101
Node<T>? parent,
102102
int? index,
103-
InsertMode mode: InsertMode.append,
103+
InsertMode mode = InsertMode.append,
104104
}) {
105105
List<Node<T>> _data =
106106
addNode(key, newNode, parent: parent, mode: mode, index: index);
@@ -394,7 +394,7 @@ class TreeViewController<T> {
394394
Node<T> newNode, {
395395
Node<T>? parent,
396396
int? index,
397-
InsertMode mode: InsertMode.append,
397+
InsertMode mode = InsertMode.append,
398398
}) {
399399
List<Node<T>> _children = parent == null ? this.children : parent.children;
400400
return _children.map((Node<T> child) {

lib/src/tree_view_theme.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ class TreeViewTheme {
5959
final Duration expandSpeed;
6060

6161
const TreeViewTheme({
62-
this.colorScheme: const ColorScheme.light(),
63-
this.iconTheme: const IconThemeData.fallback(),
64-
this.expanderTheme: const ExpanderThemeData.fallback(),
65-
this.labelStyle: const TextStyle(),
66-
this.parentLabelStyle: const TextStyle(fontWeight: FontWeight.bold),
62+
this.colorScheme = const ColorScheme.light(),
63+
this.iconTheme = const IconThemeData.fallback(),
64+
this.expanderTheme = const ExpanderThemeData.fallback(),
65+
this.labelStyle = const TextStyle(),
66+
this.parentLabelStyle = const TextStyle(fontWeight: FontWeight.bold),
6767
this.labelOverflow,
6868
this.parentLabelOverflow,
69-
this.levelPadding: _kDefaultLevelPadding,
70-
this.dense: true,
69+
this.levelPadding = _kDefaultLevelPadding,
70+
this.dense = true,
7171
this.verticalSpacing,
7272
this.horizontalSpacing,
73-
this.iconPadding: 8,
74-
this.expandSpeed: const Duration(milliseconds: _kExpandSpeed),
73+
this.iconPadding = 8,
74+
this.expandSpeed = const Duration(milliseconds: _kExpandSpeed),
7575
});
7676

7777
/// Creates a [TreeView] theme with some reasonable default values.
@@ -154,7 +154,7 @@ class TreeViewTheme {
154154

155155
@override
156156
int get hashCode {
157-
return hashValues(
157+
return Object.hash(
158158
colorScheme,
159159
levelPadding,
160160
iconPadding,

lib/src/utilities.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Utilities {
99
static const Color WHITE = Color.fromARGB(255, 255, 255, 255);
1010

1111
static String toRGBA(Color color) {
12-
return 'rgba(${color.red},${color.green},${color.blue},${color.alpha / 255})';
12+
return 'rgba(${color.r},${color.g},${color.b},${color.a / 255})';
1313
}
1414

1515
static Color textColor(Color color) {

pubspec.lock

Lines changed: 85 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,50 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.dartlang.org"
8+
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9+
url: "https://pub.dev"
910
source: hosted
10-
version: "2.8.2"
11+
version: "2.11.0"
1112
boolean_selector:
1213
dependency: transitive
1314
description:
1415
name: boolean_selector
15-
url: "https://pub.dartlang.org"
16+
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17+
url: "https://pub.dev"
1618
source: hosted
17-
version: "2.1.0"
19+
version: "2.1.1"
1820
characters:
1921
dependency: transitive
2022
description:
2123
name: characters
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "1.2.0"
25-
charcode:
26-
dependency: transitive
27-
description:
28-
name: charcode
29-
url: "https://pub.dartlang.org"
24+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25+
url: "https://pub.dev"
3026
source: hosted
31-
version: "1.3.1"
27+
version: "1.3.0"
3228
clock:
3329
dependency: transitive
3430
description:
3531
name: clock
36-
url: "https://pub.dartlang.org"
32+
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33+
url: "https://pub.dev"
3734
source: hosted
38-
version: "1.1.0"
35+
version: "1.1.1"
3936
collection:
4037
dependency: transitive
4138
description:
4239
name: collection
43-
url: "https://pub.dartlang.org"
40+
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
41+
url: "https://pub.dev"
4442
source: hosted
45-
version: "1.15.0"
43+
version: "1.19.0"
4644
fake_async:
4745
dependency: transitive
4846
description:
4947
name: fake_async
50-
url: "https://pub.dartlang.org"
48+
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
49+
url: "https://pub.dev"
5150
source: hosted
52-
version: "1.2.0"
51+
version: "1.3.1"
5352
flutter:
5453
dependency: "direct main"
5554
description: flutter
@@ -60,94 +59,131 @@ packages:
6059
description: flutter
6160
source: sdk
6261
version: "0.0.0"
62+
leak_tracker:
63+
dependency: transitive
64+
description:
65+
name: leak_tracker
66+
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
67+
url: "https://pub.dev"
68+
source: hosted
69+
version: "10.0.7"
70+
leak_tracker_flutter_testing:
71+
dependency: transitive
72+
description:
73+
name: leak_tracker_flutter_testing
74+
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
75+
url: "https://pub.dev"
76+
source: hosted
77+
version: "3.0.8"
78+
leak_tracker_testing:
79+
dependency: transitive
80+
description:
81+
name: leak_tracker_testing
82+
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
83+
url: "https://pub.dev"
84+
source: hosted
85+
version: "3.0.1"
6386
matcher:
6487
dependency: transitive
6588
description:
6689
name: matcher
67-
url: "https://pub.dartlang.org"
90+
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
91+
url: "https://pub.dev"
6892
source: hosted
69-
version: "0.12.11"
93+
version: "0.12.16+1"
7094
material_color_utilities:
7195
dependency: transitive
7296
description:
7397
name: material_color_utilities
74-
url: "https://pub.dartlang.org"
98+
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
99+
url: "https://pub.dev"
75100
source: hosted
76-
version: "0.1.3"
101+
version: "0.11.1"
77102
meta:
78103
dependency: transitive
79104
description:
80105
name: meta
81-
url: "https://pub.dartlang.org"
106+
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
107+
url: "https://pub.dev"
82108
source: hosted
83-
version: "1.7.0"
109+
version: "1.15.0"
84110
path:
85111
dependency: transitive
86112
description:
87113
name: path
88-
url: "https://pub.dartlang.org"
114+
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
115+
url: "https://pub.dev"
89116
source: hosted
90-
version: "1.8.0"
117+
version: "1.9.0"
91118
sky_engine:
92119
dependency: transitive
93120
description: flutter
94121
source: sdk
95-
version: "0.0.99"
122+
version: "0.0.0"
96123
source_span:
97124
dependency: transitive
98125
description:
99126
name: source_span
100-
url: "https://pub.dartlang.org"
127+
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
128+
url: "https://pub.dev"
101129
source: hosted
102-
version: "1.8.1"
130+
version: "1.10.0"
103131
stack_trace:
104132
dependency: transitive
105133
description:
106134
name: stack_trace
107-
url: "https://pub.dartlang.org"
135+
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
136+
url: "https://pub.dev"
108137
source: hosted
109-
version: "1.10.0"
138+
version: "1.12.0"
110139
stream_channel:
111140
dependency: transitive
112141
description:
113142
name: stream_channel
114-
url: "https://pub.dartlang.org"
143+
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
144+
url: "https://pub.dev"
115145
source: hosted
116-
version: "2.1.0"
146+
version: "2.1.2"
117147
string_scanner:
118148
dependency: transitive
119149
description:
120150
name: string_scanner
121-
url: "https://pub.dartlang.org"
151+
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
152+
url: "https://pub.dev"
122153
source: hosted
123-
version: "1.1.0"
154+
version: "1.3.0"
124155
term_glyph:
125156
dependency: transitive
126157
description:
127158
name: term_glyph
128-
url: "https://pub.dartlang.org"
159+
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
160+
url: "https://pub.dev"
129161
source: hosted
130-
version: "1.2.0"
162+
version: "1.2.1"
131163
test_api:
132164
dependency: transitive
133165
description:
134166
name: test_api
135-
url: "https://pub.dartlang.org"
167+
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
168+
url: "https://pub.dev"
136169
source: hosted
137-
version: "0.4.8"
138-
typed_data:
170+
version: "0.7.3"
171+
vector_math:
139172
dependency: transitive
140173
description:
141-
name: typed_data
142-
url: "https://pub.dartlang.org"
174+
name: vector_math
175+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
176+
url: "https://pub.dev"
143177
source: hosted
144-
version: "1.3.0"
145-
vector_math:
178+
version: "2.1.4"
179+
vm_service:
146180
dependency: transitive
147181
description:
148-
name: vector_math
149-
url: "https://pub.dartlang.org"
182+
name: vm_service
183+
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
184+
url: "https://pub.dev"
150185
source: hosted
151-
version: "2.1.1"
186+
version: "14.3.0"
152187
sdks:
153-
dart: ">=2.15.0 <3.0.0"
188+
dart: ">=3.4.0 <4.0.0"
189+
flutter: ">=3.18.0-18.0.pre.54"

0 commit comments

Comments
 (0)