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:
- You only need to run
flutter pub global activate
once - 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
toinitializeLocationService
, if map is needed. - To calculate the ETA, pass
apiKey
toinitializeLocationService
, 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 toinit()
- 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
- Go to https://cloud.maptiler.com/maps/streets/
- Click on
sign in
orcreate a free account
- Come back to https://cloud.maptiler.com/maps/streets/ if not redirected automatically
- Get your key from your
Embeddable viewer
input text box- Eg : https://api.maptiler.com/maps/streets/?key=<YOUR_MAP_KEY>#-0.1/-2.80318/-38.08702
- Copy <YOUR_MAP_KEY> and use it.
Steps to get apiKey
- Go to https://developer.here.com/tutorials/getting-here-credentials/ and follow the steps
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
- at_events_flutter
- common_components/bottom_sheet
- common_components/concurrent_event_request_dialog
- common_components/contact_list_tile
- common_components/contacts_initials
- 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
- common_components/error_screen
- common_components/event_time_selection
- common_components/floating_icon
- common_components/invite_card
- common_components/loading_widget
- common_components/location_tile
- common_components/overlapping_contacts
- common_components/text_tile
- common_components/triple_dot_loading
- models/enums_model
- models/event_key_location_model
- models/event_member_location
- models/event_notification
- models/hybrid_notifiation_model
- screens/create_event
- screens/map_screen/events_collapsed_content
- screens/map_screen/events_map_screen
- screens/map_screen/participants
- screens/notification_dialog/event_notification_dialog
- screens/one_day_event
- screens/recurring_event
- screens/select_location
- screens/selected_location
- services/at_event_notification_listener
- services/contact_service
- services/event_key_stream_service
- services/event_services
- services/home_event_service
- services/venues_services
- utils/colors
- utils/constants
- utils/init_events_service
- utils/text_styles
- utils/texts