Merge branch 'feature/new-ui' into hotfix/media-picker
This commit is contained in:
@@ -7,6 +7,8 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import 'main.dart';
|
||||
import 'notifications_service.dart';
|
||||
import 'choose_user_page.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
||||
class AdvancedOptionsPage extends StatefulWidget {
|
||||
@override
|
||||
@@ -44,8 +46,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
||||
),
|
||||
),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.left,
|
||||
icon: StreamSvgIcon.left(
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -286,6 +287,20 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
||||
if (!kIsWeb) {
|
||||
initNotifications(client);
|
||||
}
|
||||
|
||||
final secureStorage = FlutterSecureStorage();
|
||||
secureStorage.write(
|
||||
key: kStreamApiKey,
|
||||
value: apiKey,
|
||||
);
|
||||
secureStorage.write(
|
||||
key: kStreamUserId,
|
||||
value: userId,
|
||||
);
|
||||
secureStorage.write(
|
||||
key: kStreamToken,
|
||||
value: userToken,
|
||||
);
|
||||
} catch (e) {
|
||||
var errorText = 'Error connecting, retry';
|
||||
if (e is Map) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_icons.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
typedef ChipBuilder<T> = Widget Function(BuildContext context, T chip);
|
||||
typedef OnChipAdded<T> = void Function(T chip);
|
||||
@@ -130,13 +130,15 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
_chips.isEmpty
|
||||
? StreamIcons.user
|
||||
: StreamIcons.user_add,
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
size: 24,
|
||||
),
|
||||
icon: _chips.isEmpty
|
||||
? StreamSvgIcon.user(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
size: 24,
|
||||
)
|
||||
: StreamSvgIcon.userAdd(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
size: 24,
|
||||
),
|
||||
onPressed:
|
||||
!_pauseItemAddition ? null : resumeItemAddition,
|
||||
alignment: Alignment.topRight,
|
||||
|
||||
@@ -132,7 +132,7 @@ class ChooseUserPage extends StatelessWidget {
|
||||
|
||||
final secureStorage = FlutterSecureStorage();
|
||||
final client = StreamChat.of(context).client;
|
||||
|
||||
client.apiKey = kDefaultStreamApiKey;
|
||||
await client.setUser(
|
||||
user,
|
||||
token,
|
||||
@@ -196,8 +196,7 @@ class ChooseUserPage extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
leading: CircleAvatar(
|
||||
child: Icon(
|
||||
StreamIcons.settings,
|
||||
child: StreamSvgIcon.settings(
|
||||
color: Colors.black,
|
||||
),
|
||||
backgroundColor:
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'main.dart';
|
||||
import 'neumorphic_button.dart';
|
||||
|
||||
class GroupChatDetailsScreen extends StatefulWidget {
|
||||
final List<User> selectedUsers;
|
||||
@@ -103,11 +102,13 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
NeumorphicButton(
|
||||
StreamNeumorphicButton(
|
||||
child: IconButton(
|
||||
padding: const EdgeInsets.all(0),
|
||||
icon: Icon(StreamIcons.check),
|
||||
color: Color(0xFF006CFF),
|
||||
icon: StreamSvgIcon.check(
|
||||
size: 24,
|
||||
color: _isGroupNameEmpty ? Colors.grey : Color(0xFF006CFF),
|
||||
),
|
||||
onPressed: _isGroupNameEmpty
|
||||
? null
|
||||
: () async {
|
||||
|
||||
+17
-9
@@ -69,12 +69,14 @@ class ChannelListPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final user = StreamChat.of(context).user;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
title: Text(
|
||||
'Stream Chat',
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
appBar: ChannelListHeader(
|
||||
onNewChatButtonTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NewChatScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
drawer: _buildDrawer(context, user),
|
||||
drawerEdgeDragWidth: 50,
|
||||
@@ -141,7 +143,9 @@ class ChannelListPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(StreamIcons.edit),
|
||||
leading: StreamSvgIcon.penWrite(
|
||||
color: Colors.black.withOpacity(.5),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
..pop()
|
||||
@@ -157,7 +161,9 @@ class ChannelListPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(StreamIcons.group),
|
||||
leading: StreamSvgIcon.contacts(
|
||||
color: Colors.black.withOpacity(.5),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
..pop()
|
||||
@@ -189,7 +195,9 @@ class ChannelListPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
leading: Icon(StreamIcons.user),
|
||||
leading: StreamSvgIcon.user(
|
||||
color: Colors.black.withOpacity(.5),
|
||||
),
|
||||
title: Text(
|
||||
'Sign out',
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NeumorphicButton extends StatelessWidget {
|
||||
final Widget child;
|
||||
final Color backgroundColor;
|
||||
|
||||
const NeumorphicButton({
|
||||
Key key,
|
||||
@required this.child,
|
||||
this.backgroundColor = Colors.white,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: child,
|
||||
margin: EdgeInsets.all(8.0),
|
||||
height: 40,
|
||||
width: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey[700],
|
||||
offset: Offset(0, 1.0),
|
||||
blurRadius: 0.5,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
BoxShadow(
|
||||
color: Colors.white,
|
||||
offset: Offset.zero,
|
||||
blurRadius: 0.5,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import 'chips_input_text_field.dart';
|
||||
import 'main.dart';
|
||||
import 'neumorphic_button.dart';
|
||||
import 'new_group_chat_screen.dart';
|
||||
|
||||
class NewChatScreen extends StatefulWidget {
|
||||
@@ -164,8 +163,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
child: Icon(
|
||||
StreamIcons.close,
|
||||
child: StreamSvgIcon.close(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@@ -193,10 +191,12 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
NeumorphicButton(
|
||||
child: Icon(
|
||||
StreamIcons.group,
|
||||
color: Color(0xFF006CFF),
|
||||
StreamNeumorphicButton(
|
||||
child: Center(
|
||||
child: StreamSvgIcon.contacts(
|
||||
color: Color(0xFF006CFF),
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
@@ -289,8 +289,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Icon(
|
||||
StreamIcons.search,
|
||||
child: StreamSvgIcon.search(
|
||||
size: 96,
|
||||
color: Colors.grey,
|
||||
),
|
||||
|
||||
@@ -65,8 +65,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
actions: [
|
||||
if (_selectedUsers.isNotEmpty)
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.arrow_right,
|
||||
icon: StreamSvgIcon.right(
|
||||
color: Color(0xFF006CFF),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -101,10 +100,21 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
child: TextField(
|
||||
controller: _controller,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Icon(
|
||||
StreamIcons.search,
|
||||
color: Colors.black,
|
||||
size: 24,
|
||||
prefixIconConstraints: BoxConstraints.tight(
|
||||
Size(
|
||||
40,
|
||||
24,
|
||||
),
|
||||
),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8,
|
||||
right: 8,
|
||||
),
|
||||
child: StreamSvgIcon.search(
|
||||
color: Colors.black,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
hintText: 'Search',
|
||||
hintStyle: TextStyle(
|
||||
@@ -162,8 +172,8 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Icon(
|
||||
StreamIcons.close,
|
||||
child: StreamSvgIcon.close(
|
||||
color: Colors.black,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
@@ -260,8 +270,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Icon(
|
||||
StreamIcons.search,
|
||||
child: StreamSvgIcon.search(
|
||||
size: 96,
|
||||
color: Colors.grey,
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: example
|
||||
description: A new Flutter project.
|
||||
version: 1.0.70+72
|
||||
version: 1.0.76+78
|
||||
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user