Skip to content

Commit 7bf59a4

Browse files
committed
Add Null-Safety support & Fix documentation.
1 parent 2b888cb commit 7bf59a4

File tree

12 files changed

+480
-554
lines changed

12 files changed

+480
-554
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [1.1.0] - 2021-05-03
2+
3+
* Add Null-Safety support.
4+
* Fix documentation.
5+
16
## [1.0.0] - 2021-04-11
27

38
* First release.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Add the following line to `pubspec.yaml`:
2727

2828
```yaml
2929
dependencies:
30-
flutter_bargraph: ^1.0.0
30+
flutter_bargraph: ^1.1.0
3131
```
3232
3333
### Basic setup

example/README.md

Lines changed: 81 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,87 @@
1-
# flutter_bargraph_example
1+
# flutter_bargraph
22

3-
Flutter simple example, single value bar graph viewer with indicators
3+
[![Pub Package](https://img.shields.io/pub/v/flutter_bargraph.svg?style=flat-square)](https://pub.dartlang.org/packages/flutter_bargraph) [![Package Issue](https://img.shields.io/github/issues/rickypid/flutter_bargraph)](https://github.com/rickypid/flutter_bargraph/issues)
4+
![Package License](https://img.shields.io/github/license/rickypid/flutter_bargraph)
5+
6+
Bar Graph Indicator for Flutter. It graphically displays the current value on a bar graph and manages its animation when the value changes. you can customize the orientation and direction of the bar.
7+
8+
| ![Image](https://github.com/rickypid/flutter_bargraph/blob/7f5bde4ebc40899079800127c815e01beac3abcb/doc/.media/example.gif?raw=true) |
9+
| :------------: |
10+
| **BarGraph** |
11+
12+
## Features
13+
14+
* Min/Max property
15+
* Customizable colors and text style
16+
* Vertical orientation, left to right and right to left direction
17+
* Horizontal orientation, top to bottom and bottom to top direction
18+
* Number of divisions customizable
19+
20+
## Usage
21+
22+
Make sure to check out [examples](https://github.com/rickypid/flutter_bargraph/tree/master/example).
23+
24+
### Installation
25+
26+
Add the following line to `pubspec.yaml`:
27+
28+
```yaml
29+
dependencies:
30+
flutter_bargraph: ^1.1.0
31+
```
32+
33+
### Basic setup
34+
35+
*The complete example is available [here](https://github.com/rickypid/flutter_bargraph/blob/master/example/lib/main.dart).*
36+
37+
**BarGraph** requires you to provide `min`, `max` and `value`:
38+
* `min` is the min value of BarGraph scale.
39+
* `max` is the max value of BarGraph scale.
40+
* `value` is the currently value of BarGraph scale.
41+
42+
```dart
43+
BarGraph(
44+
min: 0,
45+
max: 100.0,
46+
value: 65.0,
47+
);
48+
```
49+
50+
### Advanced options
51+
52+
#### Style
53+
54+
* `orientation` is the scale orientation, default vertical from bottom.
55+
* `indicatorStyle` is the scale indicators style, default BOTH, left and right visible.
56+
* `indicatorSpacing` is the scale indicators spacing, default SPACE_AROUND, alternative SPACE_BETWEEN.
57+
58+
#### Colors
59+
60+
* `backgroundColor` is the background color og BarGraph.
61+
* `barColor` is the color of actual value bar.
62+
* `indicatorsColor` is the color of indicators scale.
63+
64+
#### Indicators text
65+
66+
* `textStyle` is the TextStyle of indicators text.
67+
* `textAlign` is the Alignment of indicators text.
68+
* `fractionDigits` is the number of fraction digits visible.
69+
* `divisions` is the number of divisions of scale.
70+
* `textFlex` is the percentage of portion used for text, remaining space is used for indicators.
71+
72+
73+
#### Animation
74+
75+
* `animationDuration` in milliseconds, it's duration time of animation when actual value changed.
76+
77+
78+
### Example
79+
80+
| ![Image](https://github.com/rickypid/flutter_bargraph/blob/master/doc/.media/example_space_around.png?raw=true) | ![Image](https://github.com/rickypid/flutter_bargraph/blob/master/doc/.media/example_space_around_horizontal.png?raw=true) | ![Image](https://github.com/rickypid/flutter_bargraph/blob/master/doc/.media/example_space_between.png?raw=true) |
81+
| :------------: | :------------: | :------------: |
82+
| **Vertical space around** | **Horizontal space around** | **Vertical space between** |
483

5-
## Getting Started
684

7-
This project is a starting point for a Flutter application.
885

9-
A few resources to get you started if this is your first Flutter project:
1086

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
1387

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MyApp extends StatelessWidget {
2020
}
2121

2222
class MyHomePage extends StatefulWidget {
23-
MyHomePage({Key key, this.title}) : super(key: key);
23+
MyHomePage({Key? key, this.title = ''}) : super(key: key);
2424
final String title;
2525

2626
@override

example/pubspec.lock

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ packages:
4343
url: "https://pub.dartlang.org"
4444
source: hosted
4545
version: "1.15.0"
46-
cupertino_icons:
47-
dependency: "direct main"
48-
description:
49-
name: cupertino_icons
50-
url: "https://pub.dartlang.org"
51-
source: hosted
52-
version: "1.0.2"
5346
fake_async:
5447
dependency: transitive
5548
description:
@@ -63,7 +56,7 @@ packages:
6356
source: sdk
6457
version: "0.0.0"
6558
flutter_bargraph:
66-
dependency: "direct main"
59+
dependency: "direct dev"
6760
description:
6861
path: ".."
6962
relative: true
@@ -157,5 +150,5 @@ packages:
157150
source: hosted
158151
version: "2.1.0"
159152
sdks:
160-
dart: ">=2.12.0-0.0 <3.0.0"
153+
dart: ">=2.12.0 <3.0.0"
161154
flutter: ">=1.17.0"

example/pubspec.yaml

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,19 @@
11
name: flutter_bargraph_example
22
description: Flutter simple example, single value bar graph viewer with indicators
3-
4-
# The following line prevents the package from being accidentally published to
5-
# pub.dev using `pub publish`. This is preferred for private packages.
6-
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7-
8-
# The following defines the version and build number for your application.
9-
# A version number is three numbers separated by dots, like 1.2.43
10-
# followed by an optional build number separated by a +.
11-
# Both the version and the builder number may be overridden in flutter
12-
# build by specifying --build-name and --build-number, respectively.
13-
# In Android, build-name is used as versionName while build-number used as versionCode.
14-
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15-
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16-
# Read more about iOS versioning at
17-
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 1.0.0+1
3+
version: 1.1.0
194

205
environment:
21-
sdk: ">=2.7.0 <3.0.0"
6+
sdk: ">=2.12.0 <3.0.0"
227

238
dependencies:
249
flutter:
2510
sdk: flutter
26-
flutter_bargraph:
27-
path: ../
28-
29-
# The following adds the Cupertino Icons font to your application.
30-
# Use with the CupertinoIcons class for iOS style icons.
31-
cupertino_icons: ^1.0.2
3211

3312
dev_dependencies:
3413
flutter_test:
3514
sdk: flutter
15+
flutter_bargraph:
16+
path: ../
3617

37-
# For information on the generic Dart part of this file, see the
38-
# following page: https://dart.dev/tools/pub/pubspec
39-
40-
# The following section is specific to Flutter.
4118
flutter:
42-
43-
# The following line ensures that the Material Icons font is
44-
# included with your application, so that you can use the icons in
45-
# the material Icons class.
4619
uses-material-design: true
47-
48-
# To add assets to your application, add an assets section, like this:
49-
# assets:
50-
# - images/a_dot_burr.jpeg
51-
# - images/a_dot_ham.jpeg
52-
53-
# An image asset can refer to one or more resolution-specific "variants", see
54-
# https://flutter.dev/assets-and-images/#resolution-aware.
55-
56-
# For details regarding adding assets from package dependencies, see
57-
# https://flutter.dev/assets-and-images/#from-packages
58-
59-
# To add custom fonts to your application, add a fonts section here,
60-
# in this "flutter" section. Each entry in this list should have a
61-
# "family" key with the font family name, and a "fonts" key with a
62-
# list giving the asset and other descriptors for the font. For
63-
# example:
64-
# fonts:
65-
# - family: Schyler
66-
# fonts:
67-
# - asset: fonts/Schyler-Regular.ttf
68-
# - asset: fonts/Schyler-Italic.ttf
69-
# style: italic
70-
# - family: Trajan Pro
71-
# fonts:
72-
# - asset: fonts/TrajanPro.ttf
73-
# - asset: fonts/TrajanPro_Bold.ttf
74-
# weight: 700
75-
#
76-
# For details regarding fonts from package dependencies,
77-
# see https://flutter.dev/custom-fonts/#from-packages

example/test/widget_test.dart

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)