feat: added themes

This commit is contained in:
Deven Joshi
2020-12-31 18:01:55 +05:30
parent 1f99dcf398
commit 607a51daad
2 changed files with 26 additions and 28 deletions
+13 -20
View File
@@ -25,6 +25,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
var isOwner = userAsMember.role == 'owner';
return Material(
color: StreamChatTheme.of(context).colorTheme.white,
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
@@ -41,11 +42,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: ChannelName(
textStyle: TextStyle(
fontSize: 16.0,
color: Color(0xff000000),
fontWeight: FontWeight.bold,
),
textStyle: StreamChatTheme.of(context).textTheme.headlineBold,
),
),
SizedBox(
@@ -80,10 +77,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
.firstWhere((e) => e.user.id != userAsMember.user.id)
.user
.name,
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
),
style: StreamChatTheme.of(context).textTheme.footnoteBold,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -115,10 +109,9 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
),
Text(
members[index].user.name,
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
),
style: StreamChatTheme.of(context)
.textTheme
.footnoteBold,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -133,7 +126,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
),
OptionListTile(
leading: StreamSvgIcon.user(
color: Color(0xff7a7a7a),
color: StreamChatTheme.of(context).colorTheme.grey,
),
title: 'View Info',
onTap: widget.onViewInfoTap,
@@ -141,7 +134,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
if (!channel.isDistinct)
OptionListTile(
leading: StreamSvgIcon.userRemove(
color: Color(0xff7a7a7a),
color: StreamChatTheme.of(context).colorTheme.grey,
),
title: 'Leave Group',
onTap: () async {
@@ -151,17 +144,17 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
if (isOwner)
OptionListTile(
leading: StreamSvgIcon.delete(
color: Colors.red,
color: StreamChatTheme.of(context).colorTheme.accentRed,
),
title: 'Delete Conversation',
titleColor: Colors.red,
titleColor: StreamChatTheme.of(context).colorTheme.accentRed,
onTap: () async {
_showDeleteDialog();
},
),
OptionListTile(
leading: StreamSvgIcon.close_small(
color: Color(0xff7a7a7a),
color: StreamChatTheme.of(context).colorTheme.grey,
),
title: 'Cancel',
onTap: () {
@@ -181,7 +174,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
question: 'Are you sure you want to delete this conversation?',
cancelText: 'CANCEL',
icon: StreamSvgIcon.delete(
color: Colors.red,
color: StreamChatTheme.of(context).colorTheme.accentRed,
),
);
var channel = StreamChannel.of(context).channel;
@@ -199,7 +192,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
question: 'Are you sure you want to leave this conversation?',
cancelText: 'CANCEL',
icon: StreamSvgIcon.userRemove(
color: Colors.red,
color: StreamChatTheme.of(context).colorTheme.accentRed,
),
);
var channel = StreamChannel.of(context).channel;
+13 -8
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
class OptionListTile extends StatelessWidget {
@@ -21,13 +22,13 @@ class OptionListTile extends StatelessWidget {
return Column(
children: [
Container(
color: Color(0xffe6e6e6),
height: 2.0,
color: StreamChatTheme.of(context).colorTheme.greyGainsboro,
height: 1.0,
),
Material(
color: Colors.white,
color: StreamChatTheme.of(context).colorTheme.white,
child: Container(
height: 56.0,
height: 63.0,
child: InkWell(
onTap: onTap,
child: Row(
@@ -44,10 +45,14 @@ class OptionListTile extends StatelessWidget {
flex: 4,
child: Text(
title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: titleColor,
),
style: titleColor == null
? StreamChatTheme.of(context).textTheme.bodyBold
: StreamChatTheme.of(context)
.textTheme
.bodyBold
.copyWith(
color: titleColor,
),
),
),
Expanded(