themes.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright © 2014-2025 PDF Technologies, Inc. All Rights Reserved.
  2. //
  3. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  4. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  5. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  6. // This notice may not be removed from this file.
  7. import 'package:flutter/material.dart';
  8. import 'package:flutter/services.dart';
  9. final ThemeData lightTheme = ThemeData(
  10. useMaterial3: true,
  11. brightness: Brightness.light,
  12. colorScheme: const ColorScheme.light(
  13. primary: Colors.blue,
  14. onPrimary: Color(0xFF43474D),
  15. onSecondary: Color(0xFF666666)),
  16. textTheme: const TextTheme(
  17. bodyMedium: TextStyle(),
  18. bodyLarge: TextStyle(),
  19. bodySmall: TextStyle(),
  20. titleMedium: TextStyle())
  21. .apply(
  22. displayColor: const Color(0xFF43474D),
  23. bodyColor: const Color(0xFF43474D)),
  24. appBarTheme: const AppBarTheme(
  25. elevation: 4.0,
  26. titleTextStyle: TextStyle(
  27. fontSize: 18,
  28. fontWeight: FontWeight.bold,
  29. color: Color(0xFF43474D)),
  30. backgroundColor: Color(0xFFFAFCFF),
  31. foregroundColor: Color(0xFF43474D),
  32. systemOverlayStyle:
  33. SystemUiOverlayStyle(systemNavigationBarColor: Color(0xFFFFFFFF))),
  34. elevatedButtonTheme: ElevatedButtonThemeData(
  35. style: ElevatedButton.styleFrom(foregroundColor: Colors.blue)),
  36. switchTheme: SwitchThemeData(
  37. thumbColor: WidgetStateProperty.resolveWith((status){
  38. if(status.contains(WidgetState.selected)) {
  39. return Colors.blue;
  40. }
  41. return Colors.grey.shade400;
  42. } ),
  43. trackColor: WidgetStateProperty.resolveWith((status){
  44. if(status.contains(WidgetState.selected)) {
  45. return Colors.blue.shade50;
  46. }
  47. return Colors.grey.shade100;
  48. }),
  49. trackOutlineColor: WidgetStateProperty.resolveWith((status){
  50. if(status.contains(WidgetState.selected)) {
  51. return Colors.blue.shade50;
  52. }
  53. return Colors.grey.shade100;
  54. }),
  55. ));
  56. final ThemeData darkTheme = ThemeData(
  57. useMaterial3: true,
  58. brightness: Brightness.dark,
  59. scaffoldBackgroundColor: Colors.black,
  60. colorScheme: const ColorScheme.dark(
  61. primary: Colors.blue,
  62. surface: Color(0xFF222429),
  63. onPrimary: Colors.white,
  64. onSecondary: Colors.white),
  65. textTheme: const TextTheme(
  66. bodyMedium: TextStyle(),
  67. bodyLarge: TextStyle(),
  68. bodySmall: TextStyle(),
  69. titleMedium: TextStyle())
  70. .apply(displayColor: Colors.white, bodyColor: Colors.white),
  71. appBarTheme: const AppBarTheme(
  72. elevation: 2.0,
  73. titleTextStyle: TextStyle(
  74. fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white),
  75. backgroundColor: Color(0xFF222429),
  76. foregroundColor: Colors.white,
  77. systemOverlayStyle:
  78. SystemUiOverlayStyle(systemNavigationBarColor: Color(0xFF222429))),
  79. elevatedButtonTheme: ElevatedButtonThemeData(
  80. style: ElevatedButton.styleFrom(foregroundColor: Colors.blue)),
  81. switchTheme: SwitchThemeData(
  82. thumbColor: WidgetStateProperty.resolveWith((status){
  83. if(status.contains(WidgetState.selected)) {
  84. return Colors.blue;
  85. }
  86. return Colors.grey.shade400;
  87. } ),
  88. trackColor: WidgetStateProperty.resolveWith((status){
  89. if(status.contains(WidgetState.selected)) {
  90. return Colors.blue.shade50;
  91. }
  92. return Colors.grey.shade100;
  93. }),
  94. trackOutlineColor: WidgetStateProperty.resolveWith((status){
  95. if(status.contains(WidgetState.selected)) {
  96. return Colors.blue.shade50;
  97. }
  98. return Colors.grey.shade100;
  99. }),
  100. ));