Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.40 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_ticket_widget/flutter_ticket_widget.dart';
  3. import 'package:icofont_flutter/icofont_flutter.dart';
  4. import 'package:memiles/Helper/AppSetting.dart';
  5. import 'package:pigment/pigment.dart';
  6.  
  7. class PromoView extends StatefulWidget {
  8. @override
  9. _PromoViewState createState() => _PromoViewState();
  10. }
  11.  
  12. class _PromoViewState extends State<PromoView>
  13. with SingleTickerProviderStateMixin {
  14. TabController controller;
  15. void initState() {
  16. controller = new TabController(vsync: this, length: 2);
  17. //tambahkan SingleTickerProviderStateMikin pada class _HomeState
  18. super.initState();
  19. }
  20.  
  21. @override
  22. Widget build(BuildContext context) {
  23. return Scaffold(
  24. backgroundColor: ColorMemiles.background,
  25. appBar: AppBar(
  26. title: Text('Promo Detail'),
  27. backgroundColor: ColorMemiles.primary,
  28. ),
  29. body: Container(
  30. height: MediaQuery.of(context).size.height,
  31. padding: EdgeInsets.all(20),
  32. child: SingleChildScrollView(
  33. child: Column(children: <Widget>[
  34. FlutterTicketWidget(
  35. width: MediaQuery.of(context).size.width,
  36. height: 120.0,
  37. isCornerRounded: false,
  38. color: Colors.white,
  39. child: Container(
  40. child: Padding(
  41. padding: const EdgeInsets.all(0.0),
  42. child: Column(
  43. crossAxisAlignment: CrossAxisAlignment.start,
  44. children: <Widget>[
  45. Image.asset(
  46. 'assets/img/imagespromo.png',
  47. height: 120,
  48. width: 1200,
  49. fit: BoxFit.fill,
  50. ),
  51. ])),
  52. )),
  53. Container(
  54. padding: EdgeInsets.all(15),
  55. width: MediaQuery.of(context).size.width,
  56. color: Colors.white,
  57. child: Column(
  58. children: <Widget>[
  59. Text(
  60. 'MeMiles Challenge Assistant Head Marketing #1 awjdijawjid jaisidwaokdow ka',
  61. style: TextStyle(fontWeight: FontWeight.bold)),
  62. SizedBox(
  63. height: 10,
  64. ),
  65. Container(
  66. padding: EdgeInsets.all(10),
  67. // margin: EdgeInsets.all(20),
  68. height: 70,
  69. decoration: BoxDecoration(
  70. color: ColorMemiles.background,
  71. borderRadius: BorderRadius.circular(8)),
  72. child: Row(
  73. mainAxisAlignment: MainAxisAlignment.spaceAround,
  74. children: <Widget>[
  75. Row(
  76. children: <Widget>[
  77. Icon(
  78. IcoFontIcons.money,
  79. color: ColorMemiles.primary,
  80. ),
  81. SizedBox(
  82. width: 10,
  83. ),
  84. Column(
  85. crossAxisAlignment: CrossAxisAlignment.start,
  86. mainAxisAlignment: MainAxisAlignment.center,
  87. children: <Widget>[
  88. Text('Minimal Top UP',
  89. style: TextStyle(color: ColorMemiles.gray)),
  90. Text(
  91. '50 JT',
  92. style: TextStyle(
  93. color: ColorMemiles.netral,
  94. fontWeight: FontWeight.bold),
  95. )
  96. ],
  97. ),
  98. ],
  99. ),
  100. VerticalDivider(),
  101. Row(
  102. children: <Widget>[
  103. Icon(
  104. IcoFontIcons.uiUserGroup,
  105. color: ColorMemiles.primary,
  106. ),
  107. SizedBox(
  108. width: 10,
  109. ),
  110. Column(
  111. crossAxisAlignment: CrossAxisAlignment.start,
  112. mainAxisAlignment: MainAxisAlignment.center,
  113. children: <Widget>[
  114. Text('Kuota Tersisa',
  115. style: TextStyle(color: ColorMemiles.gray)),
  116. Text(
  117. '100',
  118. style: TextStyle(
  119. color: ColorMemiles.netral,
  120. fontWeight: FontWeight.bold),
  121. )
  122. ],
  123. ),
  124. ],
  125. ),
  126. ],
  127. ),
  128. )
  129. ],
  130. ),
  131. ),
  132. SizedBox(height: 40),
  133. Container(
  134. padding: EdgeInsets.all(20),
  135. decoration: BoxDecoration(
  136. color: Colors.white, borderRadius: BorderRadius.circular(20)),
  137. child: Column(
  138. children: <Widget>[
  139. TabBar(
  140. labelColor: ColorMemiles.primary,
  141. unselectedLabelColor: ColorMemiles.gray,
  142. // indicatorSize: TabBarIndicatorSize.label,
  143. indicator: UnderlineTabIndicator(
  144. borderSide:
  145. BorderSide(color: ColorMemiles.primary, width: 2.0),
  146. insets: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
  147. ),
  148. controller: controller,
  149. tabs: <Widget>[
  150. Text(
  151. 'Ketentuan',
  152. style: TextStyle(fontWeight: FontWeight.bold),
  153. ),
  154. Text(
  155. 'Cara Pakai',
  156. style: TextStyle(fontWeight: FontWeight.bold),
  157. )
  158. ],
  159. ),
  160. Container(
  161. padding: EdgeInsets.all(20),
  162. height: 200,
  163. child: TabBarView(
  164. controller: controller,
  165. children: <Widget>[
  166. Text(
  167. '1. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n2. Amet, tincidunt fermentum morbi eget tortor mi velit, mi gravida.\n3. Egestas pellentesque enim elementum eget pulvinar dignissim.\n4. A et aliquam est consectetur duis egestas nulla et, quis.\n5. Ornare feugiat orci maecenas sit.',
  168. style: TextStyle(height: 1.5),
  169. ),
  170. Text('asd')
  171. ],
  172. ),
  173. ),
  174. ],
  175. ),
  176. ),
  177. ]))),
  178. );
  179. }
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement