diff --git a/CHANGELOG.md b/CHANGELOG.md index 4974848..69f8702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - fix bug where you would route back to the user selection screen insterad of routing back to the chat overview screen - Add onPopInvoked callback to the userstory to add custom behaviour for the back button on the chatscreen - Handle overflows for users with a long name. +- Remove the scaffold backgrounds because they should be inherited from the scaffold theme ## 3.0.0 diff --git a/packages/flutter_chat/lib/src/flutter_chat_userstory.dart b/packages/flutter_chat/lib/src/flutter_chat_userstory.dart index b37d4c8..d81e752 100644 --- a/packages/flutter_chat/lib/src/flutter_chat_userstory.dart +++ b/packages/flutter_chat/lib/src/flutter_chat_userstory.dart @@ -14,7 +14,6 @@ List getChatStoryRoutes( GoRoute( path: ChatUserStoryRoutes.chatScreen, pageBuilder: (context, state) { - var theme = Theme.of(context); var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; var chatScreen = ChatScreen( @@ -52,7 +51,6 @@ List getChatStoryRoutes( chatScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: chatScreen, ), ), @@ -65,7 +63,6 @@ List getChatStoryRoutes( var chatId = state.pathParameters["id"]; var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; - var theme = Theme.of(context); var chatDetailScreen = ChatDetailScreen( chatTitleBuilder: configuration.chatTitleBuilder, @@ -127,7 +124,6 @@ List getChatStoryRoutes( chatDetailScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: chatDetailScreen, ), ); @@ -138,7 +134,6 @@ List getChatStoryRoutes( pageBuilder: (context, state) { var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; - var theme = Theme.of(context); var newChatScreen = NewChatScreen( options: configuration.chatOptionsBuilder(context), @@ -177,7 +172,6 @@ List getChatStoryRoutes( newChatScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: newChatScreen, ), ); @@ -188,7 +182,6 @@ List getChatStoryRoutes( pageBuilder: (context, state) { var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; - var theme = Theme.of(context); var newGroupChatScreen = NewGroupChatScreen( options: configuration.chatOptionsBuilder(context), @@ -208,7 +201,6 @@ List getChatStoryRoutes( newGroupChatScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: newGroupChatScreen, ), ); @@ -220,7 +212,6 @@ List getChatStoryRoutes( var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; var users = state.extra! as List; - var theme = Theme.of(context); var newGroupChatOverviewScreen = NewGroupChatOverviewScreen( options: configuration.chatOptionsBuilder(context), @@ -255,7 +246,6 @@ List getChatStoryRoutes( newGroupChatOverviewScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: newGroupChatOverviewScreen, ), ); @@ -269,7 +259,6 @@ List getChatStoryRoutes( var id = userId == "null" ? null : userId; var service = configuration.chatServiceBuilder?.call(context) ?? configuration.chatService; - var theme = Theme.of(context); var profileScreen = ChatProfileScreen( translations: configuration.translationsBuilder?.call(context) ?? @@ -295,7 +284,6 @@ List getChatStoryRoutes( profileScreen, ) ?? Scaffold( - backgroundColor: theme.colorScheme.surface, body: profileScreen, ), ); diff --git a/packages/flutter_chat_view/lib/src/config/chat_options.dart b/packages/flutter_chat_view/lib/src/config/chat_options.dart index 3d8ff30..daa97e6 100644 --- a/packages/flutter_chat_view/lib/src/config/chat_options.dart +++ b/packages/flutter_chat_view/lib/src/config/chat_options.dart @@ -177,6 +177,7 @@ Scaffold _createScaffold( Scaffold( appBar: appbar, body: body, + backgroundColor: backgroundColor, ); Widget _createUserAvatar( diff --git a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart index 3ddbbe5..5ae9d88 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart @@ -174,7 +174,6 @@ class _ChatDetailScreenState extends State { : ""; return Scaffold( - backgroundColor: theme.colorScheme.surface, appBar: AppBar( backgroundColor: theme.appBarTheme.backgroundColor, iconTheme: theme.appBarTheme.iconTheme ?? diff --git a/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart index 5d11d37..e39f59c 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart @@ -66,7 +66,6 @@ class _ProfileScreenState extends State { ); } return Scaffold( - backgroundColor: theme.colorScheme.surface, appBar: AppBar( backgroundColor: theme.appBarTheme.backgroundColor, iconTheme: theme.appBarTheme.iconTheme ?? diff --git a/packages/flutter_chat_view/lib/src/screens/chat_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_screen.dart index 604b562..5393e13 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_screen.dart @@ -147,9 +147,7 @@ class _ChatScreenState extends State { decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: Theme.of(context) - .colorScheme - .secondary + color: theme.colorScheme.secondary .withOpacity(0.3), width: 0.5, ), diff --git a/packages/flutter_chat_view/lib/src/screens/new_chat_screen.dart b/packages/flutter_chat_view/lib/src/screens/new_chat_screen.dart index 2d31058..795b4eb 100644 --- a/packages/flutter_chat_view/lib/src/screens/new_chat_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/new_chat_screen.dart @@ -47,7 +47,6 @@ class _NewChatScreenState extends State { Widget build(BuildContext context) { var theme = Theme.of(context); return Scaffold( - backgroundColor: theme.colorScheme.surface, appBar: AppBar( iconTheme: theme.appBarTheme.iconTheme ?? const IconThemeData(color: Colors.white),