[NewChatScreen] Add create group button, Finishing touches
This commit is contained in:
@@ -64,7 +64,7 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return Material(
|
||||||
elevation: 4,
|
elevation: 2,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
+27
-1
@@ -9,6 +9,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
|
|
||||||
import 'chips_input_text_field.dart';
|
import 'chips_input_text_field.dart';
|
||||||
import 'notifications_service.dart';
|
import 'notifications_service.dart';
|
||||||
|
import 'neumorphic_button.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@@ -487,9 +488,34 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
setState(() => _selectedUsers.remove(user));
|
setState(() => _selectedUsers.remove(user));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
if (!_isSearchActive)
|
||||||
|
Container(
|
||||||
|
color: Colors.white54,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
NeumorphicButton(
|
||||||
|
child: Icon(
|
||||||
|
StreamIcons.group,
|
||||||
|
color: Colors.blue.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Create a Group',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
color: Colors.white54,
|
color: Colors.grey.shade50,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 8,
|
vertical: 8,
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
extension ColorUtils on Color {
|
||||||
|
Color mix(Color another, double amount) {
|
||||||
|
return Color.lerp(this, another, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NeumorphicButton extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final Color backgroundColor;
|
||||||
|
final EdgeInsets margin;
|
||||||
|
final EdgeInsets padding;
|
||||||
|
|
||||||
|
const NeumorphicButton({
|
||||||
|
Key key,
|
||||||
|
@required this.child,
|
||||||
|
this.backgroundColor = Colors.white,
|
||||||
|
this.margin = const EdgeInsets.all(8),
|
||||||
|
this.padding = const EdgeInsets.all(14),
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: child,
|
||||||
|
margin: margin,
|
||||||
|
padding: padding,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: backgroundColor,
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
backgroundColor.mix(Colors.white, 0.2),
|
||||||
|
backgroundColor.mix(Colors.black, 0.1),
|
||||||
|
]),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
blurRadius: 1,
|
||||||
|
color: backgroundColor.mix(Colors.white, 0.6),
|
||||||
|
),
|
||||||
|
BoxShadow(
|
||||||
|
blurRadius: 1,
|
||||||
|
color: backgroundColor.mix(Colors.black, 0.3),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user