From 5d599c2b11db2894899954b3f75b9b1fc67dbe9b Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 16 Mar 2020 11:12:41 +0100 Subject: [PATCH 1/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 912ebe51..8b2f6c9d 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ All set ✅ The library uses [flutter file picker plugin](https://github.com/miguelpruivo/flutter_file_picker) to pick files from the os. -Follow [this wiki](https://github.com/miguelpruivo/flutter_file_picker) to fulfill iOS requirements. +Follow [this wiki](https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#ios) to fulfill iOS requirements. ## Docs From f3c68280ecd571fc86502d91451ef3cd0e1c66a9 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 25 Mar 2020 08:56:36 +0100 Subject: [PATCH 2/7] Refs #9: Update Readme adding capabilities dependency info --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b2f6c9d..7515ab60 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,13 @@ All set ✅ The library uses [flutter file picker plugin](https://github.com/miguelpruivo/flutter_file_picker) to pick files from the os. - Follow [this wiki](https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#ios) to fulfill iOS requirements. +We also use [video_player](https://pub.dev/packages/video_player) to reproduce videos. Follow [this guide](https://pub.dev/packages/video_player#installation) to fulfill the requirements. + +To pick images from the camera we use the [image_picker](https://pub.dev/packages/image_picker) plugin. +Follow [these instructions](https://pub.dev/packages/image_picker#ios) to check the requirements. + ## Docs ### Business logic components From 18bd85343a7a49c6b91ea09aaea5fef80dc3ef66 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 31 Mar 2020 09:21:41 +0200 Subject: [PATCH 3/7] show error message on image error --- lib/src/message_widget.dart | 30 +++++++++++++++++++----------- pubspec.yaml | 6 +++--- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib/src/message_widget.dart b/lib/src/message_widget.dart index 4067092a..8eaed2a5 100644 --- a/lib/src/message_widget.dart +++ b/lib/src/message_widget.dart @@ -879,21 +879,29 @@ class _MessageWidgetState extends State Widget _buildImage( Attachment attachment, ) { + final errorWidget = Container( + width: 200, + height: 140, + color: Color(0xffd0021B).withAlpha(26), + child: Center( + child: Icon( + Icons.error_outline, + color: Colors.white, + ), + ), + ); + + if (attachment.thumbUrl == null && + attachment.imageUrl == null && + attachment.assetUrl == null) { + return errorWidget; + } + return CachedNetworkImage( imageUrl: attachment.thumbUrl ?? attachment.imageUrl ?? attachment.assetUrl, errorWidget: (context, url, error) { - return Container( - width: 200, - height: 140, - color: Color(0xffd0021B).withAlpha(26), - child: Center( - child: Icon( - Icons.error_outline, - color: Colors.white, - ), - ), - ); + return errorWidget; }, fit: BoxFit.cover, ); diff --git a/pubspec.yaml b/pubspec.yaml index de2db30a..967cbc81 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,10 +16,10 @@ dependencies: url_launcher: ^5.4.2 video_player: ^0.10.8+1 chewie: ^0.9.10 - file_picker: ^1.5.0 - image_picker: ^0.6.3+4 + file_picker: ^1.5.1 + image_picker: ^0.6.4 keyboard_visibility: ^0.5.6 - stream_chat: ^0.1.19 + stream_chat: ^0.1.21 visibility_detector: ^0.1.4 dev_dependencies: From 8ae849be0feee8a8b41a7acbeef57fc2633e9f49 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 31 Mar 2020 10:05:59 +0200 Subject: [PATCH 4/7] fix dependency error using flutter_form_builder --- example/ios/Podfile.lock | 28 +++++++++----------- example/ios/Runner.xcodeproj/project.pbxproj | 11 +++++--- example/ios/Runner/Info.plist | 26 +++++++++--------- example/pubspec.yaml | 1 + lib/src/message_input.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 07bb3fa8..66ae94b1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,6 +2,8 @@ PODS: - file_picker (0.0.1): - Flutter - Flutter (1.0.0) + - flutter_keyboard_visibility (0.7.0): + - Flutter - flutter_plugin_android_lifecycle (0.0.1): - Flutter - FMDB (2.7.5): @@ -9,16 +11,10 @@ PODS: - FMDB/standard (2.7.5) - image_picker (0.0.1): - Flutter - - keyboard_visibility (0.5.0): - - Flutter - - Reachability - path_provider (0.0.1): - Flutter - path_provider_macos (0.0.1): - Flutter - - Reachability (3.2) - - screen (0.0.1): - - Flutter - sqflite (0.0.1): - Flutter - FMDB (~> 2.7.2) @@ -32,45 +28,44 @@ PODS: - Flutter - video_player_web (0.0.1): - Flutter + - wakelock (0.0.1): + - Flutter DEPENDENCIES: - file_picker (from `.symlinks/plugins/file_picker/ios`) - Flutter (from `Flutter`) + - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) - - keyboard_visibility (from `.symlinks/plugins/keyboard_visibility/ios`) - path_provider (from `.symlinks/plugins/path_provider/ios`) - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - video_player (from `.symlinks/plugins/video_player/ios`) - video_player_web (from `.symlinks/plugins/video_player_web/ios`) + - wakelock (from `.symlinks/plugins/wakelock/ios`) SPEC REPOS: trunk: - FMDB - - Reachability EXTERNAL SOURCES: file_picker: :path: ".symlinks/plugins/file_picker/ios" Flutter: :path: Flutter + flutter_keyboard_visibility: + :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" flutter_plugin_android_lifecycle: :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" image_picker: :path: ".symlinks/plugins/image_picker/ios" - keyboard_visibility: - :path: ".symlinks/plugins/keyboard_visibility/ios" path_provider: :path: ".symlinks/plugins/path_provider/ios" path_provider_macos: :path: ".symlinks/plugins/path_provider_macos/ios" - screen: - :path: ".symlinks/plugins/screen/ios" sqflite: :path: ".symlinks/plugins/sqflite/ios" url_launcher: @@ -83,24 +78,25 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/video_player/ios" video_player_web: :path: ".symlinks/plugins/video_player_web/ios" + wakelock: + :path: ".symlinks/plugins/wakelock/ios" SPEC CHECKSUMS: file_picker: 408623be2125b79a4539cf703be3d4b3abe5e245 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + flutter_keyboard_visibility: 6195387fb6d8f46e5cd6dda4a4154e41f800f545 flutter_plugin_android_lifecycle: 47de533a02850f070f5696a623995e93eddcdb9b FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_picker: e3eacd46b94694dde7cf2705955cece853aa1a8f - keyboard_visibility: 96a24de806fe6823c3ad956c01ba2ec6d056616f path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c video_player: 69c5f029fac4ffe4fc8a85ea7f7b793709661549 video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 + wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 308cdaf9..42d1671f 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -141,7 +141,6 @@ 7BF51EE28C89025F73A5211F /* Pods-Runner.release.xcconfig */, 68F846A6DB42D92393F5F7E0 /* Pods-Runner.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -181,6 +180,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = EHV7XZLAHA; LastSwiftMigration = 1100; }; }; @@ -375,6 +375,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = EHV7XZLAHA; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -386,7 +387,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_BUNDLE_IDENTIFIER = io.stream.flutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -509,6 +510,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = EHV7XZLAHA; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -520,7 +522,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_BUNDLE_IDENTIFIER = io.stream.flutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -536,6 +538,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = EHV7XZLAHA; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -547,7 +550,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_BUNDLE_IDENTIFIER = io.stream.flutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index f6d694bd..ea713691 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -22,6 +22,19 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSAppleMusicUsageDescription + Used to send message attachments + NSCameraUsageDescription + Used to send message attachments + NSMicrophoneUsageDescription + Used to send message attachments + NSPhotoLibraryUsageDescription + Used to send message attachments + UIBackgroundModes + + fetch + remote-notification + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,18 +54,5 @@ UIViewControllerBasedStatusBarAppearance - UIBackgroundModes - - fetch - remote-notification - - NSAppleMusicUsageDescription - Used to send message attachments - NSCameraUsageDescription - Used to send message attachments - NSMicrophoneUsageDescription - Used to send message attachments - NSPhotoLibraryUsageDescription - Used to send message attachments diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 2968dbca..731da594 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: sdk: flutter stream_chat_flutter: path: ../ + flutter_form_builder: any dev_dependencies: flutter_test: diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 98f5dcc7..b00c9f2d 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -3,8 +3,8 @@ import 'dart:io'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:keyboard_visibility/keyboard_visibility.dart'; import 'package:stream_chat/stream_chat.dart'; import 'package:stream_chat_flutter/src/message_list_view.dart'; import 'package:stream_chat_flutter/src/stream_chat_theme.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 967cbc81..e916a5af 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: chewie: ^0.9.10 file_picker: ^1.5.1 image_picker: ^0.6.4 - keyboard_visibility: ^0.5.6 + flutter_keyboard_visibility: ^0.7.0 stream_chat: ^0.1.21 visibility_detector: ^0.1.4 From 9f95012f064785051aac966855c6c9614eadfc69 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 31 Mar 2020 10:34:38 +0200 Subject: [PATCH 5/7] bump version --- CHANGELOG.md | 4 ++++ example/pubspec.yaml | 1 - pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2355893..8dfee43c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.12 + +- Fix dependency error on iOS using flutter_form_builder + ## 0.1.11 - Fix bug in ChannelPreview when list of messages is empty diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 731da594..2968dbca 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -11,7 +11,6 @@ dependencies: sdk: flutter stream_chat_flutter: path: ../ - flutter_form_builder: any dev_dependencies: flutter_test: diff --git a/pubspec.yaml b/pubspec.yaml index e916a5af..eba0842a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.1.11 +version: 0.1.12 environment: sdk: ">=2.3.0 <3.0.0" From be495d8d86067402ae83724eb92f3ce6aec5c063 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 1 Apr 2020 10:31:39 +0200 Subject: [PATCH 6/7] add automatickeepalive to streamchat --- lib/src/stream_chat.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/stream_chat.dart b/lib/src/stream_chat.dart index f7eabff9..adc6b2ee 100644 --- a/lib/src/stream_chat.dart +++ b/lib/src/stream_chat.dart @@ -59,7 +59,8 @@ class StreamChat extends StatefulWidget { } } -class StreamChatState extends State { +class StreamChatState extends State + with AutomaticKeepAliveClientMixin { final List _subscriptions = []; Client get client => widget.client; final GlobalKey _navigatorKey = GlobalKey(); @@ -245,4 +246,7 @@ class StreamChatState extends State { _channelsController.close(); super.dispose(); } + + @override + bool get wantKeepAlive => true; } From 66bd54d85b2aa26858f4df83f6a49bd239539e81 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 2 Apr 2020 11:13:46 +0200 Subject: [PATCH 7/7] bump version --- CHANGELOG.md | 4 ++++ README.md | 2 +- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfee43c..641f0017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.13 + +- Add automatic keep alive to streamchat + ## 0.1.12 - Fix dependency error on iOS using flutter_form_builder diff --git a/README.md b/README.md index 7515ab60..5bfb6907 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The example is available under the [example](https://github.com/GetStream/stream ```yaml dependencies: - stream_chat_flutter: ^0.1.11 + stream_chat_flutter: ^0.1.13 ``` You should then run `flutter packages get` diff --git a/pubspec.yaml b/pubspec.yaml index eba0842a..1c3b6043 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.1.12 +version: 0.1.13 environment: sdk: ">=2.3.0 <3.0.0"