manage_calendar_events 2.0.0 manage_calendar_events: ^2.0.0 copied to clipboard
A flutter plugin which will help you to add, edit and remove the events (with reminders) from your (Android and ios) calendars
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
import 'screens/calendar_list.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(home: new CalendarPluginCheck());
}
}
class CalendarPluginCheck extends StatelessWidget {
final CalendarPlugin _myPlugin = CalendarPlugin();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
_myPlugin.hasPermissions().then((value) {
if (!value!) {
_myPlugin.requestPermissions();
} else {
Navigator.push(context,
MaterialPageRoute(builder: (context) => CalendarList()));
}
});
},
child: Text('Show Calendars'),
),
),
);
}
}