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.

109 lines
3.6 KiB

  1. import 'package:Envelope/models/my_profile.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_dotenv/flutter_dotenv.dart';
  4. import '/views/main/home.dart';
  5. import '/views/authentication/unauthenticated_landing.dart';
  6. import '/views/authentication/login.dart';
  7. import '/views/authentication/signup.dart';
  8. void main() async {
  9. await dotenv.load(fileName: '.env');
  10. // TODO: Replace this with the prod url when server is deployed
  11. MyProfile.setServerUrl(dotenv.env['SERVER_URL'] ?? 'http://localhost:8080/');
  12. runApp(const MyApp());
  13. }
  14. class MyApp extends StatelessWidget {
  15. const MyApp({Key? key}) : super(key: key);
  16. static const String _title = 'Envelope';
  17. @override
  18. Widget build(BuildContext context) {
  19. return MaterialApp(
  20. title: _title,
  21. routes: {
  22. '/home': (context) => const Home(),
  23. '/landing': (context) => const UnauthenticatedLandingWidget(),
  24. '/login': (context) => const Login(),
  25. '/signup': (context) => const Signup(),
  26. },
  27. home: const Scaffold(
  28. body: SafeArea(
  29. child: Home(),
  30. )
  31. ),
  32. theme: ThemeData(
  33. brightness: Brightness.light,
  34. primaryColor: Colors.red,
  35. appBarTheme: const AppBarTheme(
  36. backgroundColor: Colors.cyan,
  37. elevation: 0,
  38. ),
  39. inputDecorationTheme: const InputDecorationTheme(
  40. labelStyle: TextStyle(
  41. color: Colors.white,
  42. fontSize: 30,
  43. ),
  44. filled: false,
  45. ),
  46. ),
  47. darkTheme: ThemeData(
  48. brightness: Brightness.dark,
  49. primaryColor: Colors.orange.shade900,
  50. backgroundColor: Colors.grey.shade800,
  51. scaffoldBackgroundColor: Colors.grey[850],
  52. disabledColor: Colors.grey[400],
  53. colorScheme: ColorScheme(
  54. brightness: Brightness.dark,
  55. primary: Colors.orange.shade900,
  56. onPrimary: Colors.white,
  57. secondary: Colors.orange.shade900,
  58. onSecondary: Colors.white,
  59. tertiary: Colors.grey.shade500,
  60. onTertiary: Colors.black,
  61. error: Colors.red,
  62. onError: Colors.white,
  63. background: Colors.grey.shade900,
  64. onBackground: Colors.white,
  65. surface: Colors.grey.shade700,
  66. onSurface: Colors.white,
  67. ),
  68. hintColor: Colors.grey.shade500,
  69. inputDecorationTheme: InputDecorationTheme(
  70. filled: true,
  71. fillColor: Colors.grey.shade800,
  72. hintStyle: TextStyle(
  73. color: Colors.grey.shade500,
  74. ),
  75. iconColor: Colors.grey.shade500,
  76. contentPadding: const EdgeInsets.all(8),
  77. enabledBorder: OutlineInputBorder(
  78. borderRadius: BorderRadius.circular(15),
  79. borderSide: const BorderSide(
  80. color: Colors.transparent,
  81. )
  82. ),
  83. focusedBorder: OutlineInputBorder(
  84. borderRadius: BorderRadius.circular(15),
  85. borderSide: const BorderSide(
  86. color: Colors.transparent,
  87. )
  88. ),
  89. ),
  90. appBarTheme: AppBarTheme(
  91. color: Colors.grey.shade800,
  92. iconTheme: IconThemeData(
  93. color: Colors.grey.shade400
  94. ),
  95. toolbarTextStyle: TextStyle(
  96. color: Colors.grey.shade400
  97. ),
  98. ),
  99. ),
  100. );
  101. }
  102. }