common_elements.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/widgets.dart';
  3. final nothingToSeeHere = Center(
  4. child: Padding(
  5. padding: const EdgeInsets.all(8.0),
  6. child: Text(
  7. "nothing to see here! 👀",
  8. style: TextStyle(
  9. color: Colors.white30,
  10. ),
  11. ),
  12. ),
  13. );
  14. Widget button(
  15. String text, {
  16. double fontSize = 14,
  17. VoidCallback onPressed,
  18. double lineHeight,
  19. EdgeInsets padding,
  20. }) {
  21. return InkWell(
  22. child: OutlinedButton(
  23. style: OutlinedButton.styleFrom(
  24. shape: RoundedRectangleBorder(
  25. borderRadius: BorderRadius.circular(8),
  26. ),
  27. padding: padding ?? EdgeInsets.fromLTRB(50, 16, 50, 16),
  28. textStyle: TextStyle(
  29. fontWeight: FontWeight.w600,
  30. fontFamily: 'Inter-SemiBold',
  31. fontSize: fontSize,
  32. height: lineHeight,
  33. ),
  34. ).copyWith(
  35. backgroundColor: MaterialStateProperty.resolveWith<Color>(
  36. (Set<MaterialState> states) {
  37. if (states.contains(MaterialState.disabled)) {
  38. return Colors.grey;
  39. }
  40. // return Color.fromRGBO(29, 184, 80, 1);
  41. return Colors.white;
  42. },
  43. ),
  44. foregroundColor: MaterialStateProperty.resolveWith<Color>(
  45. (Set<MaterialState> states) {
  46. if (states.contains(MaterialState.disabled)) {
  47. return Colors.white;
  48. }
  49. return Colors.black;
  50. },
  51. ),
  52. alignment: Alignment.center,
  53. ),
  54. child: Text(text),
  55. onPressed: onPressed,
  56. ),
  57. );
  58. }
  59. final emptyContainer = Container();
  60. Animatable<Color> passwordStrengthColors = TweenSequence<Color>(
  61. [
  62. TweenSequenceItem(
  63. weight: 1.0,
  64. tween: ColorTween(
  65. begin: Colors.red,
  66. end: Colors.yellow,
  67. ),
  68. ),
  69. TweenSequenceItem(
  70. weight: 1.0,
  71. tween: ColorTween(
  72. begin: Colors.yellow,
  73. end: Colors.lightGreen,
  74. ),
  75. ),
  76. TweenSequenceItem(
  77. weight: 1.0,
  78. tween: ColorTween(
  79. begin: Colors.lightGreen,
  80. end: Color.fromRGBO(45, 194, 98, 1.0),
  81. ),
  82. ),
  83. ],
  84. );