common_elements.dart 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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(10),
  26. ),
  27. padding: padding ?? EdgeInsets.fromLTRB(50, 16, 50, 16),
  28. side: BorderSide(
  29. width: onPressed == null ? 1 : 2,
  30. color: onPressed == null
  31. ? Colors.grey
  32. : Color.fromRGBO(45, 194, 98, 1.0),
  33. ),
  34. ),
  35. child: Text(
  36. text,
  37. style: TextStyle(
  38. fontWeight: FontWeight.bold,
  39. fontSize: fontSize,
  40. color: onPressed == null ? Colors.grey : Colors.white,
  41. height: lineHeight,
  42. ),
  43. textAlign: TextAlign.center,
  44. ),
  45. onPressed: onPressed,
  46. ),
  47. );
  48. }
  49. final emptyContainer = Container();
  50. Animatable<Color> passwordStrengthColors = TweenSequence<Color>(
  51. [
  52. TweenSequenceItem(
  53. weight: 1.0,
  54. tween: ColorTween(
  55. begin: Colors.red,
  56. end: Colors.yellow,
  57. ),
  58. ),
  59. TweenSequenceItem(
  60. weight: 1.0,
  61. tween: ColorTween(
  62. begin: Colors.yellow,
  63. end: Colors.lightGreen,
  64. ),
  65. ),
  66. TweenSequenceItem(
  67. weight: 1.0,
  68. tween: ColorTween(
  69. begin: Colors.lightGreen,
  70. end: Color.fromRGBO(45, 194, 98, 1.0),
  71. ),
  72. ),
  73. ],
  74. );