Water graph

import 'package:menstrual_cycle_widget/menstrual_cycle_widget.dart';

class MenstrualCycleGraphExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Water graph'),
      ),
      body: MenstrualCycleWaterGraph(
        waterUnits: WaterUnits.liters,
        isShowMoreOptions: true,
        onPdfDownloadCallback: (pdfPath) async {
          // This function will be called when the user downloads an pdf
          // pdfPath contains the path to the downloaded pdf
        },
        onImageDownloadCallback: (imagePath) async {
          // This function will be called when the user downloads an image
          // imagePath contains the path to the downloaded image
        },
      ),
    );
  }
}

Parameter

Parameters
Datatype
Description
Default Value

loadingText

String

Specify the loading text while fetch data from databse.

Loading...

isShowMoreOptions

bool

Specify as true to show download image and pdf options into right-top of graph.

false

onImageDownloadCallback

Function

Callback this function if user download image. It's return a path of the image.

-

onPdfDownloadCallback

Function

Callback this function if user download pdf. It's return a path of the image.

-

xAxisTitle

String

Specify the title of xAxis

Cycle start date

xAxisTitleTextStyle

TextStyle

Specify the text style of xAxis

TextStyle(color: Colors.black, fontSize: 10)

isShowXAxisTitle

bool

Speficy false if want to hide xAxis title

true

yAxisTitle

String

Specify the title of yAxis

Cycle length (in days)

yAxisTitleTextStyle

TextStyle

Specify the text style of yAxis

TextStyle(color: Colors.black, fontSize: 10)

isShowYAxisTitle

bool

Speficy false if want to hide yAxis title

true

waterUnits

WaterUnits

Specify the unit of water you want to show

WaterUnits.liters

tooltipBackgroundColor

Color

Specify the color of tooltip backgound

Colors.black

graphColor

Color

Specify the color of graph

Colors.blue

Last updated