support for flutter 3.27 and removed deprecation warnings

This commit is contained in:
rjahn 2025-01-14 15:54:29 +01:00
parent 41356d7a78
commit 6985aa366b
7 changed files with 116 additions and 80 deletions

View file

@ -55,11 +55,11 @@ class ExpanderThemeData {
const ExpanderThemeData({ const ExpanderThemeData({
this.color, this.color,
this.position: ExpanderPosition.start, this.position = ExpanderPosition.start,
this.type: ExpanderType.caret, this.type = ExpanderType.caret,
this.size: _kDefaultExpanderSize, this.size = _kDefaultExpanderSize,
this.modifier: ExpanderModifier.none, this.modifier = ExpanderModifier.none,
this.animated: true, this.animated = true,
}); });
/// Creates an expander icon theme with some reasonable default values. /// Creates an expander icon theme with some reasonable default values.
@ -129,5 +129,5 @@ class ExpanderThemeData {
@override @override
int get hashCode => int get hashCode =>
hashValues(color, position, type, size, modifier, animated); Object.hash(color, position, type, size, modifier, animated);
} }

View file

@ -41,9 +41,9 @@ class Node<T> {
const Node({ const Node({
required this.key, required this.key,
required this.label, required this.label,
this.children: const [], this.children = const [],
this.expanded: false, this.expanded = false,
this.parent: false, this.parent = false,
this.icon, this.icon,
this.data, this.data,
}); });
@ -152,7 +152,7 @@ class Node<T> {
@override @override
int get hashCode { int get hashCode {
return hashValues( return Object.hash(
key, key,
label, label,
icon, icon,

View file

@ -87,10 +87,10 @@ class TreeView<T> extends InheritedWidget {
this.onNodeLongPress, this.onNodeLongPress,
this.physics, this.physics,
this.onExpansionChanged, this.onExpansionChanged,
this.allowParentSelect: false, this.allowParentSelect = false,
this.supportParentDoubleTap: false, this.supportParentDoubleTap = false,
this.shrinkWrap: false, this.shrinkWrap = false,
this.primary: true, this.primary = true,
this.nodeBuilder, this.nodeBuilder,
TreeViewTheme? theme, TreeViewTheme? theme,
}) : this.theme = theme ?? const TreeViewTheme(), }) : this.theme = theme ?? const TreeViewTheme(),

View file

@ -38,7 +38,7 @@ class TreeViewController<T> {
final String? selectedKey; final String? selectedKey;
TreeViewController({ TreeViewController({
this.children: const [], this.children = const [],
this.selectedKey, this.selectedKey,
}); });
@ -60,7 +60,7 @@ class TreeViewController<T> {
/// controller = controller.loadJSON(json: jsonString); /// controller = controller.loadJSON(json: jsonString);
/// }); /// });
/// ``` /// ```
TreeViewController loadJSON({String json: '[]'}) { TreeViewController loadJSON({String json = '[]'}) {
List jsonList = jsonDecode(json); List jsonList = jsonDecode(json);
List<Map<String, dynamic>> list = List<Map<String, dynamic>>.from(jsonList); List<Map<String, dynamic>> list = List<Map<String, dynamic>>.from(jsonList);
return loadMap(list: list); return loadMap(list: list);
@ -74,7 +74,7 @@ class TreeViewController<T> {
/// controller = controller.loadMap(map: dataMap); /// controller = controller.loadMap(map: dataMap);
/// }); /// });
/// ``` /// ```
TreeViewController loadMap({List<Map<String, dynamic>> list: const []}) { TreeViewController loadMap({List<Map<String, dynamic>> list = const []}) {
List<Node<T>> treeData = List<Node<T>> treeData =
list.map((Map<String, dynamic> item) => Node<T>.fromMap(item)).toList(); list.map((Map<String, dynamic> item) => Node<T>.fromMap(item)).toList();
return TreeViewController( return TreeViewController(
@ -100,7 +100,7 @@ class TreeViewController<T> {
Node<T> newNode, { Node<T> newNode, {
Node<T>? parent, Node<T>? parent,
int? index, int? index,
InsertMode mode: InsertMode.append, InsertMode mode = InsertMode.append,
}) { }) {
List<Node<T>> _data = List<Node<T>> _data =
addNode(key, newNode, parent: parent, mode: mode, index: index); addNode(key, newNode, parent: parent, mode: mode, index: index);
@ -394,7 +394,7 @@ class TreeViewController<T> {
Node<T> newNode, { Node<T> newNode, {
Node<T>? parent, Node<T>? parent,
int? index, int? index,
InsertMode mode: InsertMode.append, InsertMode mode = InsertMode.append,
}) { }) {
List<Node<T>> _children = parent == null ? this.children : parent.children; List<Node<T>> _children = parent == null ? this.children : parent.children;
return _children.map((Node<T> child) { return _children.map((Node<T> child) {

View file

@ -59,19 +59,19 @@ class TreeViewTheme {
final Duration expandSpeed; final Duration expandSpeed;
const TreeViewTheme({ const TreeViewTheme({
this.colorScheme: const ColorScheme.light(), this.colorScheme = const ColorScheme.light(),
this.iconTheme: const IconThemeData.fallback(), this.iconTheme = const IconThemeData.fallback(),
this.expanderTheme: const ExpanderThemeData.fallback(), this.expanderTheme = const ExpanderThemeData.fallback(),
this.labelStyle: const TextStyle(), this.labelStyle = const TextStyle(),
this.parentLabelStyle: const TextStyle(fontWeight: FontWeight.bold), this.parentLabelStyle = const TextStyle(fontWeight: FontWeight.bold),
this.labelOverflow, this.labelOverflow,
this.parentLabelOverflow, this.parentLabelOverflow,
this.levelPadding: _kDefaultLevelPadding, this.levelPadding = _kDefaultLevelPadding,
this.dense: true, this.dense = true,
this.verticalSpacing, this.verticalSpacing,
this.horizontalSpacing, this.horizontalSpacing,
this.iconPadding: 8, this.iconPadding = 8,
this.expandSpeed: const Duration(milliseconds: _kExpandSpeed), this.expandSpeed = const Duration(milliseconds: _kExpandSpeed),
}); });
/// Creates a [TreeView] theme with some reasonable default values. /// Creates a [TreeView] theme with some reasonable default values.
@ -154,7 +154,7 @@ class TreeViewTheme {
@override @override
int get hashCode { int get hashCode {
return hashValues( return Object.hash(
colorScheme, colorScheme,
levelPadding, levelPadding,
iconPadding, iconPadding,

View file

@ -9,7 +9,7 @@ class Utilities {
static const Color WHITE = Color.fromARGB(255, 255, 255, 255); static const Color WHITE = Color.fromARGB(255, 255, 255, 255);
static String toRGBA(Color color) { static String toRGBA(Color color) {
return 'rgba(${color.red},${color.green},${color.blue},${color.alpha / 255})'; return 'rgba(${color.r},${color.g},${color.b},${color.a / 255})';
} }
static Color textColor(Color color) { static Color textColor(Color color) {

View file

@ -5,51 +5,50 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.8.2" version: "2.11.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.3.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted source: hosted
version: "1.15.0" version: "1.19.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.3.1"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -60,94 +59,131 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.11" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.3" version: "0.11.1"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted source: hosted
version: "1.7.0" version: "1.15.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.0" version: "1.9.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.0"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.1" version: "1.10.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.12.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.3.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.8" version: "0.7.3"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.3.0"
sdks: sdks:
dart: ">=2.15.0 <3.0.0" dart: ">=3.4.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"