From 67df1c2b7bbdc2989b0de777b76cc1d83fcc816d Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Date: Fri, 15 Oct 2021 11:43:40 +0500 Subject: [PATCH] logo updates and other changes --- .../lib/views/group/add_group_view.dart | 2 +- .../simplex_app/lib/views/home/drawer.dart | 59 +-------- .../simplex_app/lib/views/home/home_view.dart | 122 ++++++++++++------ .../scan_invitation/scan_invitation_view.dart | 10 +- .../simplex_app/lib/views/splash_screen.dart | 7 +- 5 files changed, 106 insertions(+), 94 deletions(-) diff --git a/packages/simplex_app/lib/views/group/add_group_view.dart b/packages/simplex_app/lib/views/group/add_group_view.dart index e55a8144fc..dc0d189556 100644 --- a/packages/simplex_app/lib/views/group/add_group_view.dart +++ b/packages/simplex_app/lib/views/group/add_group_view.dart @@ -217,7 +217,7 @@ class _AddGroupViewState extends State { leading: const CircleAvatar( backgroundImage: AssetImage('assets/dp.png'), ), - title: Text(_contactsList[index].name), + title: Text(_contactsList[index].name!), onTap: () { setState(() { _members.add(_contactsList[index].name); diff --git a/packages/simplex_app/lib/views/home/drawer.dart b/packages/simplex_app/lib/views/home/drawer.dart index 977353789a..432b4569ae 100644 --- a/packages/simplex_app/lib/views/home/drawer.dart +++ b/packages/simplex_app/lib/views/home/drawer.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:simplex_chat/constants.dart'; @@ -18,65 +19,19 @@ class MyDrawer extends StatelessWidget { return Column( children: [ const SizedBox(height: 30.0), - Image.asset( - 'assets/simpleX.png', - height: 85.0, + SvgPicture.asset( + 'assets/logo.svg', + height: 55.0, ), - const Divider(height: 50.0), + const Divider(height: 30.0), ListTile( - tileColor: _drawerProviders.currentIndex == 1 - ? kPrimaryColor - : Colors.transparent, - leading: Icon( - Icons.chat, - color: _drawerProviders.currentIndex == 1 - ? Colors.white - : Colors.grey, - ), - title: Text( - 'Conversations', - style: TextStyle( - color: _drawerProviders.currentIndex == 1 - ? Colors.white - : Colors.black, - ), - ), - onTap: () { - _drawerProviders.currentIndex = 1; - Navigator.pop(context); - }, - ), - ListTile( - tileColor: _drawerProviders.currentIndex == 2 - ? kPrimaryColor - : Colors.transparent, - leading: Icon( - Icons.insert_invitation, - color: _drawerProviders.currentIndex == 2 - ? Colors.white - : Colors.grey, - ), - title: Text( - 'Invitations', - style: TextStyle( - color: _drawerProviders.currentIndex == 2 - ? Colors.white - : Colors.black, - ), - ), + leading: const Icon(Icons.insert_invitation), + title: const Text('Invitations'), onTap: () { _drawerProviders.currentIndex = 2; Navigator.pop(context); }, ), - ListTile( - leading: const Icon( - Icons.settings, - color: Colors.grey, - ), - title: const Text('Settings'), - onTap: () {}, - ), const Spacer(), ListTile( leading: const Icon(Icons.refresh), diff --git a/packages/simplex_app/lib/views/home/home_view.dart b/packages/simplex_app/lib/views/home/home_view.dart index a7fe4bb5c2..1b3cbbe93d 100644 --- a/packages/simplex_app/lib/views/home/home_view.dart +++ b/packages/simplex_app/lib/views/home/home_view.dart @@ -70,49 +70,99 @@ class _HomeViewState extends State { }, child: const Padding( padding: EdgeInsets.all(8.0), - child: Icon(Icons.arrow_back), + child: Icon(Icons.arrow_back, color: kPrimaryColor), ), ), ) - : Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - InkWell( - onTap: () { - Scaffold.of(context).openDrawer(); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: SvgPicture.asset('assets/menu.svg'), - ), - ), - const Spacer(), - Column( + : _drawerProviders.currentIndex == 2 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Row( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text('Hi! $_displayName', - style: kSmallHeadingStyle), - const Text('Good day!'), + InkWell( + onTap: () { + _drawerProviders.currentIndex = 1; + }, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.arrow_back, + color: kPrimaryColor)), + ), + const Spacer(), + InkWell( + onTap: () {}, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon( + Icons.bug_report, + color: Colors.grey, + ), + )), + const SizedBox(width: 10.0), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text('Hi! $_displayName', + style: kSmallHeadingStyle), + const Text('Good day!'), + ], + ), + const SizedBox(width: 10.0), + GestureDetector( + onTap: () { + _drawerProviders.currentIndex = 0; + }, + child: CircleAvatar( + backgroundImage: _photo!.isEmpty + ? const AssetImage('assets/dp.png') + as ImageProvider + : FileImage(File(_photo!)), + ), + ) ], ), - const SizedBox(width: 10.0), - GestureDetector( - onTap: () { - _drawerProviders.currentIndex = 0; - }, - child: CircleAvatar( - backgroundImage: _photo!.isEmpty - ? const AssetImage('assets/dp.png') - as ImageProvider - : FileImage(File(_photo!)), - ), - ) - ], - ), - ), + ) + : Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + InkWell( + onTap: () { + Scaffold.of(context).openDrawer(); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset('assets/menu.svg'), + ), + ), + const Spacer(), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text('Hi! $_displayName', + style: kSmallHeadingStyle), + const Text('Good day!'), + ], + ), + const SizedBox(width: 10.0), + GestureDetector( + onTap: () { + _drawerProviders.currentIndex = 0; + }, + child: CircleAvatar( + backgroundImage: _photo!.isEmpty + ? const AssetImage('assets/dp.png') + as ImageProvider + : FileImage(File(_photo!)), + ), + ) + ], + ), + ), ], ); }), diff --git a/packages/simplex_app/lib/views/scan_invitation/scan_invitation_view.dart b/packages/simplex_app/lib/views/scan_invitation/scan_invitation_view.dart index 265ef8691e..85870a1b83 100644 --- a/packages/simplex_app/lib/views/scan_invitation/scan_invitation_view.dart +++ b/packages/simplex_app/lib/views/scan_invitation/scan_invitation_view.dart @@ -83,7 +83,10 @@ class ScanInvitationView extends StatelessWidget { CustomButton( width: 200, height: 40, - onPressed: () => Navigator.pop(context), + onPressed: () { + int _count = 0; + Navigator.popUntil(context, (route) => _count++ >= 2); + }, color: kPrimaryColor, child: const Text( 'Confirm', @@ -94,7 +97,10 @@ class ScanInvitationView extends StatelessWidget { CustomButton( width: 200, height: 40, - onPressed: () => Navigator.pop(context), + onPressed: () { + int _count = 0; + Navigator.popUntil(context, (route) => _count++ >= 2); + }, color: kSecondaryColor, child: const Text( 'Ignore', diff --git a/packages/simplex_app/lib/views/splash_screen.dart b/packages/simplex_app/lib/views/splash_screen.dart index ec00f444b1..fb9cf3619e 100644 --- a/packages/simplex_app/lib/views/splash_screen.dart +++ b/packages/simplex_app/lib/views/splash_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:progress_indicators/progress_indicators.dart'; import 'package:simplex_chat/animations/entrance_fader.dart'; import 'package:simplex_chat/app_routes.dart'; @@ -38,9 +39,9 @@ class _SplashScreenState extends State { EntranceFader( duration: const Duration(seconds: 1), offset: const Offset(0, 15), - child: Image.asset( - 'assets/simpleX.png', - height: 150, + child: SvgPicture.asset( + 'assets/logo.svg', + height: 85, ), ), EntranceFader(