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

outdated

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_timeline/flutter_timeline.dart';

void main() {
  runApp(TimelineDemoApp());
}

class TimelineDemoApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Timeline',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: DemoHomePage(title: 'Flutter Timeline Demo'),
    );
  }
}

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

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

class _DemoHomePageState extends State<DemoHomePage> {
  @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(TimelineEventDisplay(
          child: TimelineEventCard(
            title: Text("title"),
            content: Text("content"),
          ),
          indicator: TimelineDots.of(context).circleIcon));
    });
  }

  Widget _buildBody() {
    return _buildTimeline();
  }

  List<TimelineEventDisplay> events = [
    TimelineEventDisplay(
      child: TimelineEventCard(
        title: Text("title"),
        content: Text("content"),
      ),
    ),
    TimelineEventDisplay(
      child: Container(height: 100, color: Colors.grey),
    )
  ];

  Widget _buildTimeline() {
    return Timeline(
      indicatorSize: 56,
      indicatorStyle: PaintingStyle.stroke,
      events: events,
    );
  }
}
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