Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

migrated to sound null safety #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 8 additions & 5 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/USER/Development/flutterapp/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/USER/Development/Dev Plugins/freshchat/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_ROOT=C:\src\flutter"
export "FLUTTER_APPLICATION_PATH=E:\AppDev\Univents\fresh_chat\example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/Users/USER/Development/flutterapp/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
119 changes: 42 additions & 77 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,69 +1,62 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
charcode:
version: "2.1.0"
characters:
dependency: transitive
description:
name: charcode
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
collection:
version: "1.2.0"
charcode:
dependency: transitive
description:
name: collection
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
convert:
version: "1.3.1"
clock:
dependency: transitive
description:
name: convert
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.1.0"
collection:
dependency: transitive
description:
name: crypto
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -75,19 +68,12 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.5"
version: "1.4.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
localstorage:
dependency: "direct main"
description:
Expand All @@ -101,49 +87,35 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
version: "1.8.0"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -155,63 +127,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
version: "2.1.1"
sdks:
dart: ">=2.4.0 <3.0.0"
flutter: ">=0.1.4 <2.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.12.0"
20 changes: 10 additions & 10 deletions lib/src/freshchat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class FlutterFreshchat {
/// `notificationSoundEnabled` property is used enabled or disable in-app notfication
/// sound. It default value is set to `true`. (NOTE: IOS only).
static Future<bool> init({
@required String appID,
@required String appKey,
@required String domain,
required String appID,
required String appKey,
required String domain,
bool cameraEnabled = true,
bool gallerySelectionEnabled = true,
bool teamMemberInfoVisible = true,
Expand Down Expand Up @@ -62,8 +62,8 @@ class FlutterFreshchat {
/// customProperties["loggedIn"] = "true";
/// ```
static Future<bool> updateUserInfo({
@required FreshchatUser user,
Map<String, String> customProperties,
required FreshchatUser user,
Map<String, String>? customProperties,
}) async {
Map<String, dynamic> json = user.toJson();

Expand All @@ -80,8 +80,8 @@ class FlutterFreshchat {
/// `externalID` is required and returns a `restoreID` you can save it
/// and use to restore the chats messages.
static Future<String> identifyUser({
@required String externalID,
String restoreID,
required String externalID,
String? restoreID,
}) async {
final Map<String, String> params = <String, String>{
"externalID": externalID,
Expand All @@ -106,7 +106,7 @@ class FlutterFreshchat {
/// You can also pass a title for the chat screen.
static Future<bool> showConversations({
List<String> tags = const [],
String title,
String? title,
}) async {
final Map<String, dynamic> params = <String, dynamic>{
"tags": tags,
Expand Down Expand Up @@ -145,7 +145,7 @@ class FlutterFreshchat {
}

/// Setup Push notification for freshchat by passing `token` to the methd.
static Future<bool> setupPushNotifications({@required String token}) async {
static Future<bool> setupPushNotifications({required String token}) async {
final Map<String, dynamic> params = <String, dynamic>{"token": token};

final bool result =
Expand All @@ -155,7 +155,7 @@ class FlutterFreshchat {
}

/// Send message
static Future<bool> send({@required String message, String tag}) async {
static Future<bool> send({required String message, String? tag}) async {
final Map<String, dynamic> params = <String, dynamic>{
"message": message,
"tag": tag
Expand Down
16 changes: 8 additions & 8 deletions lib/src/freshchat_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ part of freshchat;
/// You can send basic user information at any point to give you more context
/// on the user when your support agents are messaging back and forth with them.
class FreshchatUser {
String id;
String email;
String referenceId;
DateTime createdTime;
String phone;
String firstName;
String lastName;
String phoneCountryCode;
String? id;
String? email;
String? referenceId;
DateTime? createdTime;
String? phone;
String? firstName;
String? lastName;
String? phoneCountryCode;

FreshchatUser.initial()
: id = "",
Expand Down
Loading