themes.dart 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import 'package:flutter/animation.dart';
  2. import 'package:flutter/material.dart';
  3. class AppTheme {
  4. static Color primaryColor = const Color(0xff06DDE2);
  5. static Color primaryDarkColor = const Color(0xff09c4c9);
  6. static Color secondaryColor = const Color(0xffF3F3F3);
  7. static Color whiteColor = const Color(0xffffffff);
  8. static Color lightWhiteColor =const Color(0xfff4f4f4);
  9. static Color blackColor = const Color(0xff000000);
  10. static Color grayColor = const Color(0xff808080);
  11. static Color orangeColor = const Color(0xffFfa500);
  12. static Color pinkColor = const Color(0xffFFC0CB);
  13. static Color blueColor = const Color(0xff0000ff);
  14. static Color redColor = const Color(0xffFF0000);
  15. static Color purpleColor = const Color(0xff800080);
  16. static Color yellowColor = const Color(0xffFFFF00);
  17. static Color darkYellowColor = const Color(0xffFCDA2A);
  18. static Color magentaColor = const Color(0xffFF00FF);
  19. static Color brownColor = const Color(0xffA52A2A);
  20. static Color cyanColor = const Color(0xff00FFFF);
  21. static Color lightGrayColor = const Color(0xff7d7f88);
  22. static Color lightGrayBgColor = const Color(0xffE3E3E7);
  23. static Color greenColor = Colors.green;
  24. static LinearGradient primaryGradientColor = LinearGradient(
  25. begin: const Alignment(-1, -0.897),
  26. end: const Alignment(0.862, 1),
  27. colors: <Color>[primaryColor, primaryDarkColor],
  28. stops: const <double>[0.313, 1],
  29. );
  30. static LinearGradient disableGradientColor = LinearGradient(
  31. begin: const Alignment(-1, -0.897),
  32. end: const Alignment(0.862, 1),
  33. colors: <Color>[grayColor.withOpacity(0.5), grayColor],
  34. stops: const <double>[0.313, 1],
  35. );
  36. // AppTheme({this.secondaryColor});
  37. }
  38. MaterialColor buildMaterialColor(Color color) {
  39. List strengths = <double>[.05];
  40. Map<int, Color> swatch = <int, Color>{};
  41. final int r = color.red, g = color.green, b = color.blue;
  42. for (int i = 1; i < 10; i++) {
  43. strengths.add(0.1 * i);
  44. }
  45. for (var strength in strengths) {
  46. final double ds = 0.5 - strength;
  47. swatch[(strength * 1000).round()] = Color.fromRGBO(
  48. r + ((ds < 0 ? r : (255 - r)) * ds).round(),
  49. g + ((ds < 0 ? g : (255 - g)) * ds).round(),
  50. b + ((ds < 0 ? b : (255 - b)) * ds).round(),
  51. 1,
  52. );
  53. }
  54. return MaterialColor(color.value, swatch);
  55. }