From 779130c0d694d823774104a2e4cf9faae2fdd8d7 Mon Sep 17 00:00:00 2001
From: lcsvcn <6011385+lcsvcn@users.noreply.github.com>
Date: Tue, 19 Nov 2024 13:47:25 -0300
Subject: [PATCH] added working center title
---
example/ios/Flutter/AppFrameworkInfo.plist | 2 +-
example/ios/Podfile | 2 +-
example/ios/Runner.xcodeproj/project.pbxproj | 14 ++++----
.../xcshareddata/xcschemes/Runner.xcscheme | 2 +-
example/ios/Runner/AppDelegate.swift | 2 +-
example/lib/main.dart | 30 ++++++----------
lib/src/widgets/chat_view_appbar.dart | 35 ++++++++++---------
7 files changed, 41 insertions(+), 46 deletions(-)
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 9625e105..7c569640 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 11.0
+ 12.0
diff --git a/example/ios/Podfile b/example/ios/Podfile
index 88359b22..279576f3 100644
--- a/example/ios/Podfile
+++ b/example/ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-# platform :ios, '11.0'
+# platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 972adf77..20773d59 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1300;
+ LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -342,7 +342,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -361,7 +361,7 @@
DEVELOPMENT_TEAM = KX234MPD84;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -421,7 +421,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -470,7 +470,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -490,7 +490,7 @@
DEVELOPMENT_TEAM = KX234MPD84;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -514,7 +514,7 @@
DEVELOPMENT_TEAM = KX234MPD84;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 3db53b6e..e67b2808 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
{
flashingCircleDarkColor: theme.flashingCircleDarkColor,
),
appBar: ChatViewAppBar(
- elevation: theme.elevation,
- backgroundColor: theme.appBarColor,
+ elevation: theme.elevation!,
+ backgroundColor: theme.appBarColor!,
profilePicture: Data.profileImage,
backArrowColor: theme.backArrowColor,
chatTitle: "Chat view",
@@ -135,14 +134,13 @@ class _ChatScreenState extends State {
letterSpacing: 0.25,
),
userStatus: "online",
+ centerTitle: false,
userStatusTextStyle: const TextStyle(color: Colors.grey),
actions: [
IconButton(
onPressed: _onThemeIconTap,
icon: Icon(
- isDarkTheme
- ? Icons.brightness_4_outlined
- : Icons.dark_mode_outlined,
+ isDarkTheme ? Icons.brightness_4_outlined : Icons.dark_mode_outlined,
color: theme.themeIconColor,
),
),
@@ -212,8 +210,7 @@ class _ChatScreenState extends State {
bodyStyle: theme.outgoingChatLinkBodyStyle,
titleStyle: theme.outgoingChatLinkTitleStyle,
),
- receiptsWidgetConfig:
- const ReceiptsWidgetConfig(showReceiptsIn: ShowReceiptsIn.all),
+ receiptsWidgetConfig: const ReceiptsWidgetConfig(showReceiptsIn: ShowReceiptsIn.all),
color: theme.outgoingChatBubbleColor,
),
inComingChatBubbleConfig: ChatBubble(
@@ -231,8 +228,7 @@ class _ChatScreenState extends State {
/// send your message reciepts to the other client
debugPrint('Message Read');
},
- senderNameTextStyle:
- TextStyle(color: theme.inComingChatBubbleTextColor),
+ senderNameTextStyle: TextStyle(color: theme.inComingChatBubbleTextColor),
color: theme.inComingChatBubbleColor,
),
),
@@ -252,10 +248,8 @@ class _ChatScreenState extends State {
messageReactionConfig: MessageReactionConfiguration(
backgroundColor: theme.messageReactionBackGroundColor,
borderColor: theme.messageReactionBackGroundColor,
- reactedUserCountTextStyle:
- TextStyle(color: theme.inComingChatBubbleTextColor),
- reactionCountTextStyle:
- TextStyle(color: theme.inComingChatBubbleTextColor),
+ reactedUserCountTextStyle: TextStyle(color: theme.inComingChatBubbleTextColor),
+ reactionCountTextStyle: TextStyle(color: theme.inComingChatBubbleTextColor),
reactionsBottomSheetConfig: ReactionsBottomSheetConfiguration(
backgroundColor: theme.backgroundColor,
reactedUserTextStyle: TextStyle(
@@ -316,8 +310,7 @@ class _ChatScreenState extends State {
color: isDarkTheme ? Colors.white : Colors.black,
),
),
- onTap: (item) =>
- _onSendTap(item.text, const ReplyMessage(), MessageType.text),
+ onTap: (item) => _onSendTap(item.text, const ReplyMessage(), MessageType.text),
),
),
);
@@ -339,8 +332,7 @@ class _ChatScreenState extends State {
),
);
Future.delayed(const Duration(milliseconds: 300), () {
- _chatController.initialMessageList.last.setStatus =
- MessageStatus.undelivered;
+ _chatController.initialMessageList.last.setStatus = MessageStatus.undelivered;
});
Future.delayed(const Duration(seconds: 1), () {
_chatController.initialMessageList.last.setStatus = MessageStatus.read;
diff --git a/lib/src/widgets/chat_view_appbar.dart b/lib/src/widgets/chat_view_appbar.dart
index 53dae961..eed3de0e 100644
--- a/lib/src/widgets/chat_view_appbar.dart
+++ b/lib/src/widgets/chat_view_appbar.dart
@@ -134,24 +134,27 @@ class ChatViewAppBar extends StatelessWidget {
networkImageProgressIndicatorBuilder: networkImageProgressIndicatorBuilder,
),
),
- Column(
- crossAxisAlignment: centerTitle ? CrossAxisAlignment.center : CrossAxisAlignment.start,
- children: [
- Text(
- chatTitle,
- style: chatTitleTextStyle ??
- const TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.bold,
- letterSpacing: 0.25,
- ),
- ),
- if (userStatus != null)
+ Expanded(
+ child: Column(
+ crossAxisAlignment: centerTitle ? CrossAxisAlignment.center : CrossAxisAlignment.start,
+ mainAxisAlignment: centerTitle ? MainAxisAlignment.center : MainAxisAlignment.start,
+ children: [
Text(
- userStatus!,
- style: userStatusTextStyle,
+ chatTitle,
+ style: chatTitleTextStyle ??
+ const TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.bold,
+ letterSpacing: 0.25,
+ ),
),
- ],
+ if (userStatus != null)
+ Text(
+ userStatus!,
+ style: userStatusTextStyle,
+ ),
+ ],
+ ),
),
],
),