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.

226 lines
9.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_svg/flutter_svg.dart';
  3. import 'package:my_flutter_puzzle/utils/extensions/context_extension.dart';
  4. import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
  5. class LoseScreen extends StatefulWidget {
  6. final int move;
  7. final int tiles;
  8. const LoseScreen({
  9. Key? key,
  10. required this.tiles,
  11. required this.move,
  12. }) : super(key: key);
  13. @override
  14. State<LoseScreen> createState() => _LoseScreenState();
  15. }
  16. class _LoseScreenState extends State<LoseScreen> {
  17. @override
  18. Widget build(BuildContext context) {
  19. return Scaffold(
  20. backgroundColor: const Color(0xffA7A7A7),
  21. body: SizedBox(
  22. width: context.width,
  23. height: context.height,
  24. child: Stack(
  25. alignment: AlignmentDirectional.centerEnd,
  26. children: [
  27. Center(
  28. child: Stack(
  29. alignment: Alignment.bottomCenter,
  30. children: [
  31. Container(
  32. width: context.width * 267 / 812,
  33. height: context.height * 284 / 375,
  34. decoration: BoxDecoration(
  35. gradient: const LinearGradient(
  36. colors: [
  37. Color(0xffB9B9B9),
  38. Color(0xffD1D1D1),
  39. ],
  40. begin: Alignment.topCenter,
  41. end: Alignment.bottomCenter,
  42. ),
  43. borderRadius: BorderRadius.circular(36),
  44. ),
  45. child: Column(
  46. children: [
  47. const SizedBox(height: 31),
  48. const Text(
  49. 'Opsssss !',
  50. style: TextStyle(
  51. color: Colors.white,
  52. fontSize: 25,
  53. fontWeight: FontWeight.bold,
  54. ),
  55. ),
  56. const SizedBox(height: 24),
  57. Container(
  58. width: context.width * 114 / 812,
  59. height: context.width * 114 / 812,
  60. decoration: BoxDecoration(
  61. color: const Color(0xffC0C0C0),
  62. shape: BoxShape.circle,
  63. border: Border.all(
  64. color: const Color(0xff7a7a7a),
  65. width: 1,
  66. ),
  67. ),
  68. child: Container(
  69. margin: EdgeInsets.all(context.width * 20 / 812),
  70. padding: EdgeInsets.all(context.width * 20 / 812),
  71. decoration: const BoxDecoration(
  72. color: Color(0xffE02020),
  73. shape: BoxShape.circle,
  74. ),
  75. child: SvgPicture.asset(
  76. 'sad'.svgPath,
  77. colorFilter: const ColorFilter.mode(
  78. Colors.white,
  79. BlendMode.srcIn,
  80. ),
  81. ),
  82. ),
  83. ),
  84. const SizedBox(height: 19),
  85. Row(
  86. mainAxisAlignment: MainAxisAlignment.center,
  87. children: [
  88. Row(
  89. children: [
  90. const Text(
  91. 'Tiles',
  92. style: TextStyle(
  93. color: Colors.white,
  94. fontSize: 13,
  95. fontWeight: FontWeight.bold,
  96. ),
  97. ),
  98. const SizedBox(width: 9),
  99. Text(
  100. '${widget.tiles}',
  101. style: const TextStyle(
  102. decoration: TextDecoration.underline,
  103. color: Colors.white,
  104. fontSize: 13,
  105. fontWeight: FontWeight.bold,
  106. ),
  107. ),
  108. ],
  109. ),
  110. const SizedBox(width: 42),
  111. Row(
  112. children: [
  113. const Text(
  114. 'Move',
  115. style: TextStyle(
  116. color: Colors.white,
  117. fontSize: 13,
  118. fontWeight: FontWeight.bold,
  119. ),
  120. ),
  121. const SizedBox(width: 9),
  122. Text(
  123. '${widget.move}',
  124. style: const TextStyle(
  125. decoration: TextDecoration.underline,
  126. color: Colors.white,
  127. fontSize: 13,
  128. fontWeight: FontWeight.bold,
  129. ),
  130. ),
  131. ],
  132. ),
  133. ],
  134. ),
  135. ],
  136. ),
  137. ),
  138. Transform.translate(
  139. offset: const Offset(0, 20),
  140. child: GestureDetector(
  141. onTap: () {
  142. Navigator.pop(context, true);
  143. },
  144. child: Container(
  145. width: context.width * 147 / 812,
  146. height: context.height * 51 / 375,
  147. padding: const EdgeInsets.all(3),
  148. decoration: BoxDecoration(
  149. color: const Color(0xff979797).withOpacity(0.12),
  150. borderRadius: BorderRadius.circular(36),
  151. ),
  152. child: Container(
  153. decoration: BoxDecoration(
  154. borderRadius: BorderRadius.circular(31),
  155. gradient: const LinearGradient(
  156. colors: [
  157. Color(0xffFFC600),
  158. Color(0xffFF5A00),
  159. ],
  160. begin: Alignment.topCenter,
  161. end: Alignment.bottomCenter,
  162. ),
  163. ),
  164. child: Row(
  165. mainAxisAlignment: MainAxisAlignment.center,
  166. children: [
  167. const SizedBox(width: 6),
  168. Container(
  169. width: context.width * 26 / 540,
  170. height: context.width * 26 / 540,
  171. padding: const EdgeInsets.all(9),
  172. margin: const EdgeInsets.symmetric(vertical: 3),
  173. decoration: BoxDecoration(
  174. border: Border.all(
  175. color: Colors.white,
  176. width: 1,
  177. ),
  178. gradient: const LinearGradient(
  179. colors: [
  180. Colors.white,
  181. Color(0xffD5D5D5),
  182. ],
  183. begin: Alignment.topCenter,
  184. end: Alignment.bottomCenter,
  185. ),
  186. shape: BoxShape.circle,
  187. ),
  188. child: SvgPicture.asset('refresh'.svgPath),
  189. ),
  190. const SizedBox(width: 8),
  191. const Text(
  192. 'Restart',
  193. style: TextStyle(
  194. color: Colors.white,
  195. fontSize: 14,
  196. fontWeight: FontWeight.bold,
  197. ),
  198. ),
  199. const SizedBox(width: 14),
  200. ],
  201. ),
  202. ),
  203. ),
  204. ),
  205. ),
  206. ],
  207. ),
  208. ),
  209. Container(
  210. margin: EdgeInsetsDirectional.only(end: context.width * 68 / 812),
  211. width: context.width * 142 / 812,
  212. height: context.height * 280 / 375,
  213. child: Image(
  214. image: AssetImage('avatar'.pngPath),
  215. ),
  216. ),
  217. ],
  218. ),
  219. ),
  220. );
  221. }
  222. }