sliver_bar_chart

Flutter Website Dart Website MIT License

A package that supports Bar Chart in a Flutter Sliver. This Package allow us to add Bar Chart in Sliver and its set a Bar Chart as a Header on Slivers Scroll.

Key Features

  • easy way to add Bar Chart in a Sliver.
  • used to set a Bar Chart as a Sliver Header.

Preview

sliver_bar_chart

Basic Usage

Import it to your project file

import 'package:sliver_bar_chart/sliver_bar_chart.dart';

And add it in its most basic form like it:

SliverBarChart(
  barWidget: BarChartWidget(
    minHeight: 100.0,
    maxHeight: 1000.0,
    barValues: [
      BarChartData(
        x: '2022',
        y: 500.0,
        barColor: Colors.blue,
      ),
    ],
    isScrolling: true,
  ),
);

Required parameters of SliverBarChart


ParameterDescription
BarChartWidget barWidgetUsed to paint bar chart using custom painter

Optional parameters of SliverBarChart


ParameterDefaultDescription
bool restrainfalseWhether to stick the header to the start of the viewport once it has reached its minimum size
bool scrolling-Whether sliver is scrolling or not
List50.0, 78.0, 90.0, 67.0, 36.0The array of height for generating the bars of the Bar Chart
double maxWidth75.0The maximum width dimensions of the sliver
double minHeight30.0The minimum height dimensions of the sliver
double maxHeight175.0The maximum height dimensions of the sliver
bool fluctuatingfalseWhether the header should immediately grow again if the user reverses scroll direction

Required parameters of BarChartWidget


ParameterDescription
double minHeightThe minimum height dimensions of the BarChartWidget
double maxHeightThe maximum height dimensions of the BarChartWidget
Listhold the list of bar chart data
bool isScrollingWhether sliver is scrolling or not

Optional parameters of BarChartWidget


ParameterDefaultDescription
int yAxisIntervalCount5Used to set interval point on Y axis
double xAxisTextRotationAngle0.0Used to set X axis text on a rotation angle in case of larger text

Required parameters of BarChartData Model Class


ParameterDescription
String xa text that visible on Bar Chart X axis
double ya value that visible on Bar Chart Y axis

Optional parameters of BarChartData Model Class


ParameterDefaultDescription
Color barColorColors.greyused to set color of the bar

Guideline for contributors


  • Contribution towards our repository is always welcome, we request contributors to create a pull request for development.

Guideline to report an issue/feature request


It would be great for us if the reporter can share the below things to understand the root cause of the issue.

  • Library version
  • Code snippet
  • Logs if applicable
  • Device specification like (Manufacturer, OS version, etc)
  • Screenshot/video with steps to reproduce the issue
  • Library used

LICENSE!

sliver_bar_chart is MIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to sales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.

Libraries

sliver_bar_chart