Skip to content

Commit

Permalink
fix: change the backgroundcolors
Browse files Browse the repository at this point in the history
  • Loading branch information
freekvandeven committed Jun 14, 2024
1 parent d46c83e commit 2f2e2be
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions packages/flutter_chat/lib/src/flutter_chat_userstory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ List<GoRoute> getChatStoryRoutes(
GoRoute(
path: ChatUserStoryRoutes.chatScreen,
pageBuilder: (context, state) {
var theme = Theme.of(context);
var service = configuration.chatServiceBuilder?.call(context) ??
configuration.chatService;
var chatScreen = ChatScreen(
Expand Down Expand Up @@ -52,7 +51,6 @@ List<GoRoute> getChatStoryRoutes(
chatScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: chatScreen,
),
),
Expand All @@ -65,7 +63,6 @@ List<GoRoute> 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,
Expand Down Expand Up @@ -127,7 +124,6 @@ List<GoRoute> getChatStoryRoutes(
chatDetailScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: chatDetailScreen,
),
);
Expand All @@ -138,7 +134,6 @@ List<GoRoute> getChatStoryRoutes(
pageBuilder: (context, state) {
var service = configuration.chatServiceBuilder?.call(context) ??
configuration.chatService;
var theme = Theme.of(context);

var newChatScreen = NewChatScreen(
options: configuration.chatOptionsBuilder(context),
Expand Down Expand Up @@ -177,7 +172,6 @@ List<GoRoute> getChatStoryRoutes(
newChatScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: newChatScreen,
),
);
Expand All @@ -188,7 +182,6 @@ List<GoRoute> getChatStoryRoutes(
pageBuilder: (context, state) {
var service = configuration.chatServiceBuilder?.call(context) ??
configuration.chatService;
var theme = Theme.of(context);

var newGroupChatScreen = NewGroupChatScreen(
options: configuration.chatOptionsBuilder(context),
Expand All @@ -208,7 +201,6 @@ List<GoRoute> getChatStoryRoutes(
newGroupChatScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: newGroupChatScreen,
),
);
Expand All @@ -220,7 +212,6 @@ List<GoRoute> getChatStoryRoutes(
var service = configuration.chatServiceBuilder?.call(context) ??
configuration.chatService;
var users = state.extra! as List<ChatUserModel>;
var theme = Theme.of(context);

var newGroupChatOverviewScreen = NewGroupChatOverviewScreen(
options: configuration.chatOptionsBuilder(context),
Expand Down Expand Up @@ -255,7 +246,6 @@ List<GoRoute> getChatStoryRoutes(
newGroupChatOverviewScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: newGroupChatOverviewScreen,
),
);
Expand All @@ -269,7 +259,6 @@ List<GoRoute> 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) ??
Expand All @@ -295,7 +284,6 @@ List<GoRoute> getChatStoryRoutes(
profileScreen,
) ??
Scaffold(
backgroundColor: theme.colorScheme.surface,
body: profileScreen,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Scaffold _createScaffold(
Scaffold(
appBar: appbar,
body: body,
backgroundColor: backgroundColor,
);

Widget _createUserAvatar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
: "";

return Scaffold(
backgroundColor: theme.colorScheme.surface,
appBar: AppBar(
backgroundColor: theme.appBarTheme.backgroundColor,
iconTheme: theme.appBarTheme.iconTheme ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class _ProfileScreenState extends State<ChatProfileScreen> {
);
}
return Scaffold(
backgroundColor: theme.colorScheme.surface,
appBar: AppBar(
backgroundColor: theme.appBarTheme.backgroundColor,
iconTheme: theme.appBarTheme.iconTheme ??
Expand Down
4 changes: 1 addition & 3 deletions packages/flutter_chat_view/lib/src/screens/chat_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ class _ChatScreenState extends State<ChatScreen> {
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context)
.colorScheme
.secondary
color: theme.colorScheme.secondary
.withOpacity(0.3),
width: 0.5,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class _NewChatScreenState extends State<NewChatScreen> {
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),
Expand Down

0 comments on commit 2f2e2be

Please sign in to comment.