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.

104 lines
3.4 KiB

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