feat: Added color theme implementations

This commit is contained in:
Deven Joshi
2020-12-29 23:10:41 +05:30
parent 08d2b32eff
commit 7fd8a1ed57
43 changed files with 504 additions and 224 deletions
+1 -1
View File
@@ -1 +1 @@
13a41b8138c4868054e44b5158f3bdd6
209b1a40522bc1cb0ea3596a28cded5e
+1 -1
View File
@@ -296,4 +296,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: eb001256612a59f8f9e4d083ad8b9671e69dd184
COCOAPODS: 1.10.0
COCOAPODS: 1.8.3
+25 -11
View File
@@ -45,11 +45,11 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
style: StreamChatTheme.of(context)
.textTheme
.headlineBold
.copyWith(color: Colors.black),
.copyWith(color: StreamChatTheme.of(context).colorTheme.black),
),
leading: IconButton(
icon: StreamSvgIcon.left(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
Navigator.pop(context);
@@ -89,7 +89,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
},
style: TextStyle(
fontSize: 14,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
decoration: InputDecoration(
errorStyle: TextStyle(fontSize: 0),
@@ -98,7 +98,10 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
fontWeight: FontWeight.bold,
color: _apiKeyError != null
? Color(0xffff3742)
: Colors.black.withOpacity(.5),
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
border: UnderlineInputBorder(
borderRadius: BorderRadius.circular(8),
@@ -133,7 +136,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
},
style: TextStyle(
fontSize: 14,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
textInputAction: TextInputAction.next,
decoration: InputDecoration(
@@ -143,7 +146,10 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
fontSize: 14,
color: _userIdError != null
? Color(0xffff3742)
: Colors.black.withOpacity(.5),
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
border: UnderlineInputBorder(
borderRadius: BorderRadius.circular(8),
@@ -178,7 +184,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
},
style: TextStyle(
fontSize: 14,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
textInputAction: TextInputAction.next,
decoration: InputDecoration(
@@ -188,7 +194,10 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
fontSize: 14,
color: _userTokenError != null
? Color(0xffff3742)
: Colors.black.withOpacity(.5),
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
border: UnderlineInputBorder(
borderRadius: BorderRadius.circular(8),
@@ -210,7 +219,10 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
labelStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
border: UnderlineInputBorder(
borderRadius: BorderRadius.circular(8),
@@ -232,7 +244,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
child: Text(
'Login',
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
fontSize: 16,
),
),
@@ -257,7 +269,9 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
),
height: 100,
width: 100,
+18 -5
View File
@@ -66,7 +66,7 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
onTap: _pauseItemAddition ? resumeItemAddition : null,
child: Material(
elevation: 1,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: Container(
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 16),
@@ -81,7 +81,11 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(.5)),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
),
),
SizedBox(width: 12),
@@ -115,7 +119,10 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
.textTheme
.body
.copyWith(
color: Colors.black.withOpacity(.5)),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
),
),
],
@@ -127,11 +134,17 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
child: IconButton(
icon: _chips.isEmpty
? StreamSvgIcon.user(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
size: 24,
)
: StreamSvgIcon.userAdd(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
size: 24,
),
onPressed: resumeItemAddition,
+4 -2
View File
@@ -113,7 +113,9 @@ class ChooseUserPage extends StatelessWidget {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
),
height: 100,
width: 100,
@@ -189,7 +191,7 @@ class ChooseUserPage extends StatelessWidget {
},
leading: CircleAvatar(
child: StreamSvgIcon.settings(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
backgroundColor:
StreamChatTheme.of(context).secondaryColor,
+3 -2
View File
@@ -50,9 +50,10 @@ class MyApp extends StatelessWidget {
client: client,
streamChatThemeData: StreamChatThemeData.fromTheme(theme).copyWith(
ownMessageTheme: MessageTheme(
messageBackgroundColor: Colors.black,
messageBackgroundColor:
StreamChatTheme.of(context).colorTheme.black,
messageText: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
avatarTheme: AvatarTheme(
borderRadius: BorderRadius.circular(8),
+4 -1
View File
@@ -87,7 +87,10 @@ class ChannelListPage extends StatelessWidget {
channel: channel,
textStyle:
StreamChatTheme.of(context).channelPreviewTheme.title.copyWith(
color: Colors.black.withOpacity(opacity),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(opacity),
),
),
subtitle: Text(subtitle),
+28 -9
View File
@@ -62,12 +62,12 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
backgroundColor: Color.fromRGBO(252, 252, 252, 1),
appBar: AppBar(
elevation: 1,
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
leading: const StreamBackButton(),
title: Text(
'Name of Group Chat',
style: TextStyle(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
fontSize: 16,
),
),
@@ -82,7 +82,10 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
'NAME',
style: TextStyle(
fontSize: 12,
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
),
SizedBox(width: 16),
@@ -99,7 +102,11 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
contentPadding: const EdgeInsets.all(0),
hintText: 'Choose a group chat name',
hintStyle: TextStyle(
fontSize: 14, color: Colors.black.withOpacity(.5)),
fontSize: 14,
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
),
),
),
@@ -167,16 +174,28 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
separatorBuilder: (_, __) => Container(
height: 1,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(0.1)
: Colors.black.withOpacity(0.1),
? StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.1)
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.1),
),
itemBuilder: (_, index) {
if (index == _selectedUsers.length) {
return Container(
height: 1,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(0.1)
: Colors.black.withOpacity(0.1),
? StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.1)
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.1),
);
}
final user = _selectedUsers[index];
@@ -200,7 +219,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
trailing: IconButton(
icon: Icon(
Icons.clear_rounded,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
padding: const EdgeInsets.all(0),
splashRadius: 24,
+21 -8
View File
@@ -55,10 +55,10 @@ class MyApp extends StatelessWidget {
client: client,
child: MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
theme: ThemeData.dark(),
darkTheme: ThemeData.dark(),
//TODO change to system once dark theme is implemented
themeMode: ThemeMode.light,
themeMode: ThemeMode.dark,
onGenerateRoute: AppRoutes.generateRoute,
initialRoute:
client.state.user == null ? Routes.CHOOSE_USER : Routes.HOME,
@@ -84,7 +84,9 @@ class _HomePageState extends State<HomePage> {
overflow: Overflow.visible,
children: [
StreamSvgIcon.message(
color: _isSelected(0) ? Colors.black : Colors.grey,
color: _isSelected(0)
? StreamChatTheme.of(context).colorTheme.black
: Colors.grey,
),
Positioned(
top: -3,
@@ -100,7 +102,9 @@ class _HomePageState extends State<HomePage> {
overflow: Overflow.visible,
children: [
StreamSvgIcon.mentions(
color: _isSelected(1) ? Colors.black : Colors.grey,
color: _isSelected(1)
? StreamChatTheme.of(context).colorTheme.black
: Colors.grey,
),
],
),
@@ -127,7 +131,7 @@ class _HomePageState extends State<HomePage> {
unselectedLabelStyle:
StreamChatTheme.of(context).textTheme.footnoteBold,
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.black,
selectedItemColor: StreamChatTheme.of(context).colorTheme.black,
unselectedItemColor: Colors.grey,
onTap: (index) {
setState(() => _currentIndex = index);
@@ -179,7 +183,10 @@ class _HomePageState extends State<HomePage> {
),
ListTile(
leading: StreamSvgIcon.penWrite(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
onTap: () {
Navigator.popAndPushNamed(
@@ -196,7 +203,10 @@ class _HomePageState extends State<HomePage> {
),
ListTile(
leading: StreamSvgIcon.contacts(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
onTap: () {
Navigator.popAndPushNamed(
@@ -231,7 +241,10 @@ class _HomePageState extends State<HomePage> {
);
},
leading: StreamSvgIcon.user(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
title: Text(
'Sign out',
+32 -10
View File
@@ -125,14 +125,14 @@ class _NewChatScreenState extends State<NewChatScreen> {
backgroundColor: Color.fromRGBO(252, 252, 252, 1),
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
leading: const StreamBackButton(),
title: Text(
'New Chat',
style: StreamChatTheme.of(context)
.textTheme
.headlineBold
.copyWith(color: Colors.black),
.copyWith(color: StreamChatTheme.of(context).colorTheme.black),
),
centerTitle: true,
),
@@ -157,7 +157,10 @@ class _NewChatScreenState extends State<NewChatScreen> {
children: [
Container(
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.05),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.05),
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.only(left: 24),
@@ -165,7 +168,10 @@ class _NewChatScreenState extends State<NewChatScreen> {
padding: const EdgeInsets.fromLTRB(8, 4, 12, 4),
child: Text(
user.name,
style: TextStyle(color: Colors.black),
style: TextStyle(
color: StreamChatTheme.of(context)
.colorTheme
.black),
),
),
),
@@ -182,7 +188,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
),
Positioned(
child: StreamSvgIcon.close(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
],
@@ -235,8 +241,14 @@ class _NewChatScreenState extends State<NewChatScreen> {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.black.withOpacity(0.02),
Colors.white.withOpacity(0.05),
StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.02),
StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.05),
],
stops: [0, 1],
),
@@ -253,7 +265,11 @@ class _NewChatScreenState extends State<NewChatScreen> {
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(.5))),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5))),
),
),
Expanded(
@@ -318,7 +334,10 @@ class _NewChatScreenState extends State<NewChatScreen> {
.textTheme
.footnote
.copyWith(
color: Colors.black
color: StreamChatTheme.of(
context)
.colorTheme
.black
.withOpacity(.5)),
),
],
@@ -344,7 +363,10 @@ class _NewChatScreenState extends State<NewChatScreen> {
'No chats here yet...',
style: TextStyle(
fontSize: 12,
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
),
);
+25 -9
View File
@@ -62,12 +62,12 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
pinned: true,
forceElevated: true,
elevation: 1,
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
leading: const StreamBackButton(),
title: Text(
'Add Group Members',
style: TextStyle(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
fontSize: 16,
),
),
@@ -137,7 +137,9 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
shape: BoxShape.circle,
border: Border.all(
color: Colors.grey.shade100,
@@ -146,7 +148,9 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
child: Padding(
padding: const EdgeInsets.all(0.0),
child: StreamSvgIcon.close(
color: Colors.black,
color: StreamChatTheme.of(context)
.colorTheme
.black,
size: 24,
),
),
@@ -180,8 +184,14 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.black.withOpacity(0.02),
Colors.white.withOpacity(0.05),
StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.02),
StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.05),
],
stops: [0, 1],
),
@@ -196,7 +206,10 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
? 'Matches for \"$_userNameQuery\"'
: 'On the platform',
style: TextStyle(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
),
),
@@ -267,7 +280,10 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
.textTheme
.footnote
.copyWith(
color: Colors.black.withOpacity(.5)),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
),
],
),
@@ -299,7 +315,7 @@ class _HeaderDelegate extends SliverPersistentHeaderDelegate {
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: child,
);
}
+7 -6
View File
@@ -22,7 +22,7 @@ class SearchTextField extends StatelessWidget {
return Container(
height: 36,
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
border: Border.all(
color: Colors.grey.shade300,
),
@@ -48,15 +48,16 @@ class SearchTextField extends StatelessWidget {
right: 8,
),
child: StreamSvgIcon.search(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
size: 24,
),
),
hintText: hintText,
hintStyle: StreamChatTheme.of(context)
.textTheme
.body
.copyWith(color: Colors.black.withOpacity(.5)),
hintStyle: StreamChatTheme.of(context).textTheme.body.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
contentPadding: const EdgeInsets.all(0),
border: OutlineInputBorder(
borderSide: BorderSide.none,
+3 -1
View File
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:yaml/yaml.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
class StreamVersion extends StatelessWidget {
const StreamVersion({
@@ -28,7 +29,8 @@ class StreamVersion extends StatelessWidget {
'Stream SDK v ${streamChatDep}',
style: TextStyle(
fontSize: 14.5,
color: Colors.black.withOpacity(.13),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(.13),
),
);
},
+3 -1
View File
@@ -3,6 +3,8 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:stream_chat/stream_chat.dart';
import '../stream_chat_flutter.dart';
class AttachmentError extends StatelessWidget {
final Attachment attachment;
final Size size;
@@ -28,7 +30,7 @@ class AttachmentError extends StatelessWidget {
child: Center(
child: Icon(
Icons.error_outline,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+4 -2
View File
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
import 'package:stream_chat_flutter/src/unread_indicator.dart';
import '../stream_chat_flutter.dart';
class StreamBackButton extends StatelessWidget {
const StreamBackButton({
Key key,
@@ -36,8 +38,8 @@ class StreamBackButton extends StatelessWidget {
child: StreamSvgIcon.left(
size: 24,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.black,
? StreamChatTheme.of(context).colorTheme.white
: StreamChatTheme.of(context).colorTheme.black,
),
),
),
+3 -1
View File
@@ -149,7 +149,9 @@ class ChannelImage extends StatelessWidget {
? snapshot.data['name'][0]
: '',
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
fontWeight: FontWeight.bold,
),
),
+1 -1
View File
@@ -145,7 +145,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
Widget _buildConnectedTitleState(BuildContext context) => Text(
'Stream Chat',
style: StreamChatTheme.of(context).textTheme.headlineBold.copyWith(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
);
+6 -6
View File
@@ -319,7 +319,7 @@ class _ChannelListViewState extends State<ChannelListView>
child: ListTile(
leading: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
shape: BoxShape.circle,
),
constraints: BoxConstraints.tightFor(
@@ -331,7 +331,7 @@ class _ChannelListViewState extends State<ChannelListView>
alignment: Alignment.centerLeft,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.circular(11),
),
constraints: BoxConstraints.tightFor(
@@ -346,7 +346,7 @@ class _ChannelListViewState extends State<ChannelListView>
alignment: Alignment.centerLeft,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.circular(11),
),
constraints: BoxConstraints.tightFor(
@@ -358,7 +358,7 @@ class _ChannelListViewState extends State<ChannelListView>
Container(
margin: const EdgeInsets.only(left: 16),
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.circular(11),
),
constraints: BoxConstraints.tightFor(
@@ -622,8 +622,8 @@ class _ChannelListViewState extends State<ChannelListView>
return Container(
height: 1,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(0.1)
: Colors.black.withOpacity(0.1),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(0.1)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.1),
);
}
+1 -1
View File
@@ -36,7 +36,7 @@ class ChannelUnreadIndicator extends StatelessWidget {
'${snapshot.data}',
style: TextStyle(
fontSize: 11,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+50 -22
View File
@@ -47,7 +47,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
Widget _buildUserHeader() {
return Material(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: SafeArea(
child: Stack(
children: [
@@ -81,7 +81,11 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
child: Text(
widget.user.name,
style: TextStyle(
color: Colors.black.withOpacity(0.5), fontSize: 16.0),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
fontSize: 16.0),
),
),
onTap: () {},
@@ -113,7 +117,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
// title: 'Notifications',
// leading: StreamSvgIcon.Icon_notification(
// size: 24.0,
// color: Colors.black.withOpacity(0.5),
// color: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
// ),
// trailing: CupertinoSwitch(
// value: true,
@@ -128,7 +132,10 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
title: 'Mute user',
leading: StreamSvgIcon.mute(
size: 23.0,
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
trailing: snapshot.data == null
? CircularProgressIndicator()
@@ -149,7 +156,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
// title: 'Block User',
// leading: StreamSvgIcon.Icon_user_delete(
// size: 24.0,
// color: Colors.black.withOpacity(0.5),
// color: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
// ),
// trailing: CupertinoSwitch(
// value: widget.user.banned,
@@ -167,7 +174,8 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
title: 'Photos & Videos',
leading: StreamSvgIcon.pictures(
size: 32.0,
color: Colors.black.withOpacity(0.5),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
),
trailing: StreamSvgIcon.right(),
onTap: () {
@@ -179,7 +187,8 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
title: 'Files',
leading: StreamSvgIcon.files(
size: 32.0,
color: Colors.black.withOpacity(0.5),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
),
trailing: StreamSvgIcon.right(),
onTap: () {
@@ -191,7 +200,8 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
title: 'Shared groups',
leading: StreamSvgIcon.Icon_group(
size: 24.0,
color: Colors.black.withOpacity(0.5),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
),
trailing: StreamSvgIcon.right(),
onTap: () {
@@ -248,12 +258,20 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
if (otherMember.online) {
alternativeWidget = Text(
'Online',
style: TextStyle(color: Colors.black.withOpacity(0.5)),
style: TextStyle(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
);
} else {
alternativeWidget = Text(
'Last seen ${Jiffy(otherMember.lastActive).fromNow()}',
style: TextStyle(color: Colors.black.withOpacity(0.5)),
style: TextStyle(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
);
}
}
@@ -275,7 +293,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
color: Color(0xff20E070),
),
),
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
alternativeWidget,
],
@@ -307,7 +325,7 @@ class _OptionListTile extends StatelessWidget {
height: 2.0,
),
Material(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: Container(
height: 56.0,
child: InkWell(
@@ -365,14 +383,16 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
var chat = StreamChat.of(context);
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
appBar: AppBar(
brightness: Theme.of(context).brightness,
elevation: 1,
centerTitle: true,
title: Text(
'Shared Groups',
style: TextStyle(color: Colors.black, fontSize: 16.0),
style: TextStyle(
color: StreamChatTheme.of(context).colorTheme.black,
fontSize: 16.0),
),
leading: Center(
child: InkWell(
@@ -381,7 +401,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
},
child: Container(
child: StreamSvgIcon.left(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
width: 24.0,
@@ -488,7 +508,11 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
padding: const EdgeInsets.all(8.0),
child: Text(
'${channel.memberCount} members',
style: TextStyle(color: Colors.black.withOpacity(0.5)),
style: TextStyle(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
),
)
],
@@ -509,14 +533,16 @@ class _MediaDisplayScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
appBar: AppBar(
brightness: Theme.of(context).brightness,
elevation: 1,
centerTitle: true,
title: Text(
'Photos & Videos',
style: TextStyle(color: Colors.black, fontSize: 16.0),
style: TextStyle(
color: StreamChatTheme.of(context).colorTheme.black,
fontSize: 16.0),
),
leading: Center(
child: InkWell(
@@ -525,7 +551,7 @@ class _MediaDisplayScreen extends StatelessWidget {
},
child: Container(
child: StreamSvgIcon.left(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
width: 24.0,
@@ -543,14 +569,16 @@ class _FileDisplayScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
appBar: AppBar(
brightness: Theme.of(context).brightness,
elevation: 1,
centerTitle: true,
title: Text(
'Files',
style: TextStyle(color: Colors.black, fontSize: 16.0),
style: TextStyle(
color: StreamChatTheme.of(context).colorTheme.black,
fontSize: 16.0),
),
leading: Center(
child: InkWell(
@@ -559,7 +587,7 @@ class _FileDisplayScreen extends StatelessWidget {
},
child: Container(
child: StreamSvgIcon.left(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
width: 24.0,
+3 -3
View File
@@ -41,8 +41,8 @@ class DateDivider extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: (Theme.of(context).brightness == Brightness.light
? Colors.black
: Colors.white)
? StreamChatTheme.of(context).colorTheme.black
: StreamChatTheme.of(context).colorTheme.white)
.withOpacity(0.5),
borderRadius: BorderRadius.circular(
8,
@@ -51,7 +51,7 @@ class DateDivider extends StatelessWidget {
child: Text(
dayInfo,
style: StreamChatTheme.of(context).textTheme.footnoteBold.copyWith(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
fontWeight: FontWeight.bold,
),
),
+10 -4
View File
@@ -41,8 +41,14 @@ class DeletedMessage extends StatelessWidget {
side: borderSide ??
BorderSide(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withAlpha(24)
: Colors.black.withAlpha(24),
? StreamChatTheme.of(context)
.colorTheme
.white
.withAlpha(24)
: StreamChatTheme.of(context)
.colorTheme
.black
.withAlpha(24),
),
),
child: Padding(
@@ -58,8 +64,8 @@ class DeletedMessage extends StatelessWidget {
style: messageTheme.messageText.copyWith(
fontStyle: FontStyle.italic,
color: (Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.black)
? StreamChatTheme.of(context).colorTheme.white
: StreamChatTheme.of(context).colorTheme.black)
.withOpacity(.5),
),
),
+9 -8
View File
@@ -63,7 +63,7 @@ class _FileAttachmentState extends State<FileAttachment> {
height: 56.0,
margin: widget.trailing != null ? EdgeInsets.only(top: 4.0) : null,
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius:
widget.trailing != null ? BorderRadius.circular(16.0) : null,
border: widget.trailing != null
@@ -97,10 +97,11 @@ class _FileAttachmentState extends State<FileAttachment> {
),
Text(
'${_getSizeText(widget.attachment.extraData['file_size'])}',
style: StreamChatTheme.of(context)
.textTheme
.body
.copyWith(color: Colors.black.withOpacity(0.5)),
style: StreamChatTheme.of(context).textTheme.body.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
),
],
),
@@ -110,7 +111,7 @@ class _FileAttachmentState extends State<FileAttachment> {
widget.trailing ??
IconButton(
icon: StreamSvgIcon.cloud_download(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
launchURL(context, widget.attachment.assetUrl);
@@ -138,13 +139,13 @@ class _FileAttachmentState extends State<FileAttachment> {
// subtitle: Text(
// '${attachment.extraData['file_size'] ?? 'N/A'} bytes',
// style: TextStyle(
// color: Colors.black.withOpacity(0.5),
// color: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
// ),
// ),
// trailing: trailing ??
// IconButton(
// icon: StreamSvgIcon.cloud_download(
// color: Colors.black,
// color: StreamChatTheme.of(context).colorTheme.black,
// ),
// onPressed: () {
// launchURL(context, attachment.assetUrl);
+3 -1
View File
@@ -100,7 +100,9 @@ class _FullScreenMediaState extends State<FullScreenMedia>
.channelTheme
.channelHeaderTheme
.color,
end: Colors.black)
end: StreamChatTheme.of(context)
.colorTheme
.black)
.lerp(_controller.value),
),
onTapUp: (a, b, c) {
+36 -11
View File
@@ -112,7 +112,10 @@ class GiphyAttachment extends StatelessWidget {
bottom: 16,
left: 16,
child: Material(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
@@ -124,13 +127,16 @@ class GiphyAttachment extends StatelessWidget {
child: Row(
children: [
StreamSvgIcon.lightning(
color: Colors.white,
color:
StreamChatTheme.of(context).colorTheme.white,
size: 16,
),
Text(
'GIPHY',
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
fontWeight: FontWeight.bold,
fontSize: 11,
),
@@ -202,7 +208,10 @@ class GiphyAttachment extends StatelessWidget {
height: 4.0,
),
Container(
color: Colors.black.withOpacity(0.2),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.2),
width: double.infinity,
height: 0.5,
),
@@ -224,14 +233,20 @@ class GiphyAttachment extends StatelessWidget {
.textTheme
.bodyBold
.copyWith(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
),
),
),
Container(
width: 0.5,
color: Colors.black.withOpacity(0.2),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.2),
height: 50.0,
),
Expanded(
@@ -266,7 +281,10 @@ class GiphyAttachment extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
StreamSvgIcon.eye(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
size: 16.0,
),
SizedBox(
@@ -277,7 +295,11 @@ class GiphyAttachment extends StatelessWidget {
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(0.5)),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
),
],
),
@@ -334,7 +356,10 @@ class GiphyAttachment extends StatelessWidget {
bottom: 8,
left: 8,
child: Material(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
@@ -346,13 +371,13 @@ class GiphyAttachment extends StatelessWidget {
child: Row(
children: [
StreamSvgIcon.lightning(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
size: 16,
),
Text(
'GIPHY',
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
fontWeight: FontWeight.bold,
fontSize: 11,
),
+21 -8
View File
@@ -34,7 +34,7 @@ class ImageActionsModal extends StatelessWidget {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.black.withOpacity(0.8),
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.8),
Colors.transparent,
],
stops: [0.0, 0.4],
@@ -69,7 +69,9 @@ class ImageActionsModal extends StatelessWidget {
style: StreamChatTheme.of(context)
.textTheme
.headlineBold
.copyWith(color: Colors.white),
.copyWith(
color:
StreamChatTheme.of(context).colorTheme.white),
),
),
Text(
@@ -77,14 +79,18 @@ class ImageActionsModal extends StatelessWidget {
style: StreamChatTheme.of(context)
.channelPreviewTheme
.subtitle
.copyWith(color: Colors.white.withOpacity(0.5)),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.5)),
),
],
),
IconButton(
icon: StreamSvgIcon.close(
size: 24.0,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
onPressed: () {
Navigator.pop(context);
@@ -114,7 +120,10 @@ class ImageActionsModal extends StatelessWidget {
'Reply',
StreamSvgIcon.Icon_curve_line_left_up(
size: 24.0,
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
() {}),
_buildButton(
@@ -122,7 +131,8 @@ class ImageActionsModal extends StatelessWidget {
'Show in Chat',
StreamSvgIcon.eye(
size: 24.0,
color: Colors.black,
color:
StreamChatTheme.of(context).colorTheme.black,
), () {
Navigator.pop(context);
Navigator.pop(context);
@@ -132,7 +142,10 @@ class ImageActionsModal extends StatelessWidget {
'Save ${urls[currentIndex].type == 'video' ? 'Video' : 'Image'}',
StreamSvgIcon.Icon_save(
size: 24.0,
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
), () async {
var url = urls[currentIndex].imageUrl ??
urls[currentIndex].assetUrl ??
@@ -181,7 +194,7 @@ class ImageActionsModal extends StatelessWidget {
{Color color}) {
var titleStyle = TextStyle(
fontSize: 14.5,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
);
return Material(
+33 -18
View File
@@ -114,7 +114,7 @@ class _ImageFooterState extends State<ImageFooter> {
IconButton(
icon: StreamSvgIcon.icon_SHARE(
size: 24.0,
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
_buildShareModal(context);
@@ -138,7 +138,7 @@ class _ImageFooterState extends State<ImageFooter> {
),
IconButton(
icon: StreamSvgIcon.Icon_grid(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
_buildPhotosModal(context);
@@ -166,7 +166,7 @@ class _ImageFooterState extends State<ImageFooter> {
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.0),
topLeft: Radius.circular(16.0),
@@ -187,7 +187,7 @@ class _ImageFooterState extends State<ImageFooter> {
alignment: Alignment.centerRight,
child: IconButton(
icon: StreamSvgIcon.close(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
Navigator.pop(context);
@@ -198,7 +198,7 @@ class _ImageFooterState extends State<ImageFooter> {
),
),
Container(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@@ -346,7 +346,7 @@ class _ImageFooterState extends State<ImageFooter> {
Align(
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
height: 48.0,
child: Material(
child: InkWell(
@@ -415,7 +415,7 @@ class _ImageFooterState extends State<ImageFooter> {
Expanded(
child: TextField(
controller: _searchController,
cursorColor: Colors.black,
cursorColor: StreamChatTheme.of(context).colorTheme.black,
autofocus: true,
decoration: InputDecoration(
isDense: true,
@@ -425,19 +425,25 @@ class _ImageFooterState extends State<ImageFooter> {
padding: const EdgeInsets.symmetric(
vertical: 2.0, horizontal: 6.0),
child: StreamSvgIcon.search(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
),
hintText: 'Search',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0),
borderSide:
BorderSide(color: Colors.black.withOpacity(0.08)),
borderSide: BorderSide(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.08)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0),
borderSide:
BorderSide(color: Colors.black.withOpacity(0.08)),
borderSide: BorderSide(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.08)),
),
contentPadding: EdgeInsets.zero,
),
@@ -448,7 +454,10 @@ class _ImageFooterState extends State<ImageFooter> {
),
IconButton(
icon: StreamSvgIcon.close_small(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
onPressed: () {
modalSetState(() {
@@ -469,7 +478,7 @@ class _ImageFooterState extends State<ImageFooter> {
padding: const EdgeInsets.symmetric(horizontal: 6.0),
child: IconButton(
icon: StreamSvgIcon.search(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
iconSize: 24.0,
onPressed: () {
@@ -490,7 +499,7 @@ class _ImageFooterState extends State<ImageFooter> {
padding: const EdgeInsets.symmetric(horizontal: 6.0),
child: IconButton(
icon: StreamSvgIcon.share_arrow(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () async {
var url =
@@ -517,7 +526,7 @@ class _ImageFooterState extends State<ImageFooter> {
return Align(
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
height: 56.0,
child: _loading
? Center(
@@ -547,13 +556,19 @@ class _ImageFooterState extends State<ImageFooter> {
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0),
borderSide: BorderSide(
color: Colors.black.withOpacity(0.16),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.16),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0),
borderSide: BorderSide(
color: Colors.black.withOpacity(0.16),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.16),
)),
contentPadding: EdgeInsets.symmetric(vertical: 12.0),
),
+3 -1
View File
@@ -83,7 +83,9 @@ class ImageGroup extends StatelessWidget {
child: Text(
'${images.length - 4} +',
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
fontSize: 28,
),
),
+2 -2
View File
@@ -50,7 +50,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
leading: showBackButton
? IconButton(
icon: StreamSvgIcon.close(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
onPressed: onBackPressed,
@@ -61,7 +61,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
actions: <Widget>[
IconButton(
icon: StreamSvgIcon.Icon_menu_point_v(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
_showMessageActionModalBottomSheet(context);
+11 -4
View File
@@ -6,6 +6,8 @@ import 'package:stream_chat_flutter/src/lazy_load_scroll_view.dart';
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
import 'dart:ui' as ui;
import '../stream_chat_flutter.dart';
extension on Duration {
String format() {
final s = '$this'.split('.')[0].padLeft(8, '0');
@@ -80,7 +82,10 @@ class _MediaListViewState extends State<MediaListView> {
? 1.0
: 0.0,
child: Container(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
alignment: Alignment.topRight,
padding: const EdgeInsets.only(
top: 8,
@@ -88,10 +93,12 @@ class _MediaListViewState extends State<MediaListView> {
),
child: CircleAvatar(
radius: 12,
backgroundColor: Colors.white,
backgroundColor:
StreamChatTheme.of(context).colorTheme.white,
child: StreamSvgIcon.check(
size: 24,
color: Colors.black,
color:
StreamChatTheme.of(context).colorTheme.black,
),
),
),
@@ -113,7 +120,7 @@ class _MediaListViewState extends State<MediaListView> {
child: Text(
media.videoDuration.format(),
style: TextStyle(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+4 -1
View File
@@ -69,7 +69,10 @@ class MessageActionsModal extends StatelessWidget {
sigmaY: 10.8731,
),
child: Container(
color: Colors.black.withOpacity(0.1),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.1),
),
),
),
+52 -22
View File
@@ -263,7 +263,10 @@ class MessageInputState extends State<MessageInput> {
border: _sendAsDm
? null
: Border.all(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
width: 2,
),
borderRadius: BorderRadius.circular(3),
@@ -273,7 +276,7 @@ class MessageInputState extends State<MessageInput> {
borderRadius: BorderRadius.circular(3),
color: _sendAsDm
? StreamChatTheme.of(context).accentColor
: Colors.white,
: StreamChatTheme.of(context).colorTheme.white,
child: InkWell(
onTap: () {
setState(() {
@@ -288,7 +291,7 @@ class MessageInputState extends State<MessageInput> {
: CrossFadeState.showSecond,
firstChild: StreamSvgIcon.check(
size: 16.0,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
secondChild: SizedBox(
height: 16,
@@ -418,7 +421,9 @@ class MessageInputState extends State<MessageInput> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
StreamSvgIcon.lightning(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
size: 16.0,
),
Text(
@@ -426,7 +431,10 @@ class MessageInputState extends State<MessageInput> {
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.white),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.white),
),
],
),
@@ -633,7 +641,10 @@ class MessageInputState extends State<MessageInput> {
Text(
'Instant Commands',
style: TextStyle(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
)
],
@@ -664,7 +675,9 @@ class MessageInputState extends State<MessageInput> {
backgroundColor:
StreamChatTheme.of(context).accentColor,
child: StreamSvgIcon.lightning(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
size: 12.5,
),
maxRadius: 12,
@@ -698,24 +711,33 @@ class MessageInputState extends State<MessageInput> {
? StreamChatTheme.of(context).accentColor
: (!_attachmentContainsFile
? StreamChatTheme.of(context).accentColor
: Colors.black.withOpacity(0.2));
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.2));
break;
case 1:
return _attachmentContainsFile
? StreamChatTheme.of(context).accentColor
: (_attachments.isEmpty
? Colors.black.withOpacity(0.5)
: Colors.black.withOpacity(0.2));
? StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.2));
break;
case 2:
return _attachmentContainsFile && _attachments.isNotEmpty
? Colors.black.withOpacity(0.2)
: Colors.black.withOpacity(0.5);
? StreamChatTheme.of(context).colorTheme.black.withOpacity(0.2)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5);
break;
case 3:
return _attachmentContainsFile && _attachments.isNotEmpty
? Colors.black.withOpacity(0.2)
: Colors.black.withOpacity(0.5);
? StreamChatTheme.of(context).colorTheme.black.withOpacity(0.2)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5);
break;
}
}
@@ -791,7 +813,7 @@ class MessageInputState extends State<MessageInput> {
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
@@ -820,7 +842,7 @@ class MessageInputState extends State<MessageInput> {
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.circular(8.0),
),
child: _buildPickerSection(),
@@ -1023,7 +1045,7 @@ class MessageInputState extends State<MessageInput> {
CircleAvatar _buildGiphyIcon() {
if (kIsWeb) {
return CircleAvatar(
backgroundColor: Colors.black,
backgroundColor: StreamChatTheme.of(context).colorTheme.black,
child: Image.asset(
'images/giphy_icon.png',
package: 'stream_chat_flutter',
@@ -1223,7 +1245,10 @@ class MessageInputState extends State<MessageInput> {
child: Text(
'Emoji matching "$query"',
style: TextStyle(
color: Colors.black.withOpacity(.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
),
)
@@ -1317,10 +1342,15 @@ class MessageInputState extends State<MessageInput> {
child: InkWell(
child: CircleAvatar(
backgroundColor:
Colors.black.withOpacity(0.2),
StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.2),
maxRadius: 12.0,
child: StreamSvgIcon.close(
color: Colors.white,
color: StreamChatTheme.of(context)
.colorTheme
.white,
),
),
onTap: () {
@@ -1405,11 +1435,11 @@ class MessageInputState extends State<MessageInput> {
_attachments.remove(attachment);
});
},
fillColor: Colors.black.withOpacity(.5),
fillColor: StreamChatTheme.of(context).colorTheme.black.withOpacity(.5),
child: Center(
child: StreamSvgIcon.close(
size: 24,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+7 -3
View File
@@ -254,7 +254,11 @@ class _MessageListViewState extends State<MessageListView> {
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(.5)),
.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5)),
),
);
}
@@ -524,9 +528,9 @@ class _MessageListViewState extends State<MessageListView> {
clipBehavior: Clip.none,
children: [
FloatingActionButton(
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
child: StreamSvgIcon.down(
color: Colors.black,
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
if (unreadCount > 0) {
+4 -1
View File
@@ -60,7 +60,10 @@ class MessageReactionsModal extends StatelessWidget {
sigmaY: 10.8731,
),
child: Container(
color: Colors.black.withOpacity(0.1),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.1),
),
),
),
+15 -5
View File
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:stream_chat/stream_chat.dart';
import 'package:stream_chat_flutter/src/message_search_item.dart';
import '../stream_chat_flutter.dart';
import 'lazy_load_scroll_view.dart';
import 'message_search_bloc.dart';
@@ -127,8 +128,8 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
return Container(
height: 1,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(0.1)
: Colors.black.withOpacity(0.1),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(0.1)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.1),
);
}
@@ -313,8 +314,14 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.black.withOpacity(0.02),
Colors.white.withOpacity(0.05),
StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.02),
StreamChatTheme.of(context)
.colorTheme
.white
.withOpacity(0.05),
],
stops: [0, 1],
),
@@ -327,7 +334,10 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
child: Text(
'${items.length} results',
style: TextStyle(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
),
),
),
+24 -16
View File
@@ -327,10 +327,16 @@ class _MessageWidgetState extends State<MessageWidget> {
.brightness ==
Brightness
.dark
? Colors.white
? StreamChatTheme.of(
context)
.colorTheme
.white
.withAlpha(
24)
: Colors.black
: StreamChatTheme.of(
context)
.colorTheme
.black
.withAlpha(
24),
),
@@ -414,16 +420,18 @@ class _MessageWidgetState extends State<MessageWidget> {
mainAxisSize: MainAxisSize.min,
children: [
StreamSvgIcon.eye(
color: Colors.black.withOpacity(0.5),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.5),
size: 16.0,
),
SizedBox(width: 8.0),
Text(
'Only visible to you',
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(0.5)),
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5)),
),
],
),
@@ -551,7 +559,7 @@ class _MessageWidgetState extends State<MessageWidget> {
bottom: 0,
top: 0,
child: Material(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
clipBehavior: Clip.antiAlias,
shape: CircleBorder(),
child: Padding(
@@ -664,8 +672,8 @@ class _MessageWidgetState extends State<MessageWidget> {
widget.borderSide ??
BorderSide(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withAlpha(24)
: Colors.black.withAlpha(24),
? StreamChatTheme.of(context).colorTheme.white.withAlpha(24)
: StreamChatTheme.of(context).colorTheme.black.withAlpha(24),
),
borderRadius: widget.attachmentBorderRadiusGeometry ??
widget.borderRadiusGeometry ??
@@ -820,8 +828,8 @@ class _MessageWidgetState extends State<MessageWidget> {
'MESSAGE FAILED · CLICK TO TRY AGAIN',
style: widget.messageTheme.messageText.copyWith(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(.5)
: Colors.black.withOpacity(.5),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(.5)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(.5),
fontSize: 11,
),
);
@@ -831,8 +839,8 @@ class _MessageWidgetState extends State<MessageWidget> {
'MESSAGE UPDATE FAILED · CLICK TO TRY AGAIN',
style: widget.messageTheme.messageText.copyWith(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(.5)
: Colors.black.withOpacity(.5),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(.5)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(.5),
fontSize: 11,
),
);
@@ -842,8 +850,8 @@ class _MessageWidgetState extends State<MessageWidget> {
'MESSAGE DELETE FAILED · CLICK TO TRY AGAIN',
style: widget.messageTheme.messageText.copyWith(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(.5)
: Colors.black.withOpacity(.5),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(.5)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(.5),
fontSize: 11,
),
);
+8 -2
View File
@@ -108,7 +108,10 @@ class ReactionBubble extends StatelessWidget {
color: (!highlightOwnReactions ||
reaction.user.id == StreamChat.of(context).user.id)
? StreamChatTheme.of(context).accentColor
: Colors.black.withOpacity(.5),
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
)
: Icon(
Icons.help_outline_rounded,
@@ -116,7 +119,10 @@ class ReactionBubble extends StatelessWidget {
color: (!highlightOwnReactions ||
reaction.user.id == StreamChat.of(context).user.id)
? StreamChatTheme.of(context).accentColor
: Colors.black.withOpacity(.5),
: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(.5),
),
);
}
+1 -1
View File
@@ -254,7 +254,7 @@ class StreamChatThemeData {
colorTheme: colorTheme,
secondaryColor: Color(0xffEAEAEA),
accentColor: accentColor,
primaryColor: isDark ? Colors.black : Colors.white,
primaryColor: isDark ? colorTheme.black : colorTheme.white,
primaryIconTheme: IconThemeData(
color: isDark ? Colors.white : Colors.black.withOpacity(.5)),
defaultChannelImage: (context, channel) => SizedBox(),
+1 -1
View File
@@ -34,7 +34,7 @@ class UnreadIndicator extends StatelessWidget {
'${snapshot.data}',
style: TextStyle(
fontSize: 11,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+1 -1
View File
@@ -99,7 +99,7 @@ class UserAvatar extends StatelessWidget {
color: Color(0xff20E070),
),
),
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
),
),
+3 -5
View File
@@ -76,7 +76,7 @@ class UserItem extends StatelessWidget {
? CircleAvatar(
child: StreamSvgIcon.check(
size: 20,
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
),
radius: 10,
)
@@ -94,10 +94,8 @@ class UserItem extends StatelessWidget {
user.online == true
? 'Online'
: 'Last online ${Jiffy(user.lastActive).fromNow()}',
style: StreamChatTheme.of(context)
.textTheme
.footnote
.copyWith(color: Colors.black.withOpacity(.5)),
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
color: StreamChatTheme.of(context).colorTheme.black.withOpacity(.5)),
);
}
}
+8 -4
View File
@@ -356,7 +356,8 @@ class _UserListViewState extends State<UserListView>
headerItem: (header) {
return Container(
key: ValueKey<String>('HEADER-$header'),
color: Colors.black.withOpacity(0.05),
color:
StreamChatTheme.of(context).colorTheme.black.withOpacity(0.05),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 6),
child: Text(
@@ -364,7 +365,10 @@ class _UserListViewState extends State<UserListView>
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.5,
color: Colors.black.withOpacity(0.3)),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.3)),
),
),
);
@@ -472,8 +476,8 @@ class _UserListViewState extends State<UserListView>
return Container(
height: 1,
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withOpacity(0.1)
: Colors.black.withOpacity(0.1),
? StreamChatTheme.of(context).colorTheme.white.withOpacity(0.1)
: StreamChatTheme.of(context).colorTheme.black.withOpacity(0.1),
);
}
+5 -2
View File
@@ -25,7 +25,7 @@ Future<bool> showConfirmationDialog(
String cancelText,
}) {
return showModalBottomSheet(
backgroundColor: Colors.white,
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
@@ -65,7 +65,10 @@ Future<bool> showConfirmationDialog(
child: Text(
cancelText,
style: TextStyle(
color: Colors.black.withOpacity(0.5),
color: StreamChatTheme.of(context)
.colorTheme
.black
.withOpacity(0.5),
fontWeight: FontWeight.w400),
),
onPressed: () {