Body temperature graph

A Body Temperature Graph for menstrual cycle tracking is often used to visualize Basal Body Temperature (BBT) changes throughout the cycle. BBT is the lowest body temperature reached during rest and is typically measured first thing in the morning before any activity. This graph helps track ovulation and hormonal shifts, as body temperature tends to rise after ovulation due to the increase in progesterone.

import 'package:menstrual_cycle_widget/menstrual_cycle_widget.dart';

class MenstrualCycleGraphExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Body Temperature Graph'),
      ),
      body: MenstrualBodyTemperatureGraph(
        bodyTemperatureUnits: BodyTemperatureUnits.celsius,
        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...

bodyTemperatureUnits

BodyTemperatureUnits

Specify the body temperature units for graph

celsius

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

Body temperature log 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

Temperature unit

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

topGraphColor

Color

Specify top color of bar line

Colors.red

centerGraphColor

Color

Specify central color of bar line

Colors.orange

bottomGraphColor

Color

Specify bottom color of bar line

Colors.yellow

tooltipBackgroundColor

Color

Specify background color of tooltip

Colors.black

Last updated