Advertisement
Guest User

Untitled

a guest
Sep 10th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.85 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:share/share.dart';
  3. import 'package:tanamduit/Helpers/TanamDuitNavigator.dart';
  4. import 'package:tanamduit/Utils/ColorCollections.dart';
  5. import 'package:tanamduit/Utils/UserLanguage.dart';
  6. import 'package:tanamduit/View/Pages/GoldPushPages.dart';
  7. import 'package:tanamduit/View/Pages/HelpCenter/GoldHelpCenter.dart';
  8. import 'package:tanamduit/View/Pages/gold/ColletionCardOptions.dart';
  9. import 'package:tanamduit/View/Pages/gold/emas-suka-suka/GoldProductBuy.dart';
  10. import 'package:tanamduit/Models/DynamicLinks/BaseDynamicLinks.dart';
  11.  
  12. class GoldProductPage extends StatefulWidget {
  13. final String language;
  14.  
  15. const GoldProductPage({Key key, this.language}) : super(key: key);
  16.  
  17. @override
  18. _GoldProductPageState createState() => new _GoldProductPageState();
  19. }
  20.  
  21. class _GoldProductPageState extends State<GoldProductPage> {
  22. final BaseDynamicLinks _dynamicLinkService = BaseDynamicLinks();
  23.  
  24. @override
  25. Widget build(BuildContext context) {
  26. return WillPopScope(
  27. onWillPop: () {
  28. Navigator.of(context).pop();
  29. return;
  30. },
  31. child: GoldPushPages(
  32. toolbarTitle: UserLanguage.stringCollections[widget.language]
  33. ['labelGold'],
  34. language: widget.language,
  35. elevation: 0,
  36. resizeToAvoidBottomPadding: false,
  37. // toolbarColor: ColorCollections.goldGradientEnd,
  38. // bottom: new PreferredSize(
  39. // preferredSize: new Size.fromHeight(48.0),
  40. // child: Image.asset(
  41. // 'assets/images/bg_gold.png',
  42. // fit: BoxFit.fill,
  43. // ),
  44. // ),
  45. onClosing: () {
  46. Navigator.of(context).pop();
  47. },
  48. buildBody: buildBody,
  49. ),
  50. );
  51. }
  52.  
  53. Widget buildBody(BuildContext context, {Key key}) {
  54. return Column(
  55. children: <Widget>[
  56. Expanded(
  57. child: ListView(
  58. children: <Widget>[
  59. Container(
  60. height: 180,
  61. padding: const EdgeInsets.fromLTRB(20, 0, 10, 0),
  62. child: Row(
  63. mainAxisAlignment: MainAxisAlignment.spaceAround,
  64. children: <Widget>[
  65. Flexible(
  66. child: Text(
  67. UserLanguage.stringCollections[widget.language]['descGoldEntryPageIntro'],
  68. softWrap: true,
  69. style: TextStyle(
  70. color: Colors.black,
  71. fontWeight: FontWeight.w500,
  72. fontSize: 18),
  73. ),
  74. ),
  75. SizedBox(width: 20),
  76. Image.asset(
  77. 'assets/images/gold_famous.png',
  78. width: 180,
  79. )
  80. ],
  81. ),
  82. ),
  83. GestureDetector(
  84. onTap: () {
  85. TanamDuitNavigator.present(context,
  86. child: ColletionCardOptions(language: widget.language));
  87. },
  88. child: Container(
  89. margin: EdgeInsets.fromLTRB(20, 0, 20, 10),
  90. height: 200,
  91. child: Stack(
  92. children: <Widget>[
  93. Container(
  94. height: 150,
  95. decoration: BoxDecoration(
  96. borderRadius: BorderRadius.circular(10),
  97. color: Color(0xFFEFFBFF),
  98. boxShadow: [
  99. BoxShadow(
  100. color: Colors.grey[300],
  101. spreadRadius: 0.5,
  102. blurRadius: 5,
  103. offset:
  104. Offset(0, 2), // changes position of shadow
  105. ),
  106. ],
  107. ),
  108. ),
  109. Positioned.fill(
  110. child: Stack(
  111. children: <Widget>[
  112. Padding(
  113. padding: const EdgeInsets.all(15),
  114. child: Column(
  115. crossAxisAlignment: CrossAxisAlignment.start,
  116. children: <Widget>[
  117. Text(
  118. UserLanguage
  119. .stringCollections[widget.language]
  120. ['labelMyGoldCollections'],
  121. style: TextStyle(
  122. fontSize: 18,
  123. fontWeight: FontWeight.w500,
  124. color: Colors.black),
  125. ),
  126. SizedBox(height: 10),
  127. Text(
  128. UserLanguage.stringCollections[widget.language]['descGoldEntryCollectionIntro'],
  129. overflow: TextOverflow.fade,
  130. style: TextStyle(color: Colors.black54),
  131. ),
  132. SizedBox(height: 15),
  133. Container(
  134. decoration: BoxDecoration(
  135. borderRadius: BorderRadius.circular(10),
  136. color: Colors.yellow[700]),
  137. padding: EdgeInsets.all(10),
  138. child: Text(
  139. UserLanguage.stringCollections[widget.language]['btnGoldCollection'],
  140. style: TextStyle(
  141. color: Colors.black,
  142. fontWeight: FontWeight.bold,
  143. ),
  144. ),
  145. ),
  146. ],
  147. ),
  148. ),
  149. Positioned(
  150. top: -1,
  151. right: 1,
  152. child: Image.asset(
  153. "assets/images/ilus_kartu_emas.png",
  154. width: 180,
  155. height: 180,
  156. ),
  157. )
  158. ],
  159. ),
  160. ),
  161. ],
  162. ),
  163. ),
  164. ),
  165. GestureDetector(
  166. onTap: () {
  167. TanamDuitNavigator.present(
  168. context,
  169. child: GoldProductBuy(
  170. language: widget.language,
  171. ),
  172. );
  173. },
  174. child: Container(
  175. margin: EdgeInsets.fromLTRB(20, 0, 20, 10),
  176. height: 200,
  177. child: Stack(
  178. children: <Widget>[
  179. Container(
  180. height: 150,
  181. decoration: BoxDecoration(
  182. borderRadius: BorderRadius.circular(10),
  183. color: Color(0xFFEFFBFF),
  184. boxShadow: [
  185. BoxShadow(
  186. color: Colors.grey[300],
  187. spreadRadius: 0.5,
  188. blurRadius: 5,
  189. offset:
  190. Offset(0, 2), // changes position of shadow
  191. ),
  192. ],
  193. ),
  194. ),
  195. Positioned.fill(
  196. child: Stack(
  197. children: <Widget>[
  198. Padding(
  199. padding: const EdgeInsets.all(15),
  200. child: Column(
  201. crossAxisAlignment: CrossAxisAlignment.start,
  202. children: <Widget>[
  203. Text(
  204. "Emas Suka-Suka",
  205. style: TextStyle(
  206. fontSize: 18,
  207. fontWeight: FontWeight.w500,
  208. color: Colors.black),
  209. ),
  210. SizedBox(height: 10),
  211. Text(
  212. "Beli emas berapapun,\nsuka-suka kamu aja!",
  213. overflow: TextOverflow.fade,
  214. style: TextStyle(color: Colors.black54),
  215. ),
  216. SizedBox(height: 15),
  217. Text(
  218. "COMING SOON",
  219. style: TextStyle(
  220. color: Colors.black,
  221. fontWeight: FontWeight.bold,
  222. letterSpacing: 1.5),
  223. ),
  224. ],
  225. ),
  226. ),
  227. Positioned(
  228. top: -1,
  229. right: 1,
  230. child: Image.asset(
  231. "assets/images/ilus_emas_suka2.png",
  232. width: 180,
  233. height: 180,
  234. ),
  235. )
  236. ],
  237. ),
  238. ),
  239. ],
  240. ),
  241. ),
  242. ),
  243. GestureDetector(
  244. child: Container(
  245. height: 50,
  246. width: 100,
  247. child: FutureBuilder<Uri>(
  248. future: _dynamicLinkService.createDynamicLink(),
  249. builder: (context, snapshot) {
  250. if(snapshot.hasData) {
  251. Uri uri = snapshot.data;
  252. return FloatingActionButton(
  253. backgroundColor: Colors.amber,
  254. onPressed: () => Share.share(uri.toString()),
  255. child: Text('Share'),
  256. );
  257. } else {
  258. return Container();
  259. }
  260. }
  261. ),
  262. ),
  263. ),
  264. Image.asset(
  265. 'assets/images/ilus_buy_gold.png',
  266. height: 180,
  267. ),
  268. SizedBox(width: 10),
  269. ],
  270. ),
  271. ),
  272. GestureDetector(
  273. onTap: () {
  274. TanamDuitNavigator.present(
  275. context,
  276. child: GoldHelpCenter(
  277. language: widget.language,
  278. id: "360008746072",
  279. ),
  280. );
  281. },
  282. child: Container(
  283. padding: EdgeInsets.all(20),
  284. color: Color(0xFFEFFBFF),
  285. child: Row(
  286. children: <Widget>[
  287. Expanded(
  288. child: Column(
  289. crossAxisAlignment: CrossAxisAlignment.start,
  290. children: <Widget>[
  291. Text(
  292. UserLanguage.stringCollections[widget.language]['labelAboutGold'],
  293. style: TextStyle(
  294. color: Colors.black,
  295. fontWeight: FontWeight.w800,
  296. ),
  297. ),
  298. SizedBox(height: 10),
  299. Text(
  300. UserLanguage.stringCollections[widget.language]['btnLearnMoreAboutGold'],
  301. style: TextStyle(
  302. color: Colors.black54,
  303. ),
  304. ),
  305. ],
  306. ),
  307. ),
  308. SizedBox(width: 10),
  309. Image.asset(
  310. 'assets/icon/icon_ask_gold.png',
  311. height: 50,
  312. ),
  313. SizedBox(width: 10),
  314. Icon(
  315. Icons.keyboard_arrow_right,
  316. color: ColorCollections.grayFreeText,
  317. )
  318. ],
  319. ),
  320. ),
  321. ),
  322. ],
  323. );
  324. }
  325. }
  326.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement