Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:flutter/material.dart';
  2. class Background extends StatelessWidget {
  3. const Background({Key? key}) : super(key: key);
  4. @override
  5. Widget build(BuildContext context) {
  6. return Scaffold(
  7. resizeToAvoidBottomInset: false,
  8. backgroundColor: Colors.white,
  9. body: Column(
  10. children: <Widget>[
  11. new Stack(
  12. children: <Widget>[
  13. WavyHeader()
  14. ],
  15. ),
  16. ],
  17. ),
  18. );
  19. }
  20. }
  21. const List<Color> orangeGradients = [
  22. /*Color(0xFFD21404),
  23. Color(0xFFFD7267)*/
  24. //Color(0xFF03A0FE),
  25. Color(0xFF4858A7),
  26. Color(0xFF6474C6),
  27. ];
  28. const List<Color> aquaGradients = [
  29. Color(0xFF8EF7DA),
  30. Color(0xFF5AEAF1),
  31. Colors.blueAccent,
  32. ];
  33. class WavyHeader extends StatelessWidget {
  34. @override
  35. Widget build(BuildContext context) {
  36. return ClipPath(
  37. clipper: TopWaveClipper(),
  38. child: Container(
  39. decoration: BoxDecoration(
  40. gradient: LinearGradient(
  41. colors: orangeGradients,
  42. begin: Alignment.topLeft,
  43. end: Alignment.center),
  44. ),
  45. height: MediaQuery.of(context).size.height / 2.5,
  46. ),
  47. );
  48. }
  49. }
  50. class TopWaveClipper extends CustomClipper<Path> {
  51. @override
  52. Path getClip(Size size) {
  53. // This is where we decide what part of our image is going to be visible.
  54. var path = Path();
  55. path.lineTo(0.0, 0.0);
  56. var firstControlPoint = new Offset(0, size.height - 30);
  57. var firstEndPoint = new Offset(0, size.height / 2);
  58. path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
  59. firstEndPoint.dx, firstEndPoint.dy);
  60. var secondControlPoint = Offset(size.width / 5, size.height / 4);
  61. var secondEndPoint = Offset(size.width / 1.5, size.height / 5);
  62. path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy,
  63. secondEndPoint.dx, secondEndPoint.dy);
  64. var thirdControlPoint =
  65. Offset(size.width - (size.width / 9), size.height / 6);
  66. var thirdEndPoint = Offset(size.width, 0.0);
  67. path.quadraticBezierTo(thirdControlPoint.dx, thirdControlPoint.dy,
  68. thirdEndPoint.dx, thirdEndPoint.dy);
  69. ///move from bottom right to top
  70. path.lineTo(size.width, 0.0);
  71. ///finally close the path by reaching start point from top right corner
  72. path.close();
  73. return path;
  74. }
  75. @override
  76. bool shouldReclip(CustomClipper<Path> oldClipper) => false;
  77. }