We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi Guys ... For anyone need to use this library with null safety support .. follow these steps :
First : copy files from root directory -> lib -> src and paste in your project
Secound : Go to tree_view.dart
change code in line 18 to this
const TreeView({ Key? key, // add this line @required this.data, this.titleKey = 'title', this.leadingKey = 'leading', this.expanedKey = 'expaned', this.childrenKey = 'children', this.offsetLeft = 24.0, this.titleOnTap, this.leadingOnTap, this.trailingOnTap, }) : super(key: key); // replace with this line
third : Go to tree_node.dart
change code in line 17 to this :
const TreeNode({ Key? key, // add this line this.level = 0, this.expaned = false, this.offsetLeft = 24.0, this.children = const [], this.title = const Text('Title'), this.leading = const IconButton( icon: Icon(Icons.star_border), iconSize: 16, onPressed: null, ), this.trailing = const IconButton( icon: Icon(Icons.expand_more), iconSize: 16, onPressed: null, ), this.titleOnTap, this.leadingOnTap, this.trailingOnTap, }); : super(key: key); // replace with this line
in line 50 add this:
@override // add this line initState() { _isExpaned = widget.expaned; _rotationController = AnimationController( duration: const Duration(milliseconds: 300), vsync: this, ); super.initState(); }
in line 90 and line 102 :
const SizedBox(width: 6.0), // add const Expanded( child: GestureDetector( onTap: () { if (widget.titleOnTap != null && widget.titleOnTap is Function) { widget.titleOnTap(); } }, child: widget.title ?? Container(), ), ), const SizedBox(width: 6.0), // add const Visibility( visible: children.isNotEmpty, // replace with isNotEmpty
in line 136 :
Visibility( visible: children.isNotEmpty && _isExpaned, // replace with isNotEmpty child: Padding( padding: EdgeInsets.only(left: level + 1 * offsetLeft), child: Column( children: widget.children, crossAxisAlignment: CrossAxisAlignment.start, ), ), ),
That's all 👍 👍 👍
The text was updated successfully, but these errors were encountered:
It's null safety now!
Sorry, something went wrong.
No branches or pull requests
Hi Guys ...
For anyone need to use this library with null safety support .. follow these steps :
First : copy files from root directory -> lib -> src and paste in your project
Secound : Go to tree_view.dart
change code in line 18 to this
third : Go to tree_node.dart
change code in line 17 to this :
in line 50 add this:
in line 90 and line 102 :
in line 136 :
That's all 👍 👍 👍
The text was updated successfully, but these errors were encountered: