common_elements.dart 1.7 KB

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