The Atsign FoundationThe Atsign Foundation

pub package gitHub license

Overview

The at_events_flutter package is for Flutter developers who would like to integrate event management feature in their apps.

This open source package is written in Dart, supports Flutter and follows the atPlatform's decentralized, edge computing model with the following features:

  • Cryptographic control of data access through personal data stores
  • No application backend needed
  • End to end encryption where only the data owner has the keys
  • Private and surveillance free connectivity
  • Create and update event with location and participants

We call giving people control of access to their data “flipping the internet” and you can learn more about how it works by reading this overview.

Get Started:

There are three options to get started using this package.

1. Quick start - generate a skeleton app with at_app

This package includes a working sample application in the Example directory that you can use to create a personalized copy using at_app create in four commands.

$ flutter pub global activate at_app 
$ at_app create --sample=<package ID> <app name> 
$ cd <app name>
$ flutter run

Notes:

  1. You only need to run flutter pub global activate once
  2. Use at_app.bat for Windows

2. Clone it from GitHub

Feel free to fork a copy of the source from the GitHub repo. The example code contained there is the same as the template that is used by at_app above.

$ git clone https://github.com/atsign-foundation/at_widgets.git

3. Manually add the package to a project

Instructions on how to manually add this package to you project can be found on pub.dev here.

How it works

Setup

Initialising:

It is expected that the app will first authenticate an atsign using the Onboarding widget.

The event service needs to be initialised with a required GlobalKey

  initialiseEventService(
    navKey,
    mapKey: 'xxxx',
    apiKey: 'xxxx',
    rootDomain: 'root.atsign.org',
    streamAlternative: (__){},
    initLocation: true,
  );

As this package needs location permission, so add these for:

IOS: (ios/Runner/Info.plist)

<key>NSLocationWhenInUseUsageDescription</key>
<string>Explain the description here.</string>

Android: (android/app/src/main/AndroidManifest.xml)

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

at_events_flutter depends on at_location_flutter for the following features:

  • Sending/receiving location, make sure to initialise at_location_flutter inside/outside the at_events_flutter package, if location sharing is needed.
  • To render the map, pass mapKey to initializeLocationService, if map is needed.
  • To calculate the ETA, pass apiKey to initializeLocationService, if ETA is needed.

Usage

To create a new event, using the default screen:

  CreateEvent(
    AtClientManager.getInstance(),
  ),

To use event creation/edit functions, use the EventService() singleton, make sure to call EventService().init() before using these functions:

  • createEvent() - Can create and edit based on isEventUpdate passed to init()
  • editEvent() - Will update the already created event
  • sendEventNotification() - Will create a new event

Navigating to the map screen for an event:

EventsMapScreenData().moveToEventScreen(eventNotificationModel);

Different datatypes used in the package:

 - EventNotificationModel: Contains the details of an event and is sent to atsigns while creating an event.
 - EventKeyLocationModel - The package uses this to keep a track of all the event notifications.

Steps to get mapKey

Steps to get apiKey

Example

We have a good example with explanation in the at_events_flutter package.

Open source usage and contributions

This is open source code, so feel free to use it as is, suggest changes or enhancements or create your own version. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.

Libraries

services/at_event_notification_listener
at_events_flutter
common_components/bottom_sheet
utils/colors
common_components/concurrent_event_request_dialog
utils/constants
common_components/contact_list_tile
This widget is a list tile to display contacts selected for sharing it takes onlyRemovemethod as a boolean with default value as false if true trailing icon remains close icon onAdd method is disabled all isSelected functionalities are disabled
services/contact_service
common_components/contacts_initials
This is a widget to display the initials of an atsign which does not have a profile picture it takes in @param size as a double and @param initials as String and display those initials in a circular avatar with random colors
screens/create_event
common_components/custom_button
common_components/custom_circle_avatar
common_components/custom_heading
common_components/custom_popup_route
common_components/custom_toast
common_components/display_tile
common_components/draggable_symbol
models/enums_model
common_components/error_screen
models/event_key_location_model
services/event_key_stream_service
models/event_member_location
models/event_notification
screens/notification_dialog/event_notification_dialog
services/event_services
common_components/event_time_selection
screens/map_screen/events_collapsed_content
screens/map_screen/events_map_screen
common_components/floating_icon
services/home_event_service
models/hybrid_notifiation_model
utils/init_events_service
common_components/invite_card
common_components/loading_widget
common_components/location_tile
screens/one_day_event
common_components/overlapping_contacts
screens/map_screen/participants
common_components/pop_button
screens/recurring_event
screens/select_location
screens/selected_location
utils/text_styles
common_components/text_tile
utils/texts
common_components/triple_dot_loading
services/venues_services