GSI - Employe Self Service Mobile
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.9 KiB

2 months ago
  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. alignment: Alignment.bottomCenter,
  13. children: <Widget>[
  14. Container(
  15. alignment: Alignment.bottomCenter,
  16. padding: EdgeInsets.only(top: 0),
  17. child: Image.asset(
  18. 'assets/images/collaboration.png',
  19. width: MediaQuery.of(context).size.width / 1.5,
  20. ),
  21. ),
  22. Container(
  23. margin: EdgeInsets.all(0),
  24. child:
  25. WavyHeader(),
  26. )
  27. ],
  28. ),
  29. Expanded(
  30. child: Container(),
  31. ),
  32. Stack(
  33. alignment: Alignment.bottomLeft,
  34. children: <Widget>[
  35. WavyFooter(),
  36. CirclePink(),
  37. CircleYellow(),
  38. ],
  39. )
  40. ],
  41. ),
  42. );
  43. }
  44. }
  45. const List<Color> orangeGradients = [
  46. Color(0xFF4858A7),
  47. Color(0xFF4858A7),
  48. Color(0xFF6474C6),
  49. ];
  50. const List<Color> aquaGradients = [
  51. /*Color(0xFF8EF7DA),
  52. Color(0xFF5AEAF1),
  53. Colors.blueAccent,*/
  54. Color(0xFFD170AD),
  55. Color(0xFFF19BD1),
  56. ];
  57. class WavyHeader extends StatelessWidget {
  58. @override
  59. Widget build(BuildContext context) {
  60. return ClipPath(
  61. clipper: TopWaveClipper(),
  62. child: Container(
  63. decoration: BoxDecoration(
  64. gradient: LinearGradient(
  65. colors: orangeGradients,
  66. begin: Alignment.topLeft,
  67. end: Alignment.center),
  68. ),
  69. height: MediaQuery.of(context).size.height / 2.5,
  70. ),
  71. );
  72. }
  73. }
  74. class WavyFooter extends StatelessWidget {
  75. @override
  76. Widget build(BuildContext context) {
  77. return ClipPath(
  78. clipper: FooterWaveClipper(),
  79. child: Container(
  80. decoration: BoxDecoration(
  81. gradient: LinearGradient(
  82. colors: aquaGradients,
  83. begin: Alignment.center,
  84. end: Alignment.bottomRight),
  85. ),
  86. height: MediaQuery.of(context).size.height / 3,
  87. ),
  88. );
  89. }
  90. }
  91. class CirclePink extends StatelessWidget {
  92. @override
  93. Widget build(BuildContext context) {
  94. return Transform.translate(
  95. offset: Offset(-70.0, 90.0),
  96. child: Material(
  97. color: Color(0xFF32B44C),
  98. child: Padding(padding: EdgeInsets.all(120)),
  99. shape: CircleBorder(side: BorderSide(color: Colors.white, width: 15.0)),
  100. ),
  101. );
  102. }
  103. }
  104. class CircleYellow extends StatelessWidget {
  105. @override
  106. Widget build(BuildContext context) {
  107. return Transform.translate(
  108. offset: Offset(0.0, 210.0),
  109. child: Material(
  110. color: Color(0xFFFEE612),
  111. child: Padding(padding: EdgeInsets.all(140)),
  112. shape: CircleBorder(side: BorderSide(color: Colors.white, width: 15.0)),
  113. ),
  114. );
  115. }
  116. }
  117. class TopWaveClipper extends CustomClipper<Path> {
  118. @override
  119. Path getClip(Size size) {
  120. // This is where we decide what part of our image is going to be visible.
  121. var path = Path();
  122. path.lineTo(0.0, size.height);
  123. var firstControlPoint = new Offset(size.width / 7, size.height - 30);
  124. var firstEndPoint = new Offset(size.width / 6, size.height / 1.5);
  125. path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
  126. firstEndPoint.dx, firstEndPoint.dy);
  127. var secondControlPoint = Offset(size.width / 5, size.height / 4);
  128. var secondEndPoint = Offset(size.width / 1.5, size.height / 5);
  129. path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy,
  130. secondEndPoint.dx, secondEndPoint.dy);
  131. var thirdControlPoint =
  132. Offset(size.width - (size.width / 9), size.height / 6);
  133. var thirdEndPoint = Offset(size.width, 0.0);
  134. path.quadraticBezierTo(thirdControlPoint.dx, thirdControlPoint.dy,
  135. thirdEndPoint.dx, thirdEndPoint.dy);
  136. ///move from bottom right to top
  137. path.lineTo(size.width, 0.0);
  138. ///finally close the path by reaching start point from top right corner
  139. path.close();
  140. return path;
  141. }
  142. @override
  143. bool shouldReclip(CustomClipper<Path> oldClipper) => false;
  144. }
  145. class FooterWaveClipper extends CustomClipper<Path> {
  146. @override
  147. Path getClip(Size size) {
  148. var path = Path();
  149. path.moveTo(size.width, 0.0);
  150. path.lineTo(size.width, size.height);
  151. path.lineTo(0.0, size.height);
  152. path.lineTo(0.0, size.height - 60);
  153. var secondControlPoint = Offset(size.width - (size.width / 6), size.height);
  154. var secondEndPoint = Offset(size.width, 0.0);
  155. path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy,
  156. secondEndPoint.dx, secondEndPoint.dy);
  157. return path;
  158. }
  159. @override
  160. bool shouldReclip(CustomClipper<Path> oldClipper) => false;
  161. }