-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sarika gautam
authored and
sarika gautam
committed
Mar 14, 2022
1 parent
b5f50a9
commit 04f7487
Showing
3 changed files
with
103 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<img width=250px src="https://atsign.dev/assets/img/@platform_logo_grey.svg?sanitize=true"> | ||
|
||
## at_events_flutter example | ||
The [at_events_flutter] package is designed to make it easy to manage events between atsigns. | ||
|
||
### Give it a try | ||
This package includes a working sample application in the [example](https://github.com/atsign-foundation/at_widgets/tree/trunk/at_events_flutter/example) directory that demonstrates the key features of the package. To create a personalized copy, use ```at_app create``` as shown below or check it out on GitHub. | ||
|
||
```sh | ||
$ 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 | ||
|
||
## How it works | ||
|
||
Like most applications built for the @platform, we start with the [at_onboarding_flutter](https://pub.dev/packages/at_onboarding_flutter) widget which handles secure management of secret keys for an atsign as cryptographically secure replacement for usernames and passwords. | ||
|
||
We use the [Onboarding()] widget in our [main.dart] and navigate to our [second_screen.dart] after successfully onboarding. | ||
|
||
If you want to remove any already paired atsign, use the `Clear paired atsigns` button, it will remove all the paired atsigns for this example package. | ||
|
||
As the [at_events_flutter] package has to be initialised, so we initialise it in the [init()] of `second_screen.dart` by calling | ||
```dart | ||
initialiseEventService(NavService.navKey, | ||
mapKey: dotenv.get('MAP_KEY'), | ||
apiKey: dotenv.get('API_KEY'), | ||
rootDomain: 'root.atsign.org', | ||
streamAlternative: updateEvents | ||
); | ||
``` | ||
NOTE: | ||
1. Make sure to pass in the [MAP_KEY] and the [API_KEY] in the `.env` file. | ||
2. The [at_events_flutter] depends on [at_location_flutter] for location sharing, so we use the default value of [initLocation] (true) in [initialiseEventService()]. | ||
|
||
We also pass a function [updateEvents] to [initialiseEventService()] in the [streamAlternative] parameter which will give us a list of updated events from the [at_events_flutter] package. | ||
|
||
The [second_screen.dart] consists of the following functions: | ||
- Create event - Will build the default create event bottomsheet. To use this functionality call [CreateEvent()]. | ||
- Move to the map screen for an event - Call [HomeEventService().onEventModelTap()] and pass in the event parameter. | ||
|
||
## Open source usage and contributions | ||
|
||
Like everything else we do, this package and even the sample application are open source software which means we love it when you gift us with your feedback, contributions and even any bugs that you help us to discover. See [CONTRIBUTING.md](https://github.com/atsign-foundation/at_widgets/blob/trunk/CONTRIBUTING.md) for detailed guidance on how to setup tools, tests and make a pull request. |