Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null safety master #595

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9adafd2
feat(amplify): Null Safety Core (#492)
fjnoyp Jun 2, 2021
307db67
feat(amplify_auth): Null Safety Auth (#536)
fjnoyp Jun 2, 2021
c658308
feat(amplify_analytics): Null safety (#483)
fjnoyp May 26, 2021
e4af0c1
feat(amplify_storage_s3): Null safety (#485)
fjnoyp May 27, 2021
ba1181f
feat(amplify_api): Null safety api (#484)
fjnoyp May 29, 2021
692d60b
fix: Broken Unit Tests
fjnoyp May 26, 2021
ec7fab7
fix: upgrade Auth changes to null safety
fjnoyp Jun 2, 2021
015cecf
fix: Broken Auth Unit Tests
fjnoyp Jun 2, 2021
d4e9dbb
fix(amplify_auth_cognito): fixes auth null safety issues (#613)
haverchuck Jun 8, 2021
9479d4a
Example app null safety fixes (#617)
offlineprogrammer Jun 9, 2021
400d987
Null safety master fixes pr (#614)
fjnoyp Jun 9, 2021
ea81a38
chore(release): 0.2.0-nullsafety.0 (#622)
fjnoyp Jun 9, 2021
e68a4be
Update FlutterFetchCognitoAuthSessionResult.kt (#653)
Jun 18, 2021
75f78a1
Null safety datastore (#649)
fjnoyp Jun 21, 2021
e456ecb
chore: release 0.2.0-nullsafety.1 (#656)
haverchuck Jun 21, 2021
b34b71f
bug(datastore): HubEvent null check (#670)
dnys1 Jun 24, 2021
4cc71a1
Null safety master rebase (#676)
fjnoyp Jun 28, 2021
d23a816
fix(amplify_datstore): mprovider compile issue (#681)
fjnoyp Jun 28, 2021
00dbc7a
chore: remove deprecated method - configureModelProvider
Jun 28, 2021
9f0d90a
Revert "chore: remove deprecated method - configureModelProvider"
Jun 28, 2021
dc252de
Revert "Revert "chore: remove deprecated method - configureModelProvi…
cshfang Jun 28, 2021
04358e8
fix(Auth): Remove use of TypeToken (#683)
Jordan-Nelson Jun 28, 2021
1b197f6
fix(auth): update user attribute serialization (#684)
Jordan-Nelson Jun 29, 2021
d3bdb80
Fix enum string function (#687)
dnys1 Jun 30, 2021
5eeca68
fix(auth): uses nextStep helper for signInResult on Android (#689)
haverchuck Jun 30, 2021
bf394bb
chore: release 0.2.0 (#690)
haverchuck Jun 30, 2021
5e7fd30
Merge branch 'master' into null-safety-master
fjnoyp Jul 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
2 changes: 1 addition & 1 deletion example/lib/Pages/LandingPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import '../Views/SignUpView.dart';
import 'MainPage.dart';

class LandingPage extends StatefulWidget {
LandingPage({Key key}) : super(key: key);
LandingPage({Key? key}) : super(key: key);

@override
_LandingPageState createState() => _LandingPageState();
Expand Down
4 changes: 2 additions & 2 deletions example/lib/Views/ImageLineItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class ImageLineItem extends StatelessWidget {
final String storageKey;

const ImageLineItem({
Key key,
this.storageKey,
Key? key,
required this.storageKey,
}) : super(key: key);

@override
Expand Down
2 changes: 1 addition & 1 deletion example/lib/Views/ImagePreview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class ImagePreview extends StatefulWidget {
final String storageKey;

ImagePreview({Key key, this.storageKey}) : super(key: key);
ImagePreview({Key? key, required this.storageKey}) : super(key: key);

@override
_ImagePreviewState createState() => _ImagePreviewState();
Expand Down
6 changes: 5 additions & 1 deletion example/lib/Views/ImageUploader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import 'package:amplify_storage_s3/amplify_storage_s3.dart';

class ImageUploader extends StatelessWidget {
void _upload(BuildContext context) async {
List<PlatformFile>? _paths;
try {
print('In upload');
// Uploading the file with options
File local = await FilePicker.getFile(type: FileType.image);
_paths =
(await FilePicker.platform.pickFiles(type: FileType.image))?.files;

File local = File(_paths!.single.path!);
local.existsSync();
final key = new DateTime.now().toString();
Map<String, String> metadata = <String, String>{};
Expand Down
12 changes: 6 additions & 6 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.10.0"

dependencies:
flutter:
sdk: flutter
file_picker: ^1.8.0+1
amplify_flutter: 0.1.6
amplify_analytics_pinpoint: 0.1.6
amplify_auth_cognito: 0.1.6
amplify_storage_s3: 0.1.6
file_picker: ^3.0.0-nullsafety.2
amplify_flutter: 0.2.0
amplify_analytics_pinpoint: 0.2.0
amplify_auth_cognito: 0.2.0
amplify_storage_s3: 0.2.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
Expand Down
11 changes: 11 additions & 0 deletions packages/amplify_analytics_pinpoint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.2.0 (2021-06-30)

### Features

- feat(amplify_analytics_pinpoint): Null safety (#483)
- feat: Null safety core (#492)

### Chores

- chore: Null safety master rebase (#676)

## 0.1.6 (2021-06-23)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_analytics_pinpoint/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/amplify_analytics_pinpoint/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Demonstrates how to use the amplify_analytics_pinpoint plugin.
publish_to: "none" # Remove this line if you wish to publish to pub.dev

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
library amplify_analytics_pinpoint;

import 'package:amplify_analytics_plugin_interface/amplify_analytics_plugin_interface.dart';
import 'package:flutter/cupertino.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import './method_channel_amplify.dart';
Expand All @@ -31,11 +30,11 @@ class AmplifyAnalyticsPinpoint extends AnalyticsPluginInterface {
static AmplifyAnalyticsPinpoint _instance =
AmplifyAnalyticsPinpointMethodChannel();

static AnalyticsPluginInterface get instance => _instance;
static AmplifyAnalyticsPinpoint get instance => _instance;

/// Platform-specific plugins should set this with their own platform-specific
/// class that extends [AnalyticsPluginInterface] when they register themselves.
static set instance(AnalyticsPluginInterface instance) {
static set instance(AmplifyAnalyticsPinpoint instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Expand All @@ -46,7 +45,7 @@ class AmplifyAnalyticsPinpoint extends AnalyticsPluginInterface {
return _instance.addPlugin();
}

Future<void> recordEvent({@required AnalyticsEvent event}) async {
Future<void> recordEvent({required AnalyticsEvent event}) async {
return _instance.recordEvent(event: event);
}

Expand All @@ -55,13 +54,13 @@ class AmplifyAnalyticsPinpoint extends AnalyticsPluginInterface {
}

Future<void> registerGlobalProperties(
{@required AnalyticsProperties globalProperties}) async {
{required AnalyticsProperties globalProperties}) async {
return _instance.registerGlobalProperties(
globalProperties: globalProperties);
}

Future<void> unregisterGlobalProperties(
{@required List<String> propertyNames}) async {
{required List<String> propertyNames}) async {
return _instance.unregisterGlobalProperties(propertyNames: propertyNames);
}

Expand All @@ -74,8 +73,8 @@ class AmplifyAnalyticsPinpoint extends AnalyticsPluginInterface {
}

Future<void> identifyUser(
{@required String userId,
@required AnalyticsUserProfile userProfile}) async {
{required String userId,
required AnalyticsUserProfile userProfile}) async {
return _instance.identifyUser(userId: userId, userProfile: userProfile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AmplifyAnalyticsPinpointMethodChannel extends AmplifyAnalyticsPinpoint {
}

@override
Future<void> recordEvent({AnalyticsEvent event}) async {
Future<void> recordEvent({required AnalyticsEvent event}) async {
var name = event.name;
var eventProperties = event.properties;

Expand All @@ -63,7 +63,7 @@ class AmplifyAnalyticsPinpointMethodChannel extends AmplifyAnalyticsPinpoint {

@override
Future<void> registerGlobalProperties(
{AnalyticsProperties globalProperties}) async {
{required AnalyticsProperties globalProperties}) async {
await _channel.invokeMethod<bool>(
'registerGlobalProperties',
<String, Object>{
Expand All @@ -74,7 +74,7 @@ class AmplifyAnalyticsPinpointMethodChannel extends AmplifyAnalyticsPinpoint {
}

@override
Future<void> unregisterGlobalProperties({List<String> propertyNames}) async {
Future<void> unregisterGlobalProperties({List<String>? propertyNames = const []}) async {
await _channel.invokeMethod<bool>(
'unregisterGlobalProperties', propertyNames);
}
Expand All @@ -95,7 +95,7 @@ class AmplifyAnalyticsPinpointMethodChannel extends AmplifyAnalyticsPinpoint {

@override
Future<void> identifyUser(
{String userId, AnalyticsUserProfile userProfile}) async {
{required String userId, required AnalyticsUserProfile userProfile}) async {
await _channel.invokeMethod<bool>(
'identifyUser',
<String, Object>{
Expand Down
10 changes: 5 additions & 5 deletions packages/amplify_analytics_pinpoint/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: amplify_analytics_pinpoint
description: The Amplify Flutter Analytics category plugin using the AWS Pinpoint provider.
version: 0.1.6
version: 0.2.0
homepage: https://github.com/aws-amplify/amplify-flutter/tree/master/packages/amplify_analytics_pinpoint

environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.20.0"
sdk: '>=2.12.0 <3.0.0'
flutter: ^1.20.0

dependencies:
flutter:
sdk: flutter
amplify_core: 0.1.6
amplify_analytics_plugin_interface: 0.1.6
amplify_core: 0.2.0
amplify_analytics_plugin_interface: 0.2.0
plugin_platform_interface: ^2.0.0

dev_dependencies:
Expand Down
10 changes: 10 additions & 0 deletions packages/amplify_analytics_plugin_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.2.0 (2021-06-30)

### Features

- feat: Null safety core (#492)

### Chores

- chore: Null safety master rebase (#676)

## 0.1.6 (2021-06-23)

## 0.1.5 (2021-05-17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@ library amplify_analytics_plugin_interface;

import 'dart:async';

import 'package:meta/meta.dart';
import 'package:amplify_core/types/index.dart';

import 'src/types.dart';
export 'src/types.dart';

abstract class AnalyticsPluginInterface extends AmplifyPluginInterface {
/// Constructs a AmplifyPlatform.
AnalyticsPluginInterface({@required Object token}) : super(token: token);
AnalyticsPluginInterface({required Object token}) : super(token: token);

Future<void> addPlugin() async {
throw UnimplementedError('addPlugin() has not been implemented.');
}

Future<void> recordEvent({@required AnalyticsEvent event}) async {
Future<void> recordEvent({required AnalyticsEvent event}) async {
throw UnimplementedError('recordEvent() has not been implemented.');
}

Expand All @@ -40,13 +39,13 @@ abstract class AnalyticsPluginInterface extends AmplifyPluginInterface {
}

Future<void> registerGlobalProperties(
{@required AnalyticsProperties globalProperties}) async {
{required AnalyticsProperties globalProperties}) async {
throw UnimplementedError(
'registerGlobalProperties() has not been implemented.');
}

Future<void> unregisterGlobalProperties(
{@required List<String> propertyNames}) async {
{required List<String> propertyNames}) async {
throw UnimplementedError(
'unregisterGlobalProperties() has not been implemented.');
}
Expand All @@ -60,8 +59,8 @@ abstract class AnalyticsPluginInterface extends AmplifyPluginInterface {
}

Future<void> identifyUser(
{@required String userId,
@required AnalyticsUserProfile userProfile}) async {
{required String userId,
required AnalyticsUserProfile userProfile}) async {
throw UnimplementedError('identifyUser() has not been implemented.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,26 @@
import '../../amplify_analytics_plugin_interface.dart';

class AnalyticsUserProfile {
String name;
String email;
String plan;
AnalyticsUserProfileLocation location;
AnalyticsProperties properties;
String? name;
String? email;
String? plan;
AnalyticsUserProfileLocation? location;
AnalyticsProperties? properties;

AnalyticsUserProfile(
{String name,
String email,
String plan,
AnalyticsUserProfileLocation location,
AnalyticsProperties analyticsProperties}) {
this.name = name;
this.email = email;
this.plan = plan;
this.location = location;
this.properties = analyticsProperties;
}

Map<String, Object> getAllProperties() {
Map<String, Object> allProperties = {};

if (name != null) {
allProperties["name"] = name;
}
if (email != null) {
allProperties["email"] = email;
}
if (plan != null) {
allProperties["plan"] = plan;
}
if (location != null) {
allProperties["location"] = location.getAllProperties();
}
if (properties != null) {
allProperties["propertiesMap"] = properties.getAllProperties();
allProperties["propertiesTypesMap"] = properties.getAllPropertiesTypes();
}
{this.name, this.email, this.plan, this.location, analyticsProperties})
: this.properties = analyticsProperties;

Map<String, Object?> getAllProperties() {
Map<String, Object?> allProperties = {
'name': name,
'email': email,
'plan': plan,
'location': location?.getAllProperties(),
'propertiesMap': properties?.getAllProperties(),
'propertiesTypesMap': properties?.getAllPropertiesTypes()
};
allProperties.removeWhere((_, v) => v == null);
return allProperties;
}
}
Loading