Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0e386ed
chore: begin adding flutter docs
Jul 13, 2020
586e8a9
Prepare basic Flutter Docs Framework
fjnoyp Jul 16, 2020
b0af6a7
Basic Flutter Analytics Module Docs
fjnoyp Jul 20, 2020
e4bc239
Minor Doc Feedback Changes
fjnoyp Aug 15, 2020
fc27572
initial docs for signIn, signUp and confirmSignUp
Jul 22, 2020
aee3041
add dart language support
Jul 22, 2020
e75f135
spelling issues
Jul 31, 2020
7b6a903
feat(flutter): password management, hubEvents, confirmation, signOut …
Aug 4, 2020
edf3baa
add try catches
Aug 5, 2020
87563db
added credential page
haverchuck Aug 9, 2020
892b4b0
cr suggestions
haverchuck Aug 10, 2020
e5a39d1
user attributes section for flutter
haverchuck Aug 12, 2020
8ffd9c8
param name correction
haverchuck Aug 12, 2020
138b850
fix(amplify-flutter) interface changes and credential clarification
haverchuck Aug 14, 2020
eeafc96
Initial SampleApp Docs PR
fjnoyp Aug 15, 2020
bfcb7ec
Add Flutter Disclaimer
fjnoyp Aug 15, 2020
5e93d48
Finalize Docs for Sample App
fjnoyp Aug 15, 2020
78f119f
EscapeHatch + ExistingResources
fjnoyp Aug 17, 2020
21234f7
SDK -> Library
fjnoyp Aug 17, 2020
541ef7e
Fix dependency
fjnoyp Aug 17, 2020
ac9aa21
Simplify GettingStarted Docs
fjnoyp Aug 17, 2020
003663f
Minor Fixes
fjnoyp Aug 17, 2020
330bba7
Remove GraphQL - DataStore Flutter Sections
fjnoyp Aug 18, 2020
1b3de1d
feat(amplify-flutter) storage docs (#2)
haverchuck Aug 18, 2020
9918e3c
content updates
mlabieniec Aug 18, 2020
7af2256
feat(amplify-flutter) project setup section (#6)
haverchuck Aug 18, 2020
42ebae8
Minor Fixes Docs
fjnoyp Aug 18, 2020
9c363fd
PR comment fixes
fjnoyp Aug 18, 2020
9d855c2
Merge branch 'master' into flutterDocs-p0
haverchuck Aug 19, 2020
82144ad
adding jest snapshots (#7)
haverchuck Aug 19, 2020
6d552ba
remove commented out md (#8)
haverchuck Aug 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions capi/src/init-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const supportedLanguages = [
"jsx",
"sql",
"groovy",
"dart"
];

loadLanguages(supportedLanguages);
Expand Down
3 changes: 2 additions & 1 deletion capi/src/init-node/valid-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
"thead": true,
"tr": true,
"ui-component-props": true,
"ul": true
"ul": true,
"small": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ exports[`docs-choose-integration-anchor Render logic should render 1`] = `
Ionic
</h4>
</docs-card>
<docs-card vertical="">
<img alt="Flutter (Preview) Logo" slot="graphic" src="/assets/integrations/flutter.svg">
<h4 slot="heading">
Flutter (Preview)
</h4>
</docs-card>
</amplify-responsive-grid>
</docs-choose-integration-anchor>
`;
2 changes: 2 additions & 0 deletions client/src/docs-ui/footer/__snapshots__/footer.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ exports[`docs-footer Render logic should render 1`] = `
privacy policy
</amplify-external-link>
.
<ul></ul>
Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.
</span>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions client/src/docs-ui/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export class DocsFooter {
privacy policy
</amplify-external-link>
.
<ul/>
{'Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.'}
</span>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions client/src/docs-ui/landing-hero-cta/landing-hero-cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ export class DocsLandingHeroCTA {
alt="Android Icon"
/>
</docs-internal-link>
<docs-internal-link
href="/start/q/integration/flutter"
class="scale-up-on-hover"
>
<img
class={platformIcon}
src="/assets/integrations/flutter.svg"
alt="Flutter Icon"
/>
</docs-internal-link>
</div>
</Host>
);
Expand Down
12 changes: 11 additions & 1 deletion client/src/utils/filter-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ type FilterMetadataByOption<T extends readonly string[]> = Record<
* platform filter constants
*/

export const PLATFORM_FILTER_OPTIONS = ["js", "android", "ios"] as const;
export const PLATFORM_FILTER_OPTIONS = [
"js",
"android",
"ios",
"flutter",
] as const;

export const platformFilterMetadataByOption: FilterMetadataByOption<typeof PLATFORM_FILTER_OPTIONS> = {
js: {
Expand All @@ -32,6 +37,10 @@ export const platformFilterMetadataByOption: FilterMetadataByOption<typeof PLATF
label: "iOS",
graphicURI: "/assets/integrations/ios.svg",
},
flutter: {
label: "Flutter (Preview)",
graphicURI: "/assets/integrations/flutter.svg",
},
} as const;

/**
Expand Down Expand Up @@ -74,6 +83,7 @@ export const mobileFilterMetadataByOption = {
ios: platformFilterMetadataByOption.ios,
"react-native": frameworkFilterMetadataByOption["react-native"],
ionic: frameworkFilterMetadataByOption.ionic,
flutter: platformFilterMetadataByOption.flutter,
};

export const webFilterMetadataByOption = {
Expand Down
16 changes: 15 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
"cancelHandler",
"CannedAccessControlList.PublicRead",
"CannedAccessControlList",
"cantguessthis",
"capacityInBytes",
"Capitan",
"captcha",
Expand Down Expand Up @@ -466,6 +467,7 @@
"DeltaSync",
"Deltum",
"deserialize",
"destinationpath",
"details.getDestination",
"dev",
"devcorpuser",
Expand Down Expand Up @@ -549,6 +551,7 @@
"getApplicationContext",
"getCacheCurSize",
"getCredentials",
"GETCURRENTUSER",
"getDeliveryMedium",
"getIdentityId",
"getIdToken",
Expand Down Expand Up @@ -740,6 +743,8 @@
"mouseover",
"mqttv",
"msg",
"mysupersecurepassword",
"myusername",
"Mult",
"multenvtest",
"multienv",
Expand All @@ -766,6 +771,8 @@
"mykey",
"mylambda",
"mynextapp",
"mynewpassword",
"myoldpassword",
"myPrivatePrefix,",
"myprivateprefix",
"myPublicPrefix,",
Expand Down Expand Up @@ -901,6 +908,7 @@
"proxied",
"pseudocode",
"publicRead",
"pubspec",
"pubsub",
"Pubsub",
"PubSub",
Expand Down Expand Up @@ -1058,6 +1066,7 @@
"SSECustomerKeyMD5",
"SSEKMS",
"ssn",
"Stateful",
"status#createdAt",
"statusCreatedAt",
"Storage.get",
Expand Down Expand Up @@ -1264,7 +1273,12 @@
"confirmsignupcustomflow",
"confirmingsignincustomflow",
"verifyingattributes",
"resettingpassword"
"resettingpassword",
"pubspec",
"Stateful",
"GETCURRENTUSER",
"amplifyconfig",
"Uploader"
],
"flagWords": ["hte"]
}
9 changes: 9 additions & 0 deletions docs/assets/integrations/flutter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/fragments/lib/flutter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<amplify-callout warning>

Welcome to Flutter Developer Preview documentation.

</amplify-callout>

## Amplify Flutter

This guide shows how to build an app using our Amplify Libraries for Flutter and the Amplify CLI toolchain.


<docs-internal-link-button href="~/lib/project-setup/prereq.md">
<span slot="text">Get Started 🚀</span>
</docs-internal-link-button>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/lib/analytics/autotrack.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ description: The Amplify analytics plugin records when an application opens and

<inline-fragment platform="js" src="~/lib/analytics/fragments/js/autotrack.md"></inline-fragment>
<inline-fragment platform="ios" src="~/lib/analytics/fragments/autotrack.md"></inline-fragment>
<inline-fragment platform="android" src="~/lib/analytics/fragments/autotrack.md"></inline-fragment>
<inline-fragment platform="android" src="~/lib/analytics/fragments/autotrack.md"></inline-fragment>
<inline-fragment platform="flutter" src="~/lib/analytics/fragments/autotrack.md"></inline-fragment>
1 change: 1 addition & 0 deletions docs/lib/analytics/existing-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ description: Configure the Amplify Libraries to use existing Amazon Pinpoint res

<inline-fragment platform="android" src="~/lib/analytics/fragments/existing-resources.md"></inline-fragment>
<inline-fragment platform="ios" src="~/lib/analytics/fragments/existing-resources.md"></inline-fragment>
<inline-fragment platform="flutter" src="~/lib/analytics/fragments/existing-resources.md"></inline-fragment>
2 changes: 1 addition & 1 deletion docs/lib/analytics/fragments/existing-resources.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Existing Amazon Pinpoint resources can be used with the Amplify Libraries by referencing your **Application ID** and **Region** in your `amplifyconfiguration.json` file.

```json
```dart
{
"analytics": {
"plugins": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* [Install and configure Amplify CLI](https://docs.amplify.aws/cli/start/install)
* A Flutter application targeting Flutter SDK >= 1.20 with Amplify libraries integrated
* For a full example of please follow the [project setup walkthrough](~/lib/project-setup/create-application.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
In your Flutter project directory, open **pubspec.yaml**.

> You will already have configured Amplify by following the steps in the project setup.

Add Analytics by adding these libraries into your dependencies block:

```yaml
dependencies:

# Should already be added during Project Setup walkthrough
amplify_core:
path: '<1.0.0'

# Add these lines in `dependencies`
amplify_analytics_pinpoint:
path: '<1.0.0'
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
To initialize the Amplify Auth and Analytics categories call the `Amplify.addPlugin()` method for each category. To complete initialization call `Amplify.configure()`.

Add the following code to the `initState` method


```dart
Amplify.addPlugin(new AWSCognitoAuthPlugin());
Amplify.addPlugin(new AmplifyAnalyticsPinpointPlugin());
```

(VERIFY, To be determined) Make sure that the amplifyconfiguration.dart file generated in the project setup is included and sent to Amplify.configure:

```dart
import 'amplifyconfiguration.dart';

Amplify.configure( amplifyConfig )
```

Your class will look like this:

```dart
import 'amplifyconfiguration.dart';

class MyAmplifyApp extends StatefulWidget {

@override
void initState() {
super.initState();

Amplify.addPlugin(new AWSCognitoAuthPlugin());
Amplify.addPlugin(new AWSPinpointAnalyticsPlugin(this));

Amplify.configure( amplifyConfig );

}
}
```
12 changes: 12 additions & 0 deletions docs/lib/analytics/fragments/flutter/getting-started/40_record.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
To record an event, create an `AnalyticsEvent` and call `Amplify.Analytics.recordEvent()`:

```dart
AnalyticsEvent event = AnalyticsEvent("test");

event.properties.addBoolProperty("boolKey", true);
event.properties.addDoubleProperty("doubleKey", 10.0);
event.properties.addIntProperty("intKey", 10);
event.properties.addStringProperty("stringKey", "stringValue");

Amplify.Analytics.recordEvent(event: event);
```
28 changes: 28 additions & 0 deletions docs/lib/analytics/fragments/flutter/identifyuser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
This call sends information that you have specified about a user to Amazon Pinpoint. This could be for an unauthenticated (guest) or an authenticated user.

You can get the current user's ID from the Amplify Auth category as shown below. Be sure you have it added and setup per the Auth category documentation.

If you have asked for location access and received permission, you can also provide that in `AnalyticsUserProfileLocation`


```dart

AnalyticsUserProfileLocation location = new AnalyticsUserProfileLocation();
location.latitude = 47.606209;
location.longitude = -122.332069;
location.postalCode = "98122";
location.city = "Seattle";
location.region = "WA";
location.country = "USA";

AnalyticsProperties properties = new AnalyticsProperties();
properties.addStringProperty("phoneNumber", "+11234567890");
properties.addIntProperty("age", 25);

AnalyticsUserProfile userProfile = new AnalyticsUserProfile();
userProfile.name = username;
userProfile.email = "name@example.com";
userProfile.location = location;

Amplify.Analytics.identifyUser(userId: userId, userProfile: profile);
```
Loading