Sleep graph

class MenstrualCycleGraphExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Sleep graph'),
      ),
      body: MenstrualSleepGraph(
        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

isShowSeriesColor

bool

Speficy false if want to hide series color

true

isShowYAxisGridLine

bool

Speficy false if want to hide header of graph

true

isShowYAxisGridLine

bool

Speficy true if want to show horizontal line into graph

false

isShowXAxisGridLine

bool

Speficy true if want to show verticle line into graph

false

tooltipBackgroundColor

Color

Specify the color of tooltip backgound

Colors.blue

themeColor

Color

Specify the color of graph

Colors.black

Last updated