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