Browse Source

Update color schemes

feature/add-notifications
Tovi Jaeschke-Rogers 2 years ago
parent
commit
07c5e4af7a
24 changed files with 302 additions and 194 deletions
  1. +1
    -0
      Backend/Api/Routes.go
  2. +1
    -1
      Backend/Models/Conversations.go
  3. +1
    -1
      Backend/dev.sh
  4. +0
    -1
      README.md
  5. +14
    -14
      mobile/ios/Runner.xcodeproj/project.pbxproj
  6. +7
    -6
      mobile/lib/components/custom_circle_avatar.dart
  7. +46
    -33
      mobile/lib/components/custom_title_bar.dart
  8. +1
    -0
      mobile/lib/components/file_picker.dart
  9. +2
    -0
      mobile/lib/components/view_image.dart
  10. +124
    -58
      mobile/lib/main.dart
  11. +2
    -2
      mobile/lib/utils/storage/conversations.dart
  12. +1
    -2
      mobile/lib/views/authentication/login.dart
  13. +12
    -13
      mobile/lib/views/authentication/signup.dart
  14. +3
    -4
      mobile/lib/views/authentication/unauthenticated_landing.dart
  15. +1
    -1
      mobile/lib/views/main/conversation/detail.dart
  16. +11
    -3
      mobile/lib/views/main/conversation/list.dart
  17. +12
    -8
      mobile/lib/views/main/conversation/message.dart
  18. +4
    -3
      mobile/lib/views/main/conversation/settings.dart
  19. +6
    -2
      mobile/lib/views/main/friend/list.dart
  20. +6
    -1
      mobile/lib/views/main/friend/list_item.dart
  21. +5
    -1
      mobile/lib/views/main/home.dart
  22. +11
    -9
      mobile/lib/views/main/profile/profile.dart
  23. +30
    -30
      mobile/pubspec.lock
  24. +1
    -1
      mobile/pubspec.yaml

+ 1
- 0
Backend/Api/Routes.go View File

