From 291b3368a0255432817c641c0e3a19d0ecf4e8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6ckeis?= Date: Sun, 27 Mar 2022 15:12:50 +0200 Subject: [PATCH] migrated to sound nullsafety --- .../ios/Flutter/flutter_export_environment.sh | 13 +- example/pubspec.lock | 119 +++++++----------- lib/src/freshchat.dart | 20 +-- lib/src/freshchat_user.dart | 16 +-- pubspec.lock | 108 ++++++---------- pubspec.yaml | 2 +- 6 files changed, 106 insertions(+), 172 deletions(-) diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index d954fe7..8d6931c 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -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" diff --git a/example/pubspec.lock b/example/pubspec.lock index 3420bfe..7545359 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,62 +1,48 @@ # 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: @@ -64,6 +50,13 @@ packages: 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 @@ -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: @@ -101,21 +87,28 @@ 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: @@ -123,27 +116,6 @@ packages: 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 @@ -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" diff --git a/lib/src/freshchat.dart b/lib/src/freshchat.dart index e65d7f4..f9bcf45 100644 --- a/lib/src/freshchat.dart +++ b/lib/src/freshchat.dart @@ -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 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, @@ -62,8 +62,8 @@ class FlutterFreshchat { /// customProperties["loggedIn"] = "true"; /// ``` static Future updateUserInfo({ - @required FreshchatUser user, - Map customProperties, + required FreshchatUser user, + Map? customProperties, }) async { Map json = user.toJson(); @@ -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 identifyUser({ - @required String externalID, - String restoreID, + required String externalID, + String? restoreID, }) async { final Map params = { "externalID": externalID, @@ -106,7 +106,7 @@ class FlutterFreshchat { /// You can also pass a title for the chat screen. static Future showConversations({ List tags = const [], - String title, + String? title, }) async { final Map params = { "tags": tags, @@ -145,7 +145,7 @@ class FlutterFreshchat { } /// Setup Push notification for freshchat by passing `token` to the methd. - static Future setupPushNotifications({@required String token}) async { + static Future setupPushNotifications({required String token}) async { final Map params = {"token": token}; final bool result = @@ -155,7 +155,7 @@ class FlutterFreshchat { } /// Send message - static Future send({@required String message, String tag}) async { + static Future send({required String message, String? tag}) async { final Map params = { "message": message, "tag": tag diff --git a/lib/src/freshchat_user.dart b/lib/src/freshchat_user.dart index 0af94f9..d799ad8 100644 --- a/lib/src/freshchat_user.dart +++ b/lib/src/freshchat_user.dart @@ -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 = "", diff --git a/pubspec.lock b/pubspec.lock index 67a7df1..1e12335 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,62 +1,55 @@ # 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" + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" - collection: + version: "1.3.1" + clock: dependency: transitive description: - name: collection + name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" - convert: + version: "1.1.0" + collection: dependency: transitive description: - name: convert + name: collection url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - crypto: + version: "1.15.0" + fake_async: dependency: transitive description: - name: crypto + name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -67,55 +60,34 @@ packages: description: flutter source: sdk version: "0.0.0" - image: + matcher: dependency: transitive description: - name: image + name: matcher url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" - matcher: + version: "0.12.11" + material_color_utilities: dependency: transitive description: - name: matcher + name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + 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" - 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" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -127,62 +99,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" + dart: ">=2.14.0 <3.0.0" + flutter: ">=1.12.0" diff --git a/pubspec.yaml b/pubspec.yaml index f4cccec..5045e65 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.4.0 homepage: https://github.com/fayeed/flutter_freshchat environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=1.12.0 <2.0.0" dependencies: