flutter_timeline 0.0.1 copy "flutter_timeline: ^0.0.1" to clipboard
flutter_timeline: ^0.0.1 copied to clipboard

outdated

a fully customizable & general timeline widget, based on real-world application references

flutter_timeline #

a fully customizable & general timeline widget, based on real-world application references

Installation #

dependencies:
  flutter_timeline: latest

usage #


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 Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: _buildBody(),
      floatingActionButton: FloatingActionButton(
        onPressed: _addEvent,
        tooltip: 'add new event',
        child: Icon(Icons.add),
      ),
    );
  }

  void _addEvent() {
    setState(() {
      events.add(EventDisplay(
          child: Container(height: 100, color: Colors.grey),
          indicator: TimelineDots.of(context).simple));
    });
  }

  Widget _buildBody() {
    return _buildTimeline();
  }

  List<EventDisplay> events = [
    EventDisplay(
      child: Container(height: 200, color: Colors.grey),
    ),
    EventDisplay(
      child: Container(height: 100, color: Colors.grey),
    )
  ];

  Widget _buildTimeline() {
    return Timeline(
      events: events,
    );
  }
}

more documentation available at github

135
likes
0
pub points
86%
popularity

Publisher

verified publishergrida.co

a fully customizable & general timeline widget, based on real-world application references

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_timeline