Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit a3d5189

Browse files
committed
initial commit
1 parent 72aaac7 commit a3d5189

21 files changed

Lines changed: 765 additions & 1 deletion

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ doc/api/
1919
*.js_
2020
*.js.deps
2121
*.js.map
22+
23+
.DS_Store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0
2+
3+
- Initial version.

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
# interactive_timeline
1+
<!--
2+
This README describes the package. If you publish this package to pub.dev,
3+
this README's contents appear on the landing page for your package.
4+
5+
For information about how to write a good package README, see the guide for
6+
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
7+
8+
For general information about developing packages, see the Dart guide for
9+
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
10+
and the Flutter guide for
11+
[developing packages and plugins](https://flutter.dev/developing-packages).
12+
-->
13+
14+
TODO: Put a short description of the package here that helps potential users
15+
know whether this package might be useful for them.
16+
17+
## Features
18+
19+
TODO: List what your package can do. Maybe include images, gifs, or videos.
20+
21+
## Getting started
22+
23+
TODO: List prerequisites and provide or point to information on how to
24+
start using the package.
25+
26+
## Usage
27+
28+
TODO: Include short and useful examples for package users. Add longer examples
29+
to `/example` folder.
30+
31+
```dart
32+
const like = 'sample';
33+
```
34+
35+
## Additional information
36+
37+
TODO: Tell users more about the package: where to find more information, how to
38+
contribute to the package, how to file issues, what response they can expect
39+
from the package authors, and more.

analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:interactive_timeline/interactive_timeline.dart';
3+
import 'play_button.dart';
4+
5+
void main() {
6+
runApp(const MyApp());
7+
}
8+
9+
class MyApp extends StatelessWidget {
10+
const MyApp({Key? key}) : super(key: key);
11+
12+
// This widget is the root of your application.
13+
@override
14+
Widget build(BuildContext context) {
15+
return MaterialApp(
16+
title: 'Flutter Demo',
17+
theme: ThemeData(
18+
primarySwatch: Colors.blue,
19+
),
20+
home: const MyHomePage(title: 'Flutter Demo Home Page'),
21+
);
22+
}
23+
}
24+
25+
class MyHomePage extends StatefulWidget {
26+
const MyHomePage({Key? key, required this.title}) : super(key: key);
27+
28+
final String title;
29+
30+
@override
31+
State<MyHomePage> createState() => _MyHomePageState();
32+
}
33+
34+
class _MyHomePageState extends State<MyHomePage> {
35+
TimelineCubit timelineCubit = TimelineCubit();
36+
37+
@override
38+
Widget build(BuildContext context) {
39+
return Scaffold(
40+
appBar: AppBar(
41+
title: Text(widget.title),
42+
),
43+
body: Center(
44+
child: Column(
45+
mainAxisAlignment: MainAxisAlignment.center,
46+
children: <Widget>[
47+
PlayButton(timelineCubit: timelineCubit),
48+
InteractiveTimeline(
49+
width: MediaQuery.of(context).size.width,
50+
height: 100,
51+
cubit: timelineCubit,
52+
)
53+
],
54+
),
55+
),
56+
);
57+
}
58+
}

example/lib/play_button.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_bloc/flutter_bloc.dart';
3+
import 'package:interactive_timeline/interactive_timeline.dart';
4+
5+
class PlayButton extends StatelessWidget {
6+
TimelineCubit timelineCubit;
7+
PlayButton({
8+
Key? key,
9+
required this.timelineCubit,
10+
}) : super(key: key);
11+
12+
@override
13+
Widget build(BuildContext context) {
14+
return BlocBuilder<TimelineCubit, TimelineState>(
15+
bloc: timelineCubit,
16+
builder: (context, state) {
17+
return ElevatedButton(
18+
onPressed: () => state.isPlaying ? timelineCubit.stopTimer() : timelineCubit.startTimer(),
19+
child: Text(
20+
state.isPlaying ? 'Pause' : 'Play',
21+
),
22+
);
23+
},
24+
);
25+
}
26+
}

example/pubspec.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: example
2+
description: A new Flutter project.
3+
publish_to: 'none'
4+
version: 1.0.0+1
5+
6+
environment:
7+
sdk: ">=2.17.6 <3.0.0"
8+
9+
dependencies:
10+
flutter:
11+
sdk: flutter
12+
flutter_bloc: ^8.1.1
13+
interactive_timeline:
14+
path: ../
15+
16+
dev_dependencies:
17+
flutter_test:
18+
sdk: flutter
19+
flutter_lints: ^2.0.0
20+
21+
flutter:
22+
uses-material-design: true

example/web/favicon.png

917 Bytes
Loading

example/web/icons/Icon-192.png

5.17 KB
Loading

example/web/icons/Icon-512.png

8.06 KB
Loading

0 commit comments

Comments
 (0)