updated readme - v 1
This commit is contained in:
parent
f7886e5a09
commit
d8401b6038
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,3 +1,9 @@
|
||||
## 0.0.1
|
||||
## 0.0.1 (Initial Release)
|
||||
|
||||
- Initial release of the real_time_chart package.
|
||||
- Added the RealTimeChart widget, which displays a real-time graph of data.
|
||||
- Supports positive and negative values.
|
||||
- Adapts height depending on max value.
|
||||
- Includes example usage with a stream of data.
|
||||
|
||||
|
||||
* TODO: Describe initial release.
|
||||
|
65
README.md
65
README.md
@ -1,39 +1,60 @@
|
||||
<!--
|
||||
This README describes the package. If you publish this package to pub.dev,
|
||||
this README's contents appear on the landing page for your package.
|
||||
# Real-time Chart
|
||||
|
||||
For information about how to write a good package README, see the guide for
|
||||
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
|
||||
A Flutter package for displaying real-time charts with flexible customization options.
|
||||
|
||||
|
||||
<img src="https://raw.githubusercontent.com/tajaouart/real_time_chart/main/real_time_chart_demo.gif" height="600"/>
|
||||
|
||||
For general information about developing packages, see the Dart guide for
|
||||
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
|
||||
and the Flutter guide for
|
||||
[developing packages and plugins](https://flutter.dev/developing-packages).
|
||||
-->
|
||||
|
||||
TODO: Put a short description of the package here that helps potential users
|
||||
know whether this package might be useful for them.
|
||||
|
||||
## Features
|
||||
|
||||
TODO: List what your package can do. Maybe include images, gifs, or videos.
|
||||
- Display real-time data on a graph
|
||||
- Supports negative values
|
||||
- Adapts height automatically based on the maximum value
|
||||
- Customizable colors, axis labels, and grid lines
|
||||
|
||||
## Getting started
|
||||
|
||||
TODO: List prerequisites and provide or point to information on how to
|
||||
start using the package.
|
||||
To use this package, add `real_time_chart` as a dependency in your pubspec.yaml file.
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
real_time_chart: ^0.0.1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Include short and useful examples for package users. Add longer examples
|
||||
to `/example` folder.
|
||||
To display a real-time chart, you can use the `RealTimeChart` widget. Here's an example of how to use it in your code:
|
||||
|
||||
```dart
|
||||
const like = 'sample';
|
||||
import 'package:real_time_chart/real_time_chart.dart';
|
||||
|
||||
class RealTimeChartExample extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RealTimeChart(
|
||||
stream: positiveDataStream(),
|
||||
graphColor = Colors.red,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Stream<double> positiveDataStream() {
|
||||
return Stream.periodic(const Duration(milliseconds: 500), (_) {
|
||||
return Random().nextInt(300).toDouble();
|
||||
}).asBroadcastStream();
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Additional information
|
||||
|
||||
TODO: Tell users more about the package: where to find more information, how to
|
||||
contribute to the package, how to file issues, what response they can expect
|
||||
from the package authors, and more.
|
||||
This package provides a simple solution for displaying real-time data in a graph format. It offers support for both positive and negative values and automatically adapts the height of the graph to fit the maximum value.
|
||||
|
||||
If you encounter any issues or bugs while using the package, feel free to file an issue in the [issue tracker](https://github.com/tajaouart/real_time_chart/issues). We are committed to providing quick and helpful responses to any questions or concerns that you may have.
|
||||
|
||||
If you would like to contribute to the development of this package, we welcome pull requests and any other forms of contribution. Your help and support are greatly appreciated!
|
||||
|
||||
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) 2023 Tajaouart Mounir
|
||||
//
|
||||
// This demo showcases the usage of the `RealTimeGraph` widget
|
||||
// and provides an example of how to use it in a Flutter app.
|
||||
// Website: https://tajaouart.com
|
||||
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@ -8,22 +14,23 @@ void main() {
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'Real-Time Chart Demo',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
home: const MyHomePage(title: 'Real-Time Chart Demo'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
const MyHomePage({Key? key, required this.title}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
|
||||
@ -44,7 +51,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
width: double.maxFinite,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Display a real-time graph of positive data
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.width * 0.8,
|
||||
@ -55,6 +64,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Display a real-time graph of positive data as points
|
||||
const SizedBox(height: 32),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
@ -67,7 +78,15 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Display a real-time graph of positive and negative data
|
||||
const SizedBox(height: 32),
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
'Supports negative values :',
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.width * 0.8,
|
||||
@ -80,7 +99,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// Display a real-time graph of positive and negative data as points
|
||||
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.width * 0.8,
|
||||
|
@ -1,3 +1,5 @@
|
||||
library real_time_chart;
|
||||
|
||||
export 'src/chart_display.dart';
|
||||
export 'src/point.dart';
|
||||
export 'src/live_chart.dart';
|
||||
export 'src/real_time_chart.dart';
|
38
pubspec.yaml
38
pubspec.yaml
@ -1,7 +1,7 @@
|
||||
name: real_time_chart
|
||||
description: Real-Time Chart.
|
||||
description: A Flutter package for displaying real-time charts with flexible customization options.
|
||||
version: 0.0.1
|
||||
homepage:
|
||||
homepage: https://github.com/tajaouart/real_time_chart
|
||||
|
||||
environment:
|
||||
sdk: '>=2.19.2 <3.0.0'
|
||||
@ -16,39 +16,5 @@ dev_dependencies:
|
||||
sdk: flutter
|
||||
flutter_lints: ^2.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
|
||||
# To add assets to your package, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
# - images/a_dot_ham.jpeg
|
||||
#
|
||||
# For details regarding assets in packages, see
|
||||
# https://flutter.dev/assets-and-images/#from-packages
|
||||
#
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||
|
||||
# To add custom fonts to your package, add a fonts section here,
|
||||
# in this "flutter" section. Each entry in this list should have a
|
||||
# "family" key with the font family name, and a "fonts" key with a
|
||||
# list giving the asset and other descriptors for the font. For
|
||||
# example:
|
||||
# fonts:
|
||||
# - family: Schyler
|
||||
# fonts:
|
||||
# - asset: fonts/Schyler-Regular.ttf
|
||||
# - asset: fonts/Schyler-Italic.ttf
|
||||
# style: italic
|
||||
# - family: Trajan Pro
|
||||
# fonts:
|
||||
# - asset: fonts/TrajanPro.ttf
|
||||
# - asset: fonts/TrajanPro_Bold.ttf
|
||||
# weight: 700
|
||||
#
|
||||
# For details regarding fonts in packages, see
|
||||
# https://flutter.dev/custom-fonts/#from-packages
|
||||
|
Loading…
x
Reference in New Issue
Block a user