tibetan_calendar 0.0.1 tibetan_calendar: ^0.0.1 copied to clipboard
Tibetan Calendar
import 'package:flutter/material.dart';
import 'package:tibetan_calendar/tibetan_calendar.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
Calendar tibDate;
@override
Widget build(BuildContext context) {
//print(TibetanCalendar.getTibetanDate(DateTime.now()));
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
child: Text('Get Today Date'),
onPressed: () {
tibDate = TibetanCalendar.getTibetanDate(DateTime.now());
setState(() {});
},
),
SizedBox(
height: 20,
),
tibDate != null
? Text('${tibDate.day + 1}/${tibDate.month}/${tibDate.year}')
: Text('Click button')
],
),
),
),
);
}
}