add_2_calendar 1.0.3 copy "add_2_calendar: ^1.0.3" to clipboard
add_2_calendar: ^1.0.3 copied to clipboard

outdated

A really simple Flutter plugin to add events to each platform's default calendar.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:add_2_calendar/add_2_calendar.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  GlobalKey<ScaffoldState> scaffoldState = GlobalKey();
  @override
  Widget build(BuildContext context) {
    Event event = Event(
      title: 'Test event',
      description: 'example',
      location: 'Flutter app',
      startDate: DateTime(2019, 1, 31, 16, 49),
      endDate: DateTime(2019, 2, 1, 17, 01),
    );

    return MaterialApp(
      home: Scaffold(
        key: scaffoldState,
        appBar: AppBar(
          title: const Text('Add event to calendar example'),
        ),
        body: Center(
          child: RaisedButton(
            child: Text('Add test event to device calendar'),
            onPressed: () {
              Add2Calendar.addEvent2Cal(event).then((success) {
                scaffoldState.currentState.showSnackBar(SnackBar(content: Text(success ? 'Success' : 'Error')));
              });
            },
          ),
        ),
      ),
    );
  }
}
290
likes
0
pub points
98%
popularity

Publisher

unverified uploader

A really simple Flutter plugin to add events to each platform's default calendar.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on add_2_calendar