menstrual_cycle_widget 3.5.1
menstrual_cycle_widget: ^3.5.1 copied to clipboard
The 'Menstrual Cycle Widget' Widget is a comprehensive and customizable widget designed to help users to show their menstrual cycles seamlessly.
import 'package:flutter/material.dart';
import 'package:menstrual_cycle_widget/menstrual_cycle_widget.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
MenstrualCycleWidget.init(
secretKey: "11a1215l0119a140409p0919", ivKey: "23a1dfr5lyhd9a1404845001");
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Menstrual Cycle View Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
useMaterial3: true,
),
home: const MyHomePage(title: 'Menstrual Cycle View'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blueAccent,
title: Text(
widget.title,
style: TextStyle(fontSize: 20, fontFamily: MenstrualCycleWidget.defaultFontFamily,),
),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: MenstrualCycleMonthlyCalenderView(
themeColor: Colors.black,
daySelectedColor: Colors.blue,
hideInfoView: false,
onDataChanged: (value) {},
),
),
),
],
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}
copied to clipboard