dynamic_treeview 1.0.0+2

Flutter Android iOS web

A Dynamic treeview that can be build using dynamic parent/child relationship. It supports indefinite category/subcategory lists with horizontal and vertical scrolling

example/lib/main.dart

import 'package:example/ScreenOne.dart';
import 'package:example/ScreenTwo.dart';
import 'package:flutter/material.dart';
import 'package:dynamic_treeview/dynamic_treeview.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dynamic Treeview Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        appBar: AppBar(
          title: Text("Dynamic treeview sample"),
        ),
        drawer: Container(
          height: MediaQuery.of(context).size.height,
          child: DynamicTreeView(
            data: getData(),
            config: Config(
                parentTextStyle:
                    TextStyle(color: Colors.black, fontWeight: FontWeight.w600),
                parentPaddingEdgeInsets:
                    EdgeInsets.only(left: 16, top: 0, bottom: 0)),
            onChildTap: (m) {
              print("onChildTap -> $m");
              Navigator.push(
                  context,
                  MaterialPageRoute(
                      builder: (ctx) => ScreenTwo(
                            data: m,
                          )));
            },
            width: 220.0,
          ),
          color: Colors.white,
        ),
        body: Column(
          children: <Widget>[
            RaisedButton(
              onPressed: () {
                Navigator.push(
                    context, MaterialPageRoute(builder: (ctx) => ScreenOne()));
              },
              child: Text('Full Screen TreeView'),
            ),
          ],
        ), // This trailing comma makes auto-formatting nicer for build methods.
      ),
    );
  }
}
19
likes
110
pub points
76%
popularity

A Dynamic treeview that can be build using dynamic parent/child relationship. It supports indefinite category/subcategory lists with horizontal and vertical scrolling

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

infimatet@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on dynamic_treeview