Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
5.6 KiB

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import '/database/models/my_profile.dart';
import '/views/main/home.dart';
import '/views/authentication/unauthenticated_landing.dart';
import '/views/authentication/login.dart';
import '/views/authentication/signup.dart';
void main() async {
await dotenv.load(fileName: '.env');
// TODO: Replace this with the prod url when server is deployed
MyProfile.setServerUrl(dotenv.env['SERVER_URL'] ?? 'http://localhost:8080/');
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Envelope';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
routes: {
'/home': (context) => const Home(),
'/landing': (context) => const UnauthenticatedLandingWidget(),
'/login': (context) => const Login(),
'/signup': (context) => const Signup(),
},
home: const Scaffold(
body: SafeArea(
child: Home(),
)
),
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,
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,
),
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(
brightness: Brightness.dark,
primaryColor: const Color(0xffff4a27),
backgroundColor: Colors.grey.shade800,
scaffoldBackgroundColor: Colors.grey[850],
disabledColor: Colors.grey[400],
hintColor: Colors.grey.shade400,
colorScheme: ColorScheme(
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
),
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,
),
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,
)
),
),
),
);
}
}