@ -80,6 +80,7 @@ func InitAPIEndpoints(router *mux.Router) {
authAPI.HandleFunc("/conversations", Messages.UpdateConversation).Methods("PUT") authAPI.HandleFunc("/conversations", Messages.UpdateConversation).Methods("PUT")
authAPI.HandleFunc("/conversations/{detailID}/image", Messages.AddConversationImage).Methods("POST") authAPI.HandleFunc("/conversations/{detailID}/image", Messages.AddConversationImage).Methods("POST")
authAPI.HandleFunc("/conversations/{detailID}/message_expiry", Messages.ChangeConversationMessageExpiry).Methods("POST") authAPI.HandleFunc("/conversations/{detailID}/message_expiry", Messages.ChangeConversationMessageExpiry).Methods("POST")
authAPI.HandleFunc("/conversations/{detailID}/users/{conversationUser}", Messages.ChangeConversationMessageExpiry).Methods("POST")
authAPI.HandleFunc("/message", Messages.CreateMessage).Methods("POST") authAPI.HandleFunc("/message", Messages.CreateMessage).Methods("POST")
authAPI.HandleFunc("/messages/{associationKey}", Messages.Messages).Methods("GET") authAPI.HandleFunc("/messages/{associationKey}", Messages.Messages).Methods("GET")


+ 1
- 1
Backend/Models/Conversations.go View File

@ -21,7 +21,7 @@ type ConversationDetail struct {
AdminSendMessages string ` json:"admin_send_messages"` // Stored encrypted AdminSendMessages string ` json:"admin_send_messages"` // Stored encrypted
} }
// ConversationDetailUser all users associated with a customer
// ConversationDetailUser all users associated with a conversation
type ConversationDetailUser struct { type ConversationDetailUser struct {
Base Base
ConversationDetailID uuid.UUID `gorm:"not null" json:"conversation_detail_id"` ConversationDetailID uuid.UUID `gorm:"not null" json:"conversation_detail_id"`


+ 1
- 1
Backend/dev.sh View File

@ -3,6 +3,6 @@ while true; do
go build main.go go build main.go
./main & ./main &
PID=$! PID=$!
inotifywait -r -e modify .
inotifywait --exclude 'attachments|/\..+' -r -e modify .
kill $PID kill $PID
done done

+ 0
- 1
README.md View File

@ -4,7 +4,6 @@ Encrypted messaging app
## TODO ## TODO
- Fix friends list search
- Add friends profile picture - Add friends profile picture
- Add conversation pagination - Add conversation pagination
- Add message pagination - Add message pagination


+ 14
- 14
mobile/ios/Runner.xcodeproj/project.pbxproj View File

@ -139,7 +139,7 @@
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
1015E9199730C97F537825AC /* [CP] Embed Pods Frameworks */,
68A0E21713AF256096EFD1B0 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -198,36 +198,36 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
1015E9199730C97F537825AC /* [CP] Embed Pods Frameworks */ = {
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
inputPaths = (
); );
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
name = "Thin Binary";
outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
68A0E21713AF256096EFD1B0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = (
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "Thin Binary";
outputPaths = (
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
}; };
90DE9D5E1F568436E776C753 /* [CP] Check Pods Manifest.lock */ = { 90DE9D5E1F568436E776C753 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;


+ 7
- 6
mobile/lib/components/custom_circle_avatar.dart View File

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:path/path.dart';
enum AvatarTypes { enum AvatarTypes {
initials, initials,
@ -24,7 +25,7 @@ class CustomCircleAvatar extends StatelessWidget {
this.radius = 20, this.radius = 20,
}) : super(key: key); }) : super(key: key);
Widget avatar() {
Widget avatar(BuildContext context) {
AvatarTypes? type; AvatarTypes? type;
if (icon != null) { if (icon != null) {
@ -45,17 +46,17 @@ class CustomCircleAvatar extends StatelessWidget {
if (type == AvatarTypes.initials) { if (type == AvatarTypes.initials) {
return CircleAvatar( return CircleAvatar(
backgroundColor: Colors.grey[300],
child: Text(initials!),
backgroundColor: Theme.of(context).colorScheme.tertiary,
radius: radius, radius: radius,
child: Text(initials!),
); );
} }
if (type == AvatarTypes.icon) { if (type == AvatarTypes.icon) {
return CircleAvatar( return CircleAvatar(
backgroundColor: Colors.grey[300],
child: icon,
backgroundColor: Theme.of(context).colorScheme.tertiary,
radius: radius, radius: radius,
child: icon,
); );
} }
@ -106,7 +107,7 @@ class CustomCircleAvatar extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
children: [ children: [
avatar(),
avatar(context),
editIcon(context), editIcon(context),
] ]
); );


+ 46
- 33
mobile/lib/components/custom_title_bar.dart View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@immutable @immutable
class CustomTitleBar extends StatelessWidget with PreferredSizeWidget { class CustomTitleBar extends StatelessWidget with PreferredSizeWidget {
@ -8,6 +9,8 @@ class CustomTitleBar extends StatelessWidget with PreferredSizeWidget {
required this.showBack, required this.showBack,
this.rightHandButton, this.rightHandButton,
this.backgroundColor, this.backgroundColor,
this.forgroundColor,
this.iconColor,
this.beforeBack, this.beforeBack,
}) : super(key: key); }) : super(key: key);
@ -15,6 +18,8 @@ class CustomTitleBar extends StatelessWidget with PreferredSizeWidget {
final bool showBack; final bool showBack;
final IconButton? rightHandButton; final IconButton? rightHandButton;
final Color? backgroundColor; final Color? backgroundColor;
final Color? forgroundColor;
final Color? iconColor;
final Future<void> Function()? beforeBack; final Future<void> Function()? beforeBack;
@override @override
@ -23,39 +28,45 @@ class CustomTitleBar extends StatelessWidget with PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppBar( return AppBar(
elevation: 0,
automaticallyImplyLeading: false,
backgroundColor:
backgroundColor != null ?
backgroundColor! :
Theme.of(context).appBarTheme.backgroundColor,
flexibleSpace: SafeArea(
child: Container(
padding: const EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
showBack ?
_backButton(context) :
const SizedBox.shrink(),
showBack ?
const SizedBox(width: 2,) :
const SizedBox(width: 15),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
title,
],
),
elevation: 0,
automaticallyImplyLeading: false,
backgroundColor:
backgroundColor != null ?
backgroundColor! :
Theme.of(context).appBarTheme.backgroundColor,
foregroundColor: forgroundColor != null ?
forgroundColor! :
Theme.of(context).appBarTheme.foregroundColor,
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarColor: Colors.white,
),
flexibleSpace: SafeArea(
child: Container(
padding: const EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
showBack ?
_backButton(context) :
const SizedBox.shrink(),
showBack ?
const SizedBox(width: 2,) :
const SizedBox(width: 15),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
title,
],
), ),
rightHandButton != null ?
rightHandButton! :
const SizedBox.shrink(),
],
),
),
rightHandButton != null ?
rightHandButton! :
const SizedBox.shrink(),
],
), ),
), ),
),
); );
} }
@ -69,9 +80,11 @@ class CustomTitleBar extends StatelessWidget with PreferredSizeWidget {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: Icon( icon: Icon(
Icons.arrow_back,
color: Theme.of(context).appBarTheme.iconTheme?.color,
),
Icons.arrow_back,
color: iconColor != null ?
iconColor! :
Theme.of(context).appBarTheme.iconTheme?.color,
),
); );
} }
} }


+ 1
- 0
mobile/lib/components/file_picker.dart View File

@ -97,6 +97,7 @@ class FilePicker extends StatelessWidget {
child: Icon( child: Icon(
icon, icon,
size: 40, size: 40,
color: Colors.white,
), ),
), ),
), ),


+ 2
- 0
mobile/lib/components/view_image.dart View File

@ -18,6 +18,8 @@ class ViewImage extends StatelessWidget {
title: Text(''), title: Text(''),
showBack: true, showBack: true,
backgroundColor: Colors.black, backgroundColor: Colors.black,
forgroundColor: Colors.white,
iconColor: Colors.white,
), ),
body: Center( body: Center(
child: InteractiveViewer( child: InteractiveViewer(


+ 124
- 58
mobile/lib/main.dart View File

@ -1,5 +1,6 @@
import 'package:Envelope/models/my_profile.dart'; import 'package:Envelope/models/my_profile.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart';
import '/views/main/home.dart'; import '/views/main/home.dart';
import '/views/authentication/unauthenticated_landing.dart'; import '/views/authentication/unauthenticated_landing.dart';
@ -31,78 +32,143 @@ class MyApp extends StatelessWidget {
'/signup': (context) => const Signup(), '/signup': (context) => const Signup(),
}, },
home: const Scaffold( home: const Scaffold(
body: SafeArea(
child: Home(),
)
),
body: SafeArea(
child: Home(),
)
),
theme: ThemeData( theme: ThemeData(
brightness: Brightness.light,
primaryColor: const Color(0xff014bff),
backgroundColor: Colors.grey[300],
scaffoldBackgroundColor: Colors.grey.shade100,
disabledColor: Colors.grey[700],
hintColor: Colors.grey.shade700,
colorScheme: ColorScheme(
brightness: Brightness.light, brightness: Brightness.light,
primaryColor: Colors.red,
appBarTheme: const AppBarTheme(
backgroundColor: Colors.cyan,
elevation: 0,
primary: const Color(0xff014bff),
onPrimary: Colors.white,
secondary: const Color(0xff1a6dff),
onSecondary: Colors.black,
tertiary: const Color(0xff3490ff),
onTertiary: Colors.black,
error: Colors.red,
onError: Colors.white,
background: Colors.grey.shade300,
onBackground: Colors.black,
surface: Colors.grey.shade100,
onSurface: Colors.black,
),
appBarTheme: AppBarTheme(
color: Colors.grey.shade100,
foregroundColor: Colors.white,
iconTheme: const IconThemeData(
color: Colors.black,
),
toolbarTextStyle: const TextStyle(
color: Colors.black,
),
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarColor: Colors.black,
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
)
),
iconTheme: const IconThemeData(color: Colors.black),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.white,
labelStyle: const TextStyle(
color: Colors.black,
fontSize: 30,
), ),
inputDecorationTheme: const InputDecorationTheme(
labelStyle: TextStyle(
color: Colors.white,
fontSize: 30,
),
filled: false,
hintStyle: TextStyle(
color: Colors.grey.shade600,
), ),
iconColor: Colors.grey.shade500,
contentPadding: const EdgeInsets.all(8),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
),
),
), ),
darkTheme: ThemeData(
darkTheme: ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
primaryColor: Colors.orange.shade900,
primaryColor: const Color(0xffff4a27),
backgroundColor: Colors.grey.shade800, backgroundColor: Colors.grey.shade800,
scaffoldBackgroundColor: Colors.grey[850], scaffoldBackgroundColor: Colors.grey[850],
disabledColor: Colors.grey[400], disabledColor: Colors.grey[400],
hintColor: Colors.grey.shade400,
colorScheme: ColorScheme( colorScheme: ColorScheme(
brightness: Brightness.dark,
primary: Colors.orange.shade900,
onPrimary: Colors.white,
secondary: Colors.orange.shade900,
onSecondary: Colors.white,
tertiary: Colors.grey.shade500,
onTertiary: Colors.black,
error: Colors.red,
onError: Colors.white,
background: Colors.grey.shade900,
onBackground: Colors.white,
surface: Colors.grey.shade700,
onSurface: Colors.white,
brightness: Brightness.dark,
primary: const Color(0xffff4a27),
onPrimary: Colors.white,
secondary: const Color(0xffff5f3a),
onSecondary: Colors.white,
tertiary: const Color(0xffff7950),
onTertiary: Colors.black,
error: Colors.red,
onError: Colors.white,
background: Colors.grey.shade900,
onBackground: Colors.white,
surface: Colors.grey.shade700,
onSurface: Colors.white,
),
appBarTheme: AppBarTheme(
color: Colors.grey.shade800,
iconTheme: IconThemeData(
color: Colors.grey.shade400
), ),
hintColor: Colors.grey.shade500,
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.grey.shade800,
hintStyle: TextStyle(
color: Colors.grey.shade500,
),
iconColor: Colors.grey.shade500,
contentPadding: const EdgeInsets.all(8),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
),
toolbarTextStyle: TextStyle(
color: Colors.grey.shade400
),
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarColor: Colors.black,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.dark,
)
),
iconTheme: const IconThemeData(color: Colors.white),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.grey.shade800,
hintStyle: TextStyle(
color: Colors.grey.shade500,
), ),
appBarTheme: AppBarTheme(
color: Colors.grey.shade800,
iconTheme: IconThemeData(
color: Colors.grey.shade400
),
toolbarTextStyle: TextStyle(
color: Colors.grey.shade400
),
iconColor: Colors.grey.shade500,
contentPadding: const EdgeInsets.all(8),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: const BorderSide(
color: Colors.transparent,
)
), ),
),
), ),
); );
} }


+ 2
- 2
mobile/lib/utils/storage/conversations.dart View File

@ -181,7 +181,7 @@ Future<void> updateConversations() async {
} }
Future<void> uploadConversation(Conversation conversation, BuildContext context) async {
Future<void> uploadConversation(Conversation conversation) async {
String sessionCookie = await getSessionCookie(); String sessionCookie = await getSessionCookie();
Map<String, dynamic> conversationJson = await conversation.payloadJson(); Map<String, dynamic> conversationJson = await conversation.payloadJson();
@ -196,7 +196,7 @@ Future<void> uploadConversation(Conversation conversation, BuildContext context)
); );
if (resp.statusCode != 204) { if (resp.statusCode != 204) {
showMessage('Failed to create conversation', context);
throw Exception('Failed to create conversation');
} }
} }

+ 1
- 2
mobile/lib/views/authentication/login.dart View File

@ -102,8 +102,7 @@ class _LoginWidgetState extends State<LoginWidget> {
); );
final ButtonStyle buttonStyle = ElevatedButton.styleFrom( final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surface,
foregroundColor: Theme.of(context).colorScheme.onSurface,
backgroundColor: Theme.of(context).colorScheme.tertiary,
minimumSize: const Size.fromHeight(50), minimumSize: const Size.fromHeight(50),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
textStyle: TextStyle( textStyle: TextStyle(


+ 12
- 13
mobile/lib/views/authentication/signup.dart View File

@ -85,15 +85,14 @@ class _SignupWidgetState extends State<SignupWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ButtonStyle buttonStyle = ElevatedButton.styleFrom( final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
primary: Theme.of(context).colorScheme.surface,
onPrimary: Theme.of(context).colorScheme.onSurface,
minimumSize: const Size.fromHeight(50),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
textStyle: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.error,
),
backgroundColor: Theme.of(context).colorScheme.tertiary,
minimumSize: const Size.fromHeight(50),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
textStyle: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.error,
),
); );
return Center( return Center(
@ -213,7 +212,7 @@ class _SignupWidgetState extends State<SignupWidget> {
Widget serverUrl() { Widget serverUrl() {
if (!showUrlInput) { if (!showUrlInput) {
return
return
Padding( Padding(
padding: const EdgeInsets.only(top: 0, bottom: 10), padding: const EdgeInsets.only(top: 0, bottom: 10),
child: Row( child: Row(
@ -221,9 +220,9 @@ class _SignupWidgetState extends State<SignupWidget> {
SizedBox( SizedBox(
height: 10, height: 10,
child: IconButton( child: IconButton(
onPressed: () {
onPressed: () {
setState(() { setState(() {
showUrlInput = true;
showUrlInput = true;
}); });
}, },
icon: Icon( icon: Icon(
@ -276,7 +275,7 @@ class _SignupWidgetState extends State<SignupWidget> {
var rsaPrivPem = CryptoUtils.encodeRSAPrivateKeyToPem(keyPair.privateKey); var rsaPrivPem = CryptoUtils.encodeRSAPrivateKeyToPem(keyPair.privateKey);
String encRsaPriv = AesHelper.aesEncrypt( String encRsaPriv = AesHelper.aesEncrypt(
_passwordController.text,
_passwordController.text,
Uint8List.fromList(rsaPrivPem.codeUnits), Uint8List.fromList(rsaPrivPem.codeUnits),
); );


+ 3
- 4
mobile/lib/views/authentication/unauthenticated_landing.dart View File

@ -14,8 +14,7 @@ class _UnauthenticatedLandingWidgetState extends State<UnauthenticatedLandingWid
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ButtonStyle buttonStyle = ElevatedButton.styleFrom( final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surface,
foregroundColor: Theme.of(context).colorScheme.onSurface,
backgroundColor: Theme.of(context).colorScheme.tertiary,
minimumSize: const Size.fromHeight(50), minimumSize: const Size.fromHeight(50),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
textStyle: const TextStyle( textStyle: const TextStyle(
@ -60,25 +59,25 @@ class _UnauthenticatedLandingWidgetState extends State<UnauthenticatedLandingWid
child: Column ( child: Column (
children: [ children: [
ElevatedButton( ElevatedButton(
child: const Text('Login'),
onPressed: () => { onPressed: () => {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const Login()), MaterialPageRoute(builder: (context) => const Login()),
), ),
}, },
style: buttonStyle, style: buttonStyle,
child: const Text('Login'),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
ElevatedButton( ElevatedButton(
child: const Text('Sign Up'),
onPressed: () => { onPressed: () => {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const Signup()), MaterialPageRoute(builder: (context) => const Signup()),
), ),
}, },
style: buttonStyle, style: buttonStyle,
child: const Text('Sign Up'),
), ),
const SizedBox(height: 50), const SizedBox(height: 50),
] ]


+ 1
- 1
mobile/lib/views/main/conversation/detail.dart View File

@ -269,12 +269,12 @@ class _ConversationDetailState extends State<ConversationDetail> {
selectedImages = []; selectedImages = [];
}); });
}, },
backgroundColor: Theme.of(context).primaryColor,
child: Icon( child: Icon(
Icons.send, Icons.send,
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).colorScheme.onPrimary,
size: 22 size: 22
), ),
backgroundColor: Theme.of(context).primaryColor,
), ),
), ),
), ),


+ 11
- 3
mobile/lib/views/main/conversation/list.dart View File

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:Envelope/components/custom_title_bar.dart'; import 'package:Envelope/components/custom_title_bar.dart';
import 'package:Envelope/components/flash_message.dart';
import 'package:Envelope/models/friends.dart'; import 'package:Envelope/models/friends.dart';
import 'package:Envelope/utils/storage/conversations.dart'; import 'package:Envelope/utils/storage/conversations.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -79,10 +80,13 @@ class _ConversationListState extends State<ConversationList> {
false, false,
); );
uploadConversation(conversation, context);
uploadConversation(conversation)
.catchError((dynamic) {
showMessage('Failed to create conversation', context);
});
Navigator.of(context).popUntil((route) => route.isFirst); Navigator.of(context).popUntil((route) => route.isFirst);
Navigator.push(context, MaterialPageRoute(builder: (context){
Navigator.push(context, MaterialPageRoute(builder: (context) {
return ConversationDetail( return ConversationDetail(
conversation: conversation, conversation: conversation,
); );
@ -95,7 +99,11 @@ class _ConversationListState extends State<ConversationList> {
).then(onGoBack); ).then(onGoBack);
}, },
backgroundColor: Theme.of(context).colorScheme.primary, backgroundColor: Theme.of(context).colorScheme.primary,
child: const Icon(Icons.add, size: 30),
child: Icon(
Icons.add,
size: 30,
color: Theme.of(context).colorScheme.onPrimary,
),
), ),
), ),
); );


+ 12
- 8
mobile/lib/views/main/conversation/message.dart View File

@ -78,10 +78,10 @@ class _ConversationMessageState extends State<ConversationMessage> {
padding: const EdgeInsets.only(left: 14,right: 14,top: 0,bottom: 0), padding: const EdgeInsets.only(left: 14,right: 14,top: 0,bottom: 0),
child: Align( child: Align(
alignment: ( alignment: (
widget.message.senderId == widget.profile.id ?
Alignment.topRight :
Alignment.topLeft
),
widget.message.senderId == widget.profile.id ?
Alignment.topRight :
Alignment.topLeft
),
child: Column( child: Column(
crossAxisAlignment: widget.message.senderId == widget.profile.id ? crossAxisAlignment: widget.message.senderId == widget.profile.id ?
CrossAxisAlignment.end : CrossAxisAlignment.end :
@ -117,7 +117,7 @@ class _ConversationMessageState extends State<ConversationMessage> {
TextAlign.right, TextAlign.right,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.grey[500],
color: Theme.of(context).hintColor,
), ),
), ),
], ],
@ -133,6 +133,10 @@ class _ConversationMessageState extends State<ConversationMessage> {
} }
void _showCustomMenu() { void _showCustomMenu() {
if (menuItems.isEmpty) {
return;
}
final Size overlay = MediaQuery.of(context).size; final Size overlay = MediaQuery.of(context).size;
int addVerticalOffset = 75 * menuItems.length; int addVerticalOffset = 75 * menuItems.length;
@ -142,8 +146,8 @@ class _ConversationMessageState extends State<ConversationMessage> {
context: context, context: context,
items: menuItems, items: menuItems,
position: RelativeRect.fromRect( position: RelativeRect.fromRect(
Offset(_tapPosition!.dx, (_tapPosition!.dy - addVerticalOffset)) & const Size(40, 40),
Offset.zero & overlay
Offset(_tapPosition!.dx, (_tapPosition!.dy - addVerticalOffset)) & const Size(40, 40),
Offset.zero & overlay
) )
) )
.then<void>((String? delta) async { .then<void>((String? delta) async {
@ -213,7 +217,7 @@ class _ConversationMessageState extends State<ConversationMessage> {
widget.message.senderUsername, widget.message.senderUsername,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.grey[300],
color: Theme.of(context).hintColor,
), ),
); );
} }


+ 4
- 3
mobile/lib/views/main/conversation/settings.dart View File

@ -46,7 +46,7 @@ class _ConversationSettingsState extends State<ConversationSettings> {
return Scaffold( return Scaffold(
appBar: CustomTitleBar( appBar: CustomTitleBar(
title: Text( title: Text(
widget.conversation.name + ' Settings',
'${widget.conversation.name} Settings',
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -176,7 +176,8 @@ class _ConversationSettingsState extends State<ConversationSettings> {
style: TextStyle(fontSize: 16) style: TextStyle(fontSize: 16)
), ),
icon: const Icon(Icons.exit_to_app), icon: const Icon(Icons.exit_to_app),
style: const ButtonStyle(
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Theme.of(context).colorScheme.error),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
), ),
onPressed: () { onPressed: () {
@ -328,7 +329,7 @@ return Theme.of(context).colorScheme.onBackground;
user: users[i], user: users[i],
isAdmin: widget.conversation.admin, isAdmin: widget.conversation.admin,
twoUser: widget.conversation.twoUser, twoUser: widget.conversation.twoUser,
profile: profile!, // TODO: Fix this
profile: profile!,
); );
} }
); );


+ 6
- 2
mobile/lib/views/main/friend/list.dart View File

@ -71,7 +71,11 @@ class _FriendListState extends State<FriendList> {
floatingActionButton: Padding( floatingActionButton: Padding(
padding: const EdgeInsets.only(right: 10, bottom: 10), padding: const EdgeInsets.only(right: 10, bottom: 10),
child: ExpandableFab( child: ExpandableFab(
icon: const Icon(Icons.add, size: 30),
icon: Icon(
Icons.add,
size: 30,
color: Theme.of(context).colorScheme.onPrimary,
),
distance: 90.0, distance: 90.0,
children: [ children: [
ActionButton( ActionButton(
@ -163,7 +167,7 @@ class _FriendListState extends State<FriendList> {
heading, heading,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Theme.of(context).colorScheme.tertiary,
color: Theme.of(context).hintColor,
), ),
), ),
) )


+ 6
- 1
mobile/lib/views/main/friend/list_item.dart View File

@ -1,7 +1,9 @@
import 'package:Envelope/components/custom_circle_avatar.dart'; import 'package:Envelope/components/custom_circle_avatar.dart';
import 'package:Envelope/components/flash_message.dart';
import 'package:Envelope/models/conversations.dart'; import 'package:Envelope/models/conversations.dart';
import 'package:Envelope/models/friends.dart'; import 'package:Envelope/models/friends.dart';
import 'package:Envelope/utils/storage/conversations.dart'; import 'package:Envelope/utils/storage/conversations.dart';
import 'package:Envelope/utils/storage/messages.dart';
import 'package:Envelope/utils/strings.dart'; import 'package:Envelope/utils/strings.dart';
import 'package:Envelope/views/main/conversation/detail.dart'; import 'package:Envelope/views/main/conversation/detail.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -67,7 +69,10 @@ class _FriendListItemState extends State<FriendListItem> {
true, true,
); );
uploadConversation(conversation, context);
uploadConversation(conversation)
.catchError((dynamic d) async {
showMessage('Failed to create conversation', context);
});
Navigator.push(context, MaterialPageRoute(builder: (context){ Navigator.push(context, MaterialPageRoute(builder: (context){
return ConversationDetail( return ConversationDetail(


+ 5
- 1
mobile/lib/views/main/home.dart View File

@ -49,13 +49,17 @@ class _HomeState extends State<Home> {
onWillPop: () async => false, onWillPop: () async => false,
child: isLoading ? loading() : Scaffold( child: isLoading ? loading() : Scaffold(
body: _widgetOptions.elementAt(_selectedIndex), body: _widgetOptions.elementAt(_selectedIndex),
bottomNavigationBar: isLoading ? const SizedBox.shrink() : BottomNavigationBar(
bottomNavigationBar: isLoading ?
const SizedBox.shrink() :
BottomNavigationBar(
currentIndex: _selectedIndex, currentIndex: _selectedIndex,
onTap: _onItemTapped, onTap: _onItemTapped,
selectedItemColor: Theme.of(context).primaryColor, selectedItemColor: Theme.of(context).primaryColor,
unselectedItemColor: Theme.of(context).hintColor, unselectedItemColor: Theme.of(context).hintColor,
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600), selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600), unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600),
backgroundColor: Colors.transparent,
elevation: 0,
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
items: const [ items: const [
BottomNavigationBarItem( BottomNavigationBarItem(


+ 11
- 9
mobile/lib/views/main/profile/profile.dart View File

@ -190,12 +190,13 @@ class _ProfileState extends State<Profile> {
children: [ children: [
TextButton.icon( TextButton.icon(
label: const Text( label: const Text(
'Logout',
style: TextStyle(fontSize: 16)
'Logout',
style: TextStyle(fontSize: 16)
), ),
icon: const Icon(Icons.exit_to_app), icon: const Icon(Icons.exit_to_app),
style: const ButtonStyle(
alignment: Alignment.centerLeft,
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Theme.of(context).colorScheme.error),
alignment: Alignment.centerLeft,
), ),
onPressed: () { onPressed: () {
deleteDb(); deleteDb();
@ -205,12 +206,13 @@ class _ProfileState extends State<Profile> {
), ),
isTesting ? TextButton.icon( isTesting ? TextButton.icon(
label: const Text( label: const Text(
'Delete Database',
style: TextStyle(fontSize: 16)
'Delete Database',
style: TextStyle(fontSize: 16)
), ),
icon: const Icon(Icons.delete_forever), icon: const Icon(Icons.delete_forever),
style: const ButtonStyle(
alignment: Alignment.centerLeft,
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(Theme.of(context).colorScheme.error),
alignment: Alignment.centerLeft,
), ),
onPressed: () { onPressed: () {
deleteDb(); deleteDb();
@ -345,7 +347,7 @@ class _ProfileState extends State<Profile> {
Padding( Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: QrImage( child: QrImage(
backgroundColor: Theme.of(context).colorScheme.primary,
backgroundColor: Theme.of(context).colorScheme.tertiary,
data: payload, data: payload,
version: QrVersions.auto, version: QrVersions.auto,
gapless: true, gapless: true,


+ 30
- 30
mobile/pubspec.lock View File

@ -7,7 +7,7 @@ packages:
name: asn1lib name: asn1lib
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0"
version: "1.1.1"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -49,14 +49,14 @@ packages:
name: convert name: convert
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1"
version: "3.1.1"
cross_file: cross_file:
dependency: transitive dependency: transitive
description: description:
name: cross_file name: cross_file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.3+1"
version: "0.3.3+2"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -70,7 +70,7 @@ packages:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4"
version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -84,14 +84,14 @@ packages:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.1"
version: "2.0.1"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2"
version: "6.1.4"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -110,7 +110,7 @@ packages:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4"
version: "2.0.1"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -134,49 +134,49 @@ packages:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.13.4"
version: "0.13.5"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.1"
version: "4.0.2"
image_picker: image_picker:
dependency: "direct main" dependency: "direct main"
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.5+3"
version: "0.8.6"
image_picker_android: image_picker_android:
dependency: transitive dependency: transitive
description: description:
name: image_picker_android name: image_picker_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.5+2"
version: "0.8.5+3"
image_picker_for_web: image_picker_for_web:
dependency: transitive dependency: transitive
description: description:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.8"
version: "2.1.10"
image_picker_ios: image_picker_ios:
dependency: transitive dependency: transitive
description: description:
name: image_picker_ios name: image_picker_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.5+6"
version: "0.8.6+1"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.6.1"
version: "2.6.2"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -197,7 +197,7 @@ packages:
name: lints name: lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1"
version: "2.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -260,7 +260,7 @@ packages:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.6"
version: "2.1.7"
path_provider_macos: path_provider_macos:
dependency: transitive dependency: transitive
description: description:
@ -274,14 +274,14 @@ packages:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4"
version: "2.0.5"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
name: path_provider_windows name: path_provider_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.6"
version: "2.1.3"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -295,14 +295,14 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2"
version: "2.1.3"
pointycastle: pointycastle:
dependency: "direct main" dependency: "direct main"
description: description:
name: pointycastle name: pointycastle
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.2"
version: "3.6.2"
process: process:
dependency: transitive dependency: transitive
description: description:
@ -344,7 +344,7 @@ packages:
name: shared_preferences_android name: shared_preferences_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.12"
version: "2.0.14"
shared_preferences_ios: shared_preferences_ios:
dependency: transitive dependency: transitive
description: description:
@ -372,7 +372,7 @@ packages:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0"
version: "2.1.0"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
@ -412,14 +412,14 @@ packages:
name: sqflite name: sqflite
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2+1"
version: "2.1.0+1"
sqflite_common: sqflite_common:
dependency: transitive dependency: transitive
description: description:
name: sqflite_common name: sqflite_common
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.1+1"
version: "2.3.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -447,7 +447,7 @@ packages:
name: synchronized name: synchronized
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0+2"
version: "3.0.0+3"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -468,7 +468,7 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0"
version: "1.3.1"
uuid: uuid:
dependency: "direct main" dependency: "direct main"
description: description:
@ -489,14 +489,14 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.2"
version: "3.0.1"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
name: xdg_directories name: xdg_directories
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.0+1"
version: "0.2.0+2"
sdks: sdks:
dart: ">=2.17.0 <3.0.0"
flutter: ">=2.8.1"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0-0"

+ 1
- 1
mobile/pubspec.yaml View File

@ -32,7 +32,7 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0
flutter_lints: ^2.0.1
flutter: flutter:
uses-material-design: true uses-material-design: true


Loading…
Cancel
Save