Skip to main content

legacy_timeline_scrubber 4.0.0 copy "legacy_timeline_scrubber: ^4.0.0" to clipboard
legacy_timeline_scrubber: ^4.0.0 copied to clipboard

A highly customizable timeline scrubber widget for Flutter, designed for intuitive navigation through time-based data. Ideal for video players, audio editors, and gantt charts.

example/lib/main.dart

import 'package:material_ui/material_ui.dart';
import 'package:legacy_timeline_scrubber/legacy_timeline_scrubber.dart';
import 'package:provider/provider.dart';

import 'timeline_viewmodel.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) => ChangeNotifierProvider(
    create: (context) => TimelineViewModel()..init(context),
    child: MaterialApp(
      title: 'Legacy Timeline Scrubber Example',
      localizationsDelegates: GlobalMaterialLocalizations.delegates,
      theme: ThemeData(primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity),
      darkTheme: ThemeData.dark(),
      home: const MyHomePage(),
    ),
  );
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) => Consumer<TimelineViewModel>(
    builder: (context, viewModel, child) => Scaffold(
      appBar: AppBar(
        title: const Text('Legacy Timeline Scrubber Example'),
        actions: [
          Switch(
            value: viewModel.useCustomTheme,
            onChanged: (value) {
              viewModel.setUseCustomTheme(value);
            },
          ),
          const Padding(padding: EdgeInsets.all(8.0), child: Text('Use Custom Theme')),
        ],
      ),
      body: Column(
        children: [
          const SizedBox(height: 20),
          Text('Visible Window: ${viewModel.visibleStartDate} - ${viewModel.visibleEndDate}'),
          const SizedBox(height: 20),
          SizedBox(
            height: 100,
            child: LegacyGanttTimelineScrubber(
              totalStartDate: viewModel.totalStartDate,
              totalEndDate: viewModel.totalEndDate,
              visibleStartDate: viewModel.visibleStartDate,
              visibleEndDate: viewModel.visibleEndDate,
              onWindowChanged: (start, end, handle) => viewModel.onWindowChanged(start, end, handle),
              tasks: viewModel.tasks,
              theme: viewModel.theme,
            ),
          ),
        ],
      ),
    ),
  );
}
7
likes
160
points
1.17k
downloads
screenshot

Documentation

API reference

Publisher

verified publishergantt-sync.com

Weekly Downloads

A highly customizable timeline scrubber widget for Flutter, designed for intuitive navigation through time-based data. Ideal for video players, audio editors, and gantt charts.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, material_ui

More

Packages that depend on legacy_timeline_scrubber