Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:share/share.dart';
- import 'package:tanamduit/Helpers/TanamDuitNavigator.dart';
- import 'package:tanamduit/Utils/ColorCollections.dart';
- import 'package:tanamduit/Utils/UserLanguage.dart';
- import 'package:tanamduit/View/Pages/GoldPushPages.dart';
- import 'package:tanamduit/View/Pages/HelpCenter/GoldHelpCenter.dart';
- import 'package:tanamduit/View/Pages/gold/ColletionCardOptions.dart';
- import 'package:tanamduit/View/Pages/gold/emas-suka-suka/GoldProductBuy.dart';
- import 'package:tanamduit/Models/DynamicLinks/BaseDynamicLinks.dart';
- class GoldProductPage extends StatefulWidget {
- final String language;
- const GoldProductPage({Key key, this.language}) : super(key: key);
- @override
- _GoldProductPageState createState() => new _GoldProductPageState();
- }
- class _GoldProductPageState extends State<GoldProductPage> {
- final BaseDynamicLinks _dynamicLinkService = BaseDynamicLinks();
- @override
- Widget build(BuildContext context) {
- return WillPopScope(
- onWillPop: () {
- Navigator.of(context).pop();
- return;
- },
- child: GoldPushPages(
- toolbarTitle: UserLanguage.stringCollections[widget.language]
- ['labelGold'],
- language: widget.language,
- elevation: 0,
- resizeToAvoidBottomPadding: false,
- // toolbarColor: ColorCollections.goldGradientEnd,
- // bottom: new PreferredSize(
- // preferredSize: new Size.fromHeight(48.0),
- // child: Image.asset(
- // 'assets/images/bg_gold.png',
- // fit: BoxFit.fill,
- // ),
- // ),
- onClosing: () {
- Navigator.of(context).pop();
- },
- buildBody: buildBody,
- ),
- );
- }
- Widget buildBody(BuildContext context, {Key key}) {
- return Column(
- children: <Widget>[
- Expanded(
- child: ListView(
- children: <Widget>[
- Container(
- height: 180,
- padding: const EdgeInsets.fromLTRB(20, 0, 10, 0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: <Widget>[
- Flexible(
- child: Text(
- UserLanguage.stringCollections[widget.language]['descGoldEntryPageIntro'],
- softWrap: true,
- style: TextStyle(
- color: Colors.black,
- fontWeight: FontWeight.w500,
- fontSize: 18),
- ),
- ),
- SizedBox(width: 20),
- Image.asset(
- 'assets/images/gold_famous.png',
- width: 180,
- )
- ],
- ),
- ),
- GestureDetector(
- onTap: () {
- TanamDuitNavigator.present(context,
- child: ColletionCardOptions(language: widget.language));
- },
- child: Container(
- margin: EdgeInsets.fromLTRB(20, 0, 20, 10),
- height: 200,
- child: Stack(
- children: <Widget>[
- Container(
- height: 150,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10),
- color: Color(0xFFEFFBFF),
- boxShadow: [
- BoxShadow(
- color: Colors.grey[300],
- spreadRadius: 0.5,
- blurRadius: 5,
- offset:
- Offset(0, 2), // changes position of shadow
- ),
- ],
- ),
- ),
- Positioned.fill(
- child: Stack(
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.all(15),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- UserLanguage
- .stringCollections[widget.language]
- ['labelMyGoldCollections'],
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w500,
- color: Colors.black),
- ),
- SizedBox(height: 10),
- Text(
- UserLanguage.stringCollections[widget.language]['descGoldEntryCollectionIntro'],
- overflow: TextOverflow.fade,
- style: TextStyle(color: Colors.black54),
- ),
- SizedBox(height: 15),
- Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10),
- color: Colors.yellow[700]),
- padding: EdgeInsets.all(10),
- child: Text(
- UserLanguage.stringCollections[widget.language]['btnGoldCollection'],
- style: TextStyle(
- color: Colors.black,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ],
- ),
- ),
- Positioned(
- top: -1,
- right: 1,
- child: Image.asset(
- "assets/images/ilus_kartu_emas.png",
- width: 180,
- height: 180,
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- GestureDetector(
- onTap: () {
- TanamDuitNavigator.present(
- context,
- child: GoldProductBuy(
- language: widget.language,
- ),
- );
- },
- child: Container(
- margin: EdgeInsets.fromLTRB(20, 0, 20, 10),
- height: 200,
- child: Stack(
- children: <Widget>[
- Container(
- height: 150,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10),
- color: Color(0xFFEFFBFF),
- boxShadow: [
- BoxShadow(
- color: Colors.grey[300],
- spreadRadius: 0.5,
- blurRadius: 5,
- offset:
- Offset(0, 2), // changes position of shadow
- ),
- ],
- ),
- ),
- Positioned.fill(
- child: Stack(
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.all(15),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- "Emas Suka-Suka",
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w500,
- color: Colors.black),
- ),
- SizedBox(height: 10),
- Text(
- "Beli emas berapapun,\nsuka-suka kamu aja!",
- overflow: TextOverflow.fade,
- style: TextStyle(color: Colors.black54),
- ),
- SizedBox(height: 15),
- Text(
- "COMING SOON",
- style: TextStyle(
- color: Colors.black,
- fontWeight: FontWeight.bold,
- letterSpacing: 1.5),
- ),
- ],
- ),
- ),
- Positioned(
- top: -1,
- right: 1,
- child: Image.asset(
- "assets/images/ilus_emas_suka2.png",
- width: 180,
- height: 180,
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- GestureDetector(
- child: Container(
- height: 50,
- width: 100,
- child: FutureBuilder<Uri>(
- future: _dynamicLinkService.createDynamicLink(),
- builder: (context, snapshot) {
- if(snapshot.hasData) {
- Uri uri = snapshot.data;
- return FloatingActionButton(
- backgroundColor: Colors.amber,
- onPressed: () => Share.share(uri.toString()),
- child: Text('Share'),
- );
- } else {
- return Container();
- }
- }
- ),
- ),
- ),
- Image.asset(
- 'assets/images/ilus_buy_gold.png',
- height: 180,
- ),
- SizedBox(width: 10),
- ],
- ),
- ),
- GestureDetector(
- onTap: () {
- TanamDuitNavigator.present(
- context,
- child: GoldHelpCenter(
- language: widget.language,
- id: "360008746072",
- ),
- );
- },
- child: Container(
- padding: EdgeInsets.all(20),
- color: Color(0xFFEFFBFF),
- child: Row(
- children: <Widget>[
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- UserLanguage.stringCollections[widget.language]['labelAboutGold'],
- style: TextStyle(
- color: Colors.black,
- fontWeight: FontWeight.w800,
- ),
- ),
- SizedBox(height: 10),
- Text(
- UserLanguage.stringCollections[widget.language]['btnLearnMoreAboutGold'],
- style: TextStyle(
- color: Colors.black54,
- ),
- ),
- ],
- ),
- ),
- SizedBox(width: 10),
- Image.asset(
- 'assets/icon/icon_ask_gold.png',
- height: 50,
- ),
- SizedBox(width: 10),
- Icon(
- Icons.keyboard_arrow_right,
- color: ColorCollections.grayFreeText,
- )
- ],
- ),
- ),
- ),
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement