feat: commands ui

This commit is contained in:
Deven Joshi
2020-10-23 16:58:28 +05:30
parent 00828eb0e2
commit e58b051bfa
3 changed files with 17 additions and 5 deletions
+2
View File
@@ -1,6 +1,8 @@
include: package:pedantic/analysis_options.yaml include: package:pedantic/analysis_options.yaml
analyzer: analyzer:
enable-experiment:
- extension-methods
exclude: exclude:
- lib/**/*.g.dart - lib/**/*.g.dart
- example/** - example/**
+14 -4
View File
@@ -417,7 +417,7 @@ class MessageInputState extends State<MessageInput> {
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.only(left: 8.0, top: 8.0),
child: Row( child: Row(
children: [ children: [
Padding( Padding(
@@ -433,11 +433,11 @@ class MessageInputState extends State<MessageInput> {
(c) => ListTile( (c) => ListTile(
title: Text.rich( title: Text.rich(
TextSpan( TextSpan(
text: '${c.name}', text: '${c.name.capitalize()}',
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
children: [ children: [
TextSpan( TextSpan(
text: ' ${c.args}', text: ' /${c.name} ${c.args}',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
@@ -445,7 +445,11 @@ class MessageInputState extends State<MessageInput> {
], ],
), ),
), ),
subtitle: Text(c.description), trailing: CircleAvatar(
backgroundColor: StreamChatTheme.of(context).accentColor,
child: Icon(StreamIcons.lightning, color: Colors.white,),
),
//subtitle: Text(c.description),
onTap: () { onTap: () {
_setCommand(c); _setCommand(c);
}, },
@@ -1139,3 +1143,9 @@ class _SendingAttachment {
this.uploaded = false, this.uploaded = false,
}); });
} }
extension StringExtension on String {
String capitalize() {
return "${this[0].toUpperCase()}${this.substring(1)}";
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
environment: environment:
sdk: ">=2.3.0 <3.0.0" sdk: ">=2.6.0 <3.0.0"
dependencies: dependencies:
flutter: flutter: