Merge branch 'master' of github.com:GetStream/stream-chat-flutter
This commit is contained in:
@@ -0,0 +1,73 @@
|
|||||||
|
PODS:
|
||||||
|
- Flutter (1.0.0)
|
||||||
|
- FMDB (2.7.5):
|
||||||
|
- FMDB/standard (= 2.7.5)
|
||||||
|
- FMDB/standard (2.7.5)
|
||||||
|
- path_provider (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- screen (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- sqflite (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FMDB (~> 2.7.2)
|
||||||
|
- url_launcher (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- url_launcher_macos (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- url_launcher_web (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- video_player (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- video_player_web (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- Flutter (from `Flutter`)
|
||||||
|
- path_provider (from `.symlinks/plugins/path_provider/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`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- FMDB
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
Flutter:
|
||||||
|
:path: Flutter
|
||||||
|
path_provider:
|
||||||
|
:path: ".symlinks/plugins/path_provider/ios"
|
||||||
|
screen:
|
||||||
|
:path: ".symlinks/plugins/screen/ios"
|
||||||
|
sqflite:
|
||||||
|
:path: ".symlinks/plugins/sqflite/ios"
|
||||||
|
url_launcher:
|
||||||
|
:path: ".symlinks/plugins/url_launcher/ios"
|
||||||
|
url_launcher_macos:
|
||||||
|
:path: ".symlinks/plugins/url_launcher_macos/ios"
|
||||||
|
url_launcher_web:
|
||||||
|
:path: ".symlinks/plugins/url_launcher_web/ios"
|
||||||
|
video_player:
|
||||||
|
:path: ".symlinks/plugins/video_player/ios"
|
||||||
|
video_player_web:
|
||||||
|
:path: ".symlinks/plugins/video_player_web/ios"
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||||
|
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||||
|
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
|
||||||
|
screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
|
||||||
|
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
|
||||||
|
url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
|
||||||
|
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
|
||||||
|
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
|
||||||
|
video_player: 69c5f029fac4ffe4fc8a85ea7f7b793709661549
|
||||||
|
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83
|
||||||
|
|
||||||
|
COCOAPODS: 1.8.4
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
||||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
|
7DEC2743BD66C91B700A3B97 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BB2E5E4E236267EDF0D8817 /* Pods_Runner.framework */; };
|
||||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
||||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
@@ -37,11 +38,15 @@
|
|||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
2452A9E77396497EB4CF3072 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
||||||
|
68F846A6DB42D92393F5F7E0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
7BF51EE28C89025F73A5211F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
8BB2E5E4E236267EDF0D8817 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
|
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
|
||||||
@@ -59,6 +64,7 @@
|
|||||||
files = (
|
files = (
|
||||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||||
|
7DEC2743BD66C91B700A3B97 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -84,6 +90,8 @@
|
|||||||
9740EEB11CF90186004384FC /* Flutter */,
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
97C146F01CF9000F007C117D /* Runner */,
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
CF168B61BAB91958681C7C21 /* Pods */,
|
||||||
|
BC09A38346C8B2CD72199469 /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -118,6 +126,25 @@
|
|||||||
name = "Supporting Files";
|
name = "Supporting Files";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
BC09A38346C8B2CD72199469 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
8BB2E5E4E236267EDF0D8817 /* Pods_Runner.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
CF168B61BAB91958681C7C21 /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
2452A9E77396497EB4CF3072 /* Pods-Runner.debug.xcconfig */,
|
||||||
|
7BF51EE28C89025F73A5211F /* Pods-Runner.release.xcconfig */,
|
||||||
|
68F846A6DB42D92393F5F7E0 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
@@ -125,12 +152,14 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
9E02B5C38D6CC2455D9E48E9 /* [CP] Check Pods Manifest.lock */,
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
5702861DACEDB848A3E454E8 /* [CP] Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -203,6 +232,21 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
||||||
};
|
};
|
||||||
|
5702861DACEDB848A3E454E8 /* [CP] Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "[CP] Embed Pods Frameworks";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -217,6 +261,28 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
};
|
};
|
||||||
|
9E02B5C38D6CC2455D9E48E9 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
|||||||
@@ -17,8 +17,18 @@ void main() async {
|
|||||||
// ignore: unawaited_futures
|
// ignore: unawaited_futures
|
||||||
channel.watch();
|
channel.watch();
|
||||||
|
|
||||||
runApp(
|
runApp(MyApp(client, channel));
|
||||||
MaterialApp(
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatelessWidget {
|
||||||
|
final Client client;
|
||||||
|
final Channel channel;
|
||||||
|
|
||||||
|
MyApp(this.client, this.channel);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
home: StreamChat(
|
home: StreamChat(
|
||||||
client: client,
|
client: client,
|
||||||
child: StreamChannel(
|
child: StreamChannel(
|
||||||
@@ -26,8 +36,8 @@ void main() async {
|
|||||||
child: ChannelPage(),
|
child: ChannelPage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChannelPage extends StatelessWidget {
|
class ChannelPage extends StatelessWidget {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class _ChannelListViewState extends State<ChannelListView> {
|
|||||||
if (i < channels.length) {
|
if (i < channels.length) {
|
||||||
final channel = channels[i];
|
final channel = channels[i];
|
||||||
|
|
||||||
final channelClient = streamChat.client.channelClients[channel.id];
|
final channelClient = streamChat.client.channels[channel.id];
|
||||||
|
|
||||||
ChannelTapCallback onTap;
|
ChannelTapCallback onTap;
|
||||||
if (widget.onChannelTap != null) {
|
if (widget.onChannelTap != null) {
|
||||||
|
|||||||
+58
-56
@@ -25,72 +25,74 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return SafeArea(
|
||||||
padding: const EdgeInsets.all(8.0),
|
child: Padding(
|
||||||
child: Container(
|
padding: const EdgeInsets.all(8.0),
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
padding: EdgeInsets.all(2),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
gradient: _typingStarted
|
|
||||||
? StreamChatTheme.of(context).channelTheme.inputGradient
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: EdgeInsets.all(2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
gradient: _typingStarted
|
||||||
|
? StreamChatTheme.of(context).channelTheme.inputGradient
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: StreamChatTheme.of(context).channelTheme.inputBackground,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
border: Border.all(
|
|
||||||
color: _typingStarted
|
|
||||||
? Colors.transparent
|
|
||||||
: Colors.black.withOpacity(.2)),
|
|
||||||
),
|
),
|
||||||
child: Flex(
|
child: Container(
|
||||||
direction: Axis.horizontal,
|
decoration: BoxDecoration(
|
||||||
children: <Widget>[
|
color: StreamChatTheme.of(context).channelTheme.inputBackground,
|
||||||
Expanded(
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
child: TextField(
|
border: Border.all(
|
||||||
minLines: null,
|
color: _typingStarted
|
||||||
maxLines: null,
|
? Colors.transparent
|
||||||
onSubmitted: (_) {
|
: Colors.black.withOpacity(.2)),
|
||||||
_sendMessage(context);
|
),
|
||||||
},
|
child: Flex(
|
||||||
controller: _textController,
|
direction: Axis.horizontal,
|
||||||
onChanged: (s) {
|
children: <Widget>[
|
||||||
StreamChannel.of(context).channel.keyStroke();
|
Expanded(
|
||||||
setState(() {
|
child: TextField(
|
||||||
_messageIsPresent = s.trim().isNotEmpty;
|
minLines: null,
|
||||||
});
|
maxLines: null,
|
||||||
},
|
onSubmitted: (_) {
|
||||||
onTap: () {
|
_sendMessage(context);
|
||||||
setState(() {
|
},
|
||||||
_typingStarted = true;
|
controller: _textController,
|
||||||
});
|
onChanged: (s) {
|
||||||
},
|
StreamChannel.of(context).channel.keyStroke();
|
||||||
style: Theme.of(context).textTheme.body1,
|
setState(() {
|
||||||
autofocus: false,
|
_messageIsPresent = s.trim().isNotEmpty;
|
||||||
decoration: InputDecoration(
|
});
|
||||||
hintText: 'Write a message',
|
},
|
||||||
prefixText: ' ',
|
onTap: () {
|
||||||
border: InputBorder.none,
|
setState(() {
|
||||||
|
_typingStarted = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
style: Theme.of(context).textTheme.body1,
|
||||||
|
autofocus: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'Write a message',
|
||||||
|
prefixText: ' ',
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
AnimatedCrossFade(
|
||||||
AnimatedCrossFade(
|
crossFadeState: _messageIsPresent
|
||||||
crossFadeState: _messageIsPresent
|
? CrossFadeState.showFirst
|
||||||
? CrossFadeState.showFirst
|
: CrossFadeState.showSecond,
|
||||||
: CrossFadeState.showSecond,
|
firstChild: _buildSendButton(context),
|
||||||
firstChild: _buildSendButton(context),
|
secondChild: SizedBox(),
|
||||||
secondChild: SizedBox(),
|
duration: Duration(milliseconds: 300),
|
||||||
duration: Duration(milliseconds: 300),
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBottomMessage(
|
Widget _buildBottomMessage(
|
||||||
StreamChannelState channelBloc,
|
StreamChannelState channel,
|
||||||
Message previousMessage,
|
Message previousMessage,
|
||||||
Message message,
|
Message message,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
@@ -244,8 +244,8 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
onVisibilityChanged: (visibility) {
|
onVisibilityChanged: (visibility) {
|
||||||
_isBottom = visibility.visibleBounds != Rect.zero;
|
_isBottom = visibility.visibleBounds != Rect.zero;
|
||||||
if (_isBottom) {
|
if (_isBottom) {
|
||||||
if (channelBloc.channel.state.unreadCount > 0) {
|
if (channel.channel.state.unreadCount > 0) {
|
||||||
channelBloc.channel.markRead();
|
channel.channel.markRead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+83
-82
@@ -133,8 +133,7 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
var row = [
|
var row = [
|
||||||
Text(
|
Text(
|
||||||
'Replies: ${widget.message.replyCount}',
|
'Replies: ${widget.message.replyCount}',
|
||||||
style:
|
style: StreamChatTheme.of(context).messageTheme.replies,
|
||||||
Theme.of(context).textTheme.subtitle.copyWith(color: Colors.blue),
|
|
||||||
),
|
),
|
||||||
Transform(
|
Transform(
|
||||||
transform: Matrix4.rotationY(isMyMessage ? 0 : pi),
|
transform: Matrix4.rotationY(isMyMessage ? 0 : pi),
|
||||||
@@ -360,88 +359,90 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
final textStyle = TextStyle(
|
final textStyle = TextStyle(
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
);
|
);
|
||||||
return Column(
|
return SafeArea(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
Container(
|
children: <Widget>[
|
||||||
color: Colors.black87,
|
Container(
|
||||||
child: Row(
|
color: Colors.black87,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: reactionToEmoji.keys.map((reactionType) {
|
mainAxisSize: MainAxisSize.min,
|
||||||
final ownReactionIndex = widget.message.ownReactions
|
children: reactionToEmoji.keys.map((reactionType) {
|
||||||
.indexWhere(
|
final ownReactionIndex = widget.message.ownReactions
|
||||||
(reaction) => reaction.type == reactionType);
|
.indexWhere(
|
||||||
return Column(
|
(reaction) => reaction.type == reactionType);
|
||||||
mainAxisSize: MainAxisSize.min,
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
IconButton(
|
children: <Widget>[
|
||||||
iconSize: fontSize + 10,
|
IconButton(
|
||||||
icon: Text(
|
iconSize: fontSize + 10,
|
||||||
reactionToEmoji[reactionType],
|
icon: Text(
|
||||||
style: textStyle,
|
reactionToEmoji[reactionType],
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
if (ownReactionIndex != -1) {
|
||||||
|
removeReaction(reactionType);
|
||||||
|
} else {
|
||||||
|
sendReaction(reactionType);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
ownReactionIndex != -1
|
||||||
if (ownReactionIndex != -1) {
|
? Padding(
|
||||||
removeReaction(reactionType);
|
padding: const EdgeInsets.only(bottom: 4.0),
|
||||||
} else {
|
child: Text(
|
||||||
sendReaction(reactionType);
|
widget.message
|
||||||
}
|
.ownReactions[ownReactionIndex].score
|
||||||
},
|
.toString(),
|
||||||
),
|
style: TextStyle(color: Colors.white),
|
||||||
ownReactionIndex != -1
|
),
|
||||||
? Padding(
|
)
|
||||||
padding: const EdgeInsets.only(bottom: 4.0),
|
: SizedBox(),
|
||||||
child: Text(
|
],
|
||||||
widget.message.ownReactions[ownReactionIndex]
|
);
|
||||||
.score
|
}).toList(),
|
||||||
.toString(),
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: SizedBox(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
isMyMessage
|
|
||||||
? FlatButton(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(28.0),
|
|
||||||
child: Text(
|
|
||||||
'Delete message',
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.headline
|
|
||||||
.copyWith(color: Colors.red),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
StreamChat.of(context)
|
|
||||||
.client
|
|
||||||
.deleteMessage(widget.message.id);
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: SizedBox(),
|
|
||||||
FlatButton(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(28.0),
|
|
||||||
child: Text(
|
|
||||||
'Start a thread',
|
|
||||||
style: Theme.of(context).textTheme.headline,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
isMyMessage
|
||||||
Navigator.pop(context);
|
? FlatButton(
|
||||||
widget.onThreadTap(widget.message);
|
child: Padding(
|
||||||
},
|
padding: const EdgeInsets.all(28.0),
|
||||||
),
|
child: Text(
|
||||||
],
|
'Delete message',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.headline
|
||||||
|
.copyWith(color: Colors.red),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
StreamChat.of(context)
|
||||||
|
.client
|
||||||
|
.deleteMessage(widget.message.id);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SizedBox(),
|
||||||
|
FlatButton(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(28.0),
|
||||||
|
child: Text(
|
||||||
|
'Start a thread',
|
||||||
|
style: Theme.of(context).textTheme.headline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
widget.onThreadTap(widget.message);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -491,7 +492,7 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Map<String, String> reactionToEmoji = {
|
final Map<String, String> reactionToEmoji = {
|
||||||
'love': '♥️',
|
'love': '❤️️',
|
||||||
'haha': '😂',
|
'haha': '😂',
|
||||||
'like': '👍',
|
'like': '👍',
|
||||||
'sad': '😕',
|
'sad': '😕',
|
||||||
|
|||||||
+46
-126
@@ -44,15 +44,15 @@ class StreamChatState extends State<StreamChat> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = _computeTheme(context);
|
final theme = _getTheme(context, widget.streamChatThemeData);
|
||||||
return StreamChatTheme(
|
return StreamChatTheme(
|
||||||
data: theme,
|
data: theme,
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) => Theme(
|
builder: (context) => Theme(
|
||||||
data: Theme.of(context).copyWith(
|
data: Theme.of(context).copyWith(
|
||||||
accentColor: StreamChatTheme.of(context).accentColor,
|
accentColor: StreamChatTheme.of(context).accentColor,
|
||||||
scaffoldBackgroundColor: theme.primaryColor,
|
scaffoldBackgroundColor: Colors.white,
|
||||||
backgroundColor: theme.primaryColor,
|
backgroundColor: Colors.white,
|
||||||
),
|
),
|
||||||
child: WillPopScope(
|
child: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
@@ -79,146 +79,66 @@ class StreamChatState extends State<StreamChat> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamChatThemeData _computeTheme(BuildContext context) {
|
StreamChatThemeData _getTheme(
|
||||||
final defaultTheme = _getDefaultTheme(context);
|
BuildContext context,
|
||||||
|
StreamChatThemeData themeData,
|
||||||
|
) {
|
||||||
|
final defaultTheme = StreamChatThemeData.getDefaultTheme(Theme.of(context));
|
||||||
final theme = defaultTheme.copyWith(
|
final theme = defaultTheme.copyWith(
|
||||||
primaryColor: widget.streamChatThemeData?.primaryColor,
|
primaryColor: themeData?.primaryColor,
|
||||||
channelTheme: defaultTheme.channelTheme.copyWith(
|
channelTheme: defaultTheme.channelTheme.copyWith(
|
||||||
channelHeaderTheme: defaultTheme.channelTheme.channelHeaderTheme
|
channelHeaderTheme:
|
||||||
.copyWith(
|
defaultTheme.channelTheme.channelHeaderTheme.copyWith(
|
||||||
color: widget.streamChatThemeData?.channelTheme
|
color: themeData?.channelTheme?.channelHeaderTheme?.color,
|
||||||
?.channelHeaderTheme?.color,
|
lastMessageAt:
|
||||||
lastMessageAt: widget.streamChatThemeData?.channelTheme
|
themeData?.channelTheme?.channelHeaderTheme?.lastMessageAt,
|
||||||
?.channelHeaderTheme?.lastMessageAt,
|
title: themeData?.channelTheme?.channelHeaderTheme?.title,
|
||||||
title: widget.streamChatThemeData?.channelTheme
|
avatarTheme: defaultTheme.channelPreviewTheme.avatarTheme.copyWith(
|
||||||
?.channelHeaderTheme?.title,
|
constraints: themeData
|
||||||
avatarTheme:
|
?.channelTheme?.channelHeaderTheme?.avatarTheme?.constraints,
|
||||||
defaultTheme.channelPreviewTheme.avatarTheme.copyWith(
|
borderRadius: themeData
|
||||||
constraints: widget.streamChatThemeData?.channelTheme
|
?.channelTheme?.channelHeaderTheme?.avatarTheme?.borderRadius,
|
||||||
?.channelHeaderTheme?.avatarTheme?.constraints,
|
),
|
||||||
borderRadius: widget.streamChatThemeData?.channelTheme
|
),
|
||||||
?.channelHeaderTheme?.avatarTheme?.borderRadius,
|
inputBackground: themeData?.channelTheme?.inputBackground,
|
||||||
)),
|
messageInputButtonIconTheme:
|
||||||
inputBackground:
|
themeData?.channelTheme?.messageInputButtonIconTheme,
|
||||||
widget.streamChatThemeData?.channelTheme?.inputBackground,
|
inputGradient: themeData?.channelTheme?.inputGradient,
|
||||||
messageInputButtonIconTheme: widget
|
|
||||||
.streamChatThemeData?.channelTheme?.messageInputButtonIconTheme,
|
|
||||||
inputGradient: widget.streamChatThemeData?.channelTheme?.inputGradient,
|
|
||||||
messageInputButtonTheme:
|
messageInputButtonTheme:
|
||||||
widget.streamChatThemeData?.channelTheme?.messageInputButtonTheme,
|
themeData?.channelTheme?.messageInputButtonTheme,
|
||||||
),
|
),
|
||||||
messageTheme: defaultTheme.messageTheme.copyWith(
|
messageTheme: defaultTheme.messageTheme.copyWith(
|
||||||
createdAt: widget.streamChatThemeData?.messageTheme?.createdAt,
|
replies: themeData?.messageTheme?.replies,
|
||||||
messageText: widget.streamChatThemeData?.messageTheme?.messageText,
|
createdAt: themeData?.messageTheme?.createdAt,
|
||||||
otherMessageBackgroundColor: widget
|
messageText: themeData?.messageTheme?.messageText,
|
||||||
.streamChatThemeData?.messageTheme?.otherMessageBackgroundColor,
|
otherMessageBackgroundColor:
|
||||||
|
themeData?.messageTheme?.otherMessageBackgroundColor,
|
||||||
ownMessageBackgroundColor:
|
ownMessageBackgroundColor:
|
||||||
widget.streamChatThemeData?.messageTheme?.ownMessageBackgroundColor,
|
themeData?.messageTheme?.ownMessageBackgroundColor,
|
||||||
fontFamily: widget.streamChatThemeData?.messageTheme?.fontFamily,
|
fontFamily: themeData?.messageTheme?.fontFamily,
|
||||||
messageAuthor: widget.streamChatThemeData?.messageTheme?.messageAuthor,
|
messageAuthor: themeData?.messageTheme?.messageAuthor,
|
||||||
messageMention:
|
messageMention: themeData?.messageTheme?.messageMention,
|
||||||
widget.streamChatThemeData?.messageTheme?.messageMention,
|
|
||||||
avatarTheme: defaultTheme.messageTheme.avatarTheme.copyWith(
|
avatarTheme: defaultTheme.messageTheme.avatarTheme.copyWith(
|
||||||
constraints: widget
|
constraints: themeData?.messageTheme?.avatarTheme?.constraints,
|
||||||
.streamChatThemeData?.messageTheme?.avatarTheme?.constraints,
|
borderRadius: themeData?.messageTheme?.avatarTheme?.borderRadius,
|
||||||
borderRadius: widget
|
|
||||||
.streamChatThemeData?.messageTheme?.avatarTheme?.borderRadius,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
accentColor: widget.streamChatThemeData?.accentColor,
|
accentColor: themeData?.accentColor,
|
||||||
secondaryColor: widget.streamChatThemeData?.secondaryColor,
|
secondaryColor: themeData?.secondaryColor,
|
||||||
channelPreviewTheme: defaultTheme.channelPreviewTheme.copyWith(
|
channelPreviewTheme: defaultTheme.channelPreviewTheme.copyWith(
|
||||||
avatarTheme: defaultTheme.channelPreviewTheme.avatarTheme.copyWith(
|
avatarTheme: defaultTheme.channelPreviewTheme.avatarTheme.copyWith(
|
||||||
constraints: widget.streamChatThemeData?.channelPreviewTheme
|
constraints: themeData?.channelPreviewTheme?.avatarTheme?.constraints,
|
||||||
?.avatarTheme?.constraints,
|
borderRadius:
|
||||||
borderRadius: widget.streamChatThemeData?.channelPreviewTheme
|
themeData?.channelPreviewTheme?.avatarTheme?.borderRadius,
|
||||||
?.avatarTheme?.borderRadius,
|
|
||||||
),
|
),
|
||||||
title: widget.streamChatThemeData?.channelPreviewTheme?.title,
|
title: themeData?.channelPreviewTheme?.title,
|
||||||
lastMessageAt:
|
lastMessageAt: themeData?.channelPreviewTheme?.lastMessageAt,
|
||||||
widget.streamChatThemeData?.channelPreviewTheme?.lastMessageAt,
|
subtitle: themeData?.channelPreviewTheme?.subtitle,
|
||||||
subtitle: widget.streamChatThemeData?.channelPreviewTheme?.subtitle,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return theme;
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamChatThemeData _getDefaultTheme(BuildContext context) {
|
|
||||||
final accentColor = Color(0xff006cff);
|
|
||||||
return StreamChatThemeData(
|
|
||||||
accentColor: accentColor,
|
|
||||||
primaryColor: Colors.white,
|
|
||||||
channelPreviewTheme: ChannelPreviewTheme(
|
|
||||||
avatarTheme: AvatarTheme(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
constraints: BoxConstraints.tightFor(
|
|
||||||
height: 40,
|
|
||||||
width: 40,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
subtitle: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
lastMessageAt: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
color: Colors.black.withOpacity(.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
channelTheme: ChannelTheme(
|
|
||||||
messageInputButtonIconTheme: Theme.of(context).iconTheme.copyWith(
|
|
||||||
color: accentColor,
|
|
||||||
),
|
|
||||||
channelHeaderTheme: ChannelHeaderTheme(
|
|
||||||
avatarTheme: AvatarTheme(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
constraints: BoxConstraints.tightFor(
|
|
||||||
height: 40,
|
|
||||||
width: 40,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
color: Colors.white,
|
|
||||||
title: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
lastMessageAt: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
color: Colors.black.withOpacity(.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
inputBackground: Colors.black.withAlpha(12),
|
|
||||||
inputGradient: LinearGradient(colors: [
|
|
||||||
Color(0xFF00AEFF),
|
|
||||||
Color(0xFF0076FF),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
messageTheme: MessageTheme(
|
|
||||||
messageText: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
createdAt: TextStyle(
|
|
||||||
color: Colors.black.withOpacity(.5),
|
|
||||||
fontSize: 11,
|
|
||||||
),
|
|
||||||
ownMessageBackgroundColor: Color(0xffebebeb),
|
|
||||||
otherMessageBackgroundColor: Colors.white,
|
|
||||||
avatarTheme: AvatarTheme(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
constraints: BoxConstraints.tightFor(
|
|
||||||
height: 32,
|
|
||||||
width: 32,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|||||||
@@ -40,10 +40,23 @@ class StreamChatThemeData {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory StreamChatThemeData.fromTheme(ThemeData theme) {
|
factory StreamChatThemeData.fromTheme(ThemeData theme) {
|
||||||
return StreamChatThemeData(
|
final defaultTheme = getDefaultTheme(theme);
|
||||||
|
|
||||||
|
return defaultTheme.copyWith(
|
||||||
accentColor: theme.accentColor,
|
accentColor: theme.accentColor,
|
||||||
primaryColor: theme.colorScheme.primary,
|
primaryColor: theme.colorScheme.primary,
|
||||||
secondaryColor: theme.colorScheme.secondary,
|
secondaryColor: theme.colorScheme.secondary,
|
||||||
|
channelTheme: ChannelTheme(
|
||||||
|
inputGradient: LinearGradient(colors: [
|
||||||
|
theme.accentColor.withOpacity(.5),
|
||||||
|
theme.accentColor,
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
messageTheme: MessageTheme(
|
||||||
|
replies: defaultTheme.messageTheme.replies.copyWith(
|
||||||
|
color: theme.accentColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,10 +72,134 @@ class StreamChatThemeData {
|
|||||||
primaryColor: primaryColor ?? this.primaryColor,
|
primaryColor: primaryColor ?? this.primaryColor,
|
||||||
secondaryColor: secondaryColor ?? this.secondaryColor,
|
secondaryColor: secondaryColor ?? this.secondaryColor,
|
||||||
accentColor: accentColor ?? this.accentColor,
|
accentColor: accentColor ?? this.accentColor,
|
||||||
channelPreviewTheme: channelPreviewTheme ?? this.channelPreviewTheme,
|
channelPreviewTheme: channelPreviewTheme?.copyWith(
|
||||||
channelTheme: channelTheme ?? this.channelTheme,
|
title:
|
||||||
messageTheme: messageTheme ?? this.messageTheme,
|
channelPreviewTheme.title ?? this.channelPreviewTheme.title,
|
||||||
|
subtitle: channelPreviewTheme.subtitle ??
|
||||||
|
this.channelPreviewTheme.subtitle,
|
||||||
|
lastMessageAt: channelPreviewTheme.lastMessageAt ??
|
||||||
|
this.channelPreviewTheme.lastMessageAt,
|
||||||
|
avatarTheme: channelPreviewTheme.avatarTheme ??
|
||||||
|
this.channelPreviewTheme.avatarTheme,
|
||||||
|
) ??
|
||||||
|
this.channelPreviewTheme,
|
||||||
|
channelTheme: channelTheme?.copyWith(
|
||||||
|
channelHeaderTheme: channelTheme.channelHeaderTheme ??
|
||||||
|
this.channelTheme.channelHeaderTheme,
|
||||||
|
messageInputButtonIconTheme:
|
||||||
|
channelTheme.messageInputButtonIconTheme ??
|
||||||
|
this.channelTheme.messageInputButtonIconTheme,
|
||||||
|
messageInputButtonTheme: channelTheme.messageInputButtonTheme ??
|
||||||
|
this.channelTheme.messageInputButtonTheme,
|
||||||
|
inputGradient:
|
||||||
|
channelTheme.inputGradient ?? this.channelTheme.inputGradient,
|
||||||
|
inputBackground: channelTheme.inputBackground ??
|
||||||
|
this.channelTheme.inputBackground,
|
||||||
|
) ??
|
||||||
|
this.channelTheme,
|
||||||
|
messageTheme: messageTheme?.copyWith(
|
||||||
|
messageText:
|
||||||
|
messageTheme?.messageText ?? this.messageTheme.messageText,
|
||||||
|
messageAuthor: messageTheme?.messageAuthor ??
|
||||||
|
this.messageTheme.messageAuthor,
|
||||||
|
messageMention: messageTheme?.messageMention ??
|
||||||
|
this.messageTheme.messageMention,
|
||||||
|
createdAt: messageTheme?.createdAt ?? this.messageTheme.createdAt,
|
||||||
|
replies: messageTheme?.replies ?? this.messageTheme.replies,
|
||||||
|
fontFamily:
|
||||||
|
messageTheme?.fontFamily ?? this.messageTheme.fontFamily,
|
||||||
|
ownMessageBackgroundColor:
|
||||||
|
messageTheme?.ownMessageBackgroundColor ??
|
||||||
|
this.messageTheme.ownMessageBackgroundColor,
|
||||||
|
otherMessageBackgroundColor:
|
||||||
|
messageTheme?.otherMessageBackgroundColor ??
|
||||||
|
this.messageTheme.otherMessageBackgroundColor,
|
||||||
|
avatarTheme:
|
||||||
|
messageTheme?.avatarTheme ?? this.messageTheme.avatarTheme,
|
||||||
|
) ??
|
||||||
|
this.messageTheme,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static StreamChatThemeData getDefaultTheme(ThemeData theme) {
|
||||||
|
final accentColor = Color(0xff006cff);
|
||||||
|
return StreamChatThemeData(
|
||||||
|
accentColor: accentColor,
|
||||||
|
primaryColor: Colors.white,
|
||||||
|
channelPreviewTheme: ChannelPreviewTheme(
|
||||||
|
avatarTheme: AvatarTheme(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
constraints: BoxConstraints.tightFor(
|
||||||
|
height: 40,
|
||||||
|
width: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
subtitle: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
lastMessageAt: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
color: Colors.black.withOpacity(.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
channelTheme: ChannelTheme(
|
||||||
|
messageInputButtonIconTheme: theme.iconTheme.copyWith(
|
||||||
|
color: accentColor,
|
||||||
|
),
|
||||||
|
channelHeaderTheme: ChannelHeaderTheme(
|
||||||
|
avatarTheme: AvatarTheme(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
constraints: BoxConstraints.tightFor(
|
||||||
|
height: 40,
|
||||||
|
width: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
title: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
lastMessageAt: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
color: Colors.black.withOpacity(.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
inputBackground: Colors.black.withAlpha(12),
|
||||||
|
inputGradient: LinearGradient(colors: [
|
||||||
|
Color(0xFF00AEFF),
|
||||||
|
Color(0xFF0076FF),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
messageTheme: MessageTheme(
|
||||||
|
messageText: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
createdAt: TextStyle(
|
||||||
|
color: Colors.black.withOpacity(.5),
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
replies: TextStyle(
|
||||||
|
color: accentColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
ownMessageBackgroundColor: Color(0xffebebeb),
|
||||||
|
otherMessageBackgroundColor: Colors.white,
|
||||||
|
avatarTheme: AvatarTheme(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
constraints: BoxConstraints.tightFor(
|
||||||
|
height: 32,
|
||||||
|
width: 32,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChannelTheme {
|
class ChannelTheme {
|
||||||
@@ -88,7 +225,15 @@ class ChannelTheme {
|
|||||||
Color inputBackground,
|
Color inputBackground,
|
||||||
}) =>
|
}) =>
|
||||||
ChannelTheme(
|
ChannelTheme(
|
||||||
channelHeaderTheme: channelHeaderTheme ?? this.channelHeaderTheme,
|
channelHeaderTheme: channelHeaderTheme?.copyWith(
|
||||||
|
title: channelHeaderTheme?.title ?? this.channelHeaderTheme.title,
|
||||||
|
lastMessageAt: channelHeaderTheme?.lastMessageAt ??
|
||||||
|
this.channelHeaderTheme.lastMessageAt,
|
||||||
|
avatarTheme: channelHeaderTheme?.avatarTheme ??
|
||||||
|
this.channelHeaderTheme.avatarTheme,
|
||||||
|
color: channelHeaderTheme?.color ?? this.channelHeaderTheme.color,
|
||||||
|
) ??
|
||||||
|
this.channelHeaderTheme,
|
||||||
messageInputButtonIconTheme:
|
messageInputButtonIconTheme:
|
||||||
messageInputButtonIconTheme ?? this.messageInputButtonIconTheme,
|
messageInputButtonIconTheme ?? this.messageInputButtonIconTheme,
|
||||||
messageInputButtonTheme:
|
messageInputButtonTheme:
|
||||||
@@ -122,12 +267,14 @@ class MessageTheme {
|
|||||||
final TextStyle messageAuthor;
|
final TextStyle messageAuthor;
|
||||||
final TextStyle messageMention;
|
final TextStyle messageMention;
|
||||||
final TextStyle createdAt;
|
final TextStyle createdAt;
|
||||||
|
final TextStyle replies;
|
||||||
final String fontFamily;
|
final String fontFamily;
|
||||||
final Color ownMessageBackgroundColor;
|
final Color ownMessageBackgroundColor;
|
||||||
final Color otherMessageBackgroundColor;
|
final Color otherMessageBackgroundColor;
|
||||||
final AvatarTheme avatarTheme;
|
final AvatarTheme avatarTheme;
|
||||||
|
|
||||||
const MessageTheme({
|
const MessageTheme({
|
||||||
|
this.replies,
|
||||||
this.messageText,
|
this.messageText,
|
||||||
this.messageAuthor,
|
this.messageAuthor,
|
||||||
this.messageMention,
|
this.messageMention,
|
||||||
@@ -143,6 +290,7 @@ class MessageTheme {
|
|||||||
TextStyle messageAuthor,
|
TextStyle messageAuthor,
|
||||||
TextStyle messageMention,
|
TextStyle messageMention,
|
||||||
TextStyle createdAt,
|
TextStyle createdAt,
|
||||||
|
TextStyle replies,
|
||||||
String fontFamily,
|
String fontFamily,
|
||||||
Color ownMessageBackgroundColor,
|
Color ownMessageBackgroundColor,
|
||||||
Color otherMessageBackgroundColor,
|
Color otherMessageBackgroundColor,
|
||||||
@@ -159,6 +307,7 @@ class MessageTheme {
|
|||||||
otherMessageBackgroundColor:
|
otherMessageBackgroundColor:
|
||||||
otherMessageBackgroundColor ?? this.otherMessageBackgroundColor,
|
otherMessageBackgroundColor ?? this.otherMessageBackgroundColor,
|
||||||
avatarTheme: avatarTheme ?? this.avatarTheme,
|
avatarTheme: avatarTheme ?? this.avatarTheme,
|
||||||
|
replies: replies ?? this.replies,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ dependencies:
|
|||||||
video_player: ^0.10.7
|
video_player: ^0.10.7
|
||||||
chewie: ^0.9.8+1
|
chewie: ^0.9.8+1
|
||||||
animations: ^1.0.0+3
|
animations: ^1.0.0+3
|
||||||
stream_chat: ^0.1.8
|
stream_chat: ^0.1.10
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
pedantic: ^1.8.0+1
|
pedantic: ^1.8.0+1
|
||||||
|
|||||||
Reference in New Issue
Block a user