From 3a64d58d23dec9a88cc87906e750f8c44edd266e Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 3 Jan 2020 11:57:00 +0100 Subject: [PATCH] More fixes and new version --- lib/components/avatar.dart | 2 +- lib/components/content_banner.dart | 2 +- lib/components/list_items/chat_list_item.dart | 4 ++-- lib/components/list_items/message.dart | 6 ++++-- .../list_items/participant_list_item.dart | 4 ++-- lib/components/list_items/state_message.dart | 13 ++++++++----- lib/main.dart | 1 + lib/views/chat_details.dart | 8 ++++++-- lib/views/chat_list.dart | 5 +++-- lib/views/login.dart | 2 +- lib/views/settings.dart | 2 +- pubspec.yaml | 2 +- 12 files changed, 31 insertions(+), 20 deletions(-) diff --git a/lib/components/avatar.dart b/lib/components/avatar.dart index 1ca495be..3ae49cdf 100644 --- a/lib/components/avatar.dart +++ b/lib/components/avatar.dart @@ -30,7 +30,7 @@ class Avatar extends StatelessWidget { src, ) : null, - backgroundColor: Color(0xFFF8F8F8), + backgroundColor: Theme.of(context).secondaryHeaderColor, child: mxContent.mxc.isEmpty ? Text("@", style: TextStyle(color: Colors.blueGrey)) : null, diff --git a/lib/components/content_banner.dart b/lib/components/content_banner.dart index 44804890..2ee86eb4 100644 --- a/lib/components/content_banner.dart +++ b/lib/components/content_banner.dart @@ -31,7 +31,7 @@ class ContentBanner extends StatelessWidget { ); return Container( height: 200, - color: Color(0xFFF8F8F8), + color: Theme.of(context).secondaryHeaderColor, child: !loading ? mxContent.mxc?.isNotEmpty ?? false ? kIsWeb diff --git a/lib/components/list_items/chat_list_item.dart b/lib/components/list_items/chat_list_item.dart index 97dc67f0..fbd47f83 100644 --- a/lib/components/list_items/chat_list_item.dart +++ b/lib/components/list_items/chat_list_item.dart @@ -50,7 +50,7 @@ class ChatListItem extends StatelessWidget { decoration: BoxDecoration( color: room.highlightCount > 0 ? Colors.red - : Color(0xFF5625BA), + : Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(20), ), child: Center( @@ -91,7 +91,7 @@ class ChatListItem extends StatelessWidget { decoration: BoxDecoration( color: room.highlightCount > 0 ? Colors.red - : Color(0xFF5625BA), + : Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(20), ), child: Center( diff --git a/lib/components/list_items/message.dart b/lib/components/list_items/message.dart index abf365db..47ceb0ad 100644 --- a/lib/components/list_items/message.dart +++ b/lib/components/list_items/message.dart @@ -21,14 +21,16 @@ class Message extends StatelessWidget { Client client = Matrix.of(context).client; final bool ownMessage = event.senderId == client.userID; Alignment alignment = ownMessage ? Alignment.topRight : Alignment.topLeft; - Color color = Color(0xFFF8F8F8); + Color color = Theme.of(context).secondaryHeaderColor; BubbleNip nip = ownMessage ? BubbleNip.rightBottom : BubbleNip.leftBottom; final Color textColor = ownMessage ? Colors.white : Colors.black; MainAxisAlignment rowMainAxisAlignment = ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start; if (ownMessage) { - color = event.status == -1 ? Colors.redAccent : Color(0xFF5625BA); + color = event.status == -1 + ? Colors.redAccent + : Theme.of(context).primaryColor; } List> popupMenuList = []; if (event.canRedact && !event.redacted && event.status > 1) { diff --git a/lib/components/list_items/participant_list_item.dart b/lib/components/list_items/participant_list_item.dart index cf614a71..5ef78f89 100644 --- a/lib/components/list_items/participant_list_item.dart +++ b/lib/components/list_items/participant_list_item.dart @@ -97,7 +97,7 @@ class ParticipantListItem extends StatelessWidget { padding: EdgeInsets.all(4), margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( - color: Color(0xFFF8F8F8), + color: Theme.of(context).secondaryHeaderColor, borderRadius: BorderRadius.circular(8), ), child: Center(child: Text(permissionBatch)), @@ -108,7 +108,7 @@ class ParticipantListItem extends StatelessWidget { padding: EdgeInsets.all(4), margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( - color: Color(0xFFF8F8F8), + color: Theme.of(context).secondaryHeaderColor, borderRadius: BorderRadius.circular(8), ), child: diff --git a/lib/components/list_items/state_message.dart b/lib/components/list_items/state_message.dart index 15c9341c..8dcc715e 100644 --- a/lib/components/list_items/state_message.dart +++ b/lib/components/list_items/state_message.dart @@ -12,11 +12,14 @@ class StateMessage extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(8.0), - child: Bubble( - color: Color(0xFFF8F8F8), - elevation: 0, - alignment: Alignment.center, - child: MessageContent(event), + child: Opacity( + opacity: 0.66, + child: Bubble( + color: Colors.black, + elevation: 0, + alignment: Alignment.center, + child: MessageContent(event, textColor: Colors.white), + ), ), ); } diff --git a/lib/main.dart b/lib/main.dart index 426dc70c..39784068 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -24,6 +24,7 @@ class App extends StatelessWidget { brightness: Brightness.light, primaryColor: Color(0xFF5625BA), backgroundColor: Colors.white, + secondaryHeaderColor: Color(0xFFF2F2F2), scaffoldBackgroundColor: Colors.white, dialogTheme: DialogTheme( shape: RoundedRectangleBorder( diff --git a/lib/views/chat_details.dart b/lib/views/chat_details.dart index e2e79e9b..0d992111 100644 --- a/lib/views/chat_details.dart +++ b/lib/views/chat_details.dart @@ -122,7 +122,9 @@ class _ChatDetailsState extends State { Row( children: [ Expanded( - child: Container(height: 8, color: Color(0xFFF8F8F8)), + child: Container( + height: 8, + color: Theme.of(context).secondaryHeaderColor), ), SizedBox(width: 8), Text( @@ -133,7 +135,9 @@ class _ChatDetailsState extends State { ), SizedBox(width: 8), Expanded( - child: Container(height: 8, color: Color(0xFFF8F8F8)), + child: Container( + height: 8, + color: Theme.of(context).secondaryHeaderColor), ), ], ), diff --git a/lib/views/chat_list.dart b/lib/views/chat_list.dart index 43279520..32cc0a52 100644 --- a/lib/views/chat_list.dart +++ b/lib/views/chat_list.dart @@ -19,7 +19,8 @@ class ChatListView extends StatelessWidget { firstScaffold: ChatList(), secondScaffold: Scaffold( body: Center( - child: Icon(Icons.chat, size: 100, color: Color(0xFF5625BA)), + child: Icon(Icons.chat, + size: 100, color: Theme.of(context).primaryColor), ), ), ); @@ -119,7 +120,7 @@ class _ChatListState extends State { ), floatingActionButton: SpeedDial( child: Icon(Icons.add), - backgroundColor: Color(0xFF5625BA), + backgroundColor: Theme.of(context).primaryColor, children: [ SpeedDialChild( child: Icon(Icons.people_outline), diff --git a/lib/views/login.dart b/lib/views/login.dart index 43eab170..e7876acc 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -125,7 +125,7 @@ class _LoginPageState extends State { end: Alignment.topRight, colors: [ Colors.blue, - Color(0xFF5625BA), + Theme.of(context).primaryColor, ], ), ), diff --git a/lib/views/settings.dart b/lib/views/settings.dart index 427885ba..33abf822 100644 --- a/lib/views/settings.dart +++ b/lib/views/settings.dart @@ -32,7 +32,7 @@ class _SettingsState extends State { void logoutAction(BuildContext context) async { await Navigator.of(context).pop(); MatrixState matrix = Matrix.of(context); - await matrix.tryRequestWithLoadingDialog(matrix.client.logout()); + await matrix.tryRequestWithErrorToast(matrix.client.logout()); matrix.clean(); } diff --git a/pubspec.yaml b/pubspec.yaml index a4933534..4be6480c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Chat with your friends. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.1.3+4 +version: 0.1.4+5 environment: sdk: ">=2.1.0 <3.0.0"