Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.77 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3.  
  4. void main() {
  5. // Untuk Tetap Potrait
  6. SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_){
  7. runApp(MyApp());
  8. });
  9. }
  10.  
  11. class MyApp extends StatelessWidget {
  12. @override
  13. Widget build(BuildContext context) {
  14. return MaterialApp(
  15. // Menghilangkan Label Debug
  16. debugShowCheckedModeBanner: false,
  17. home: MainPage(),
  18. );
  19. }
  20. }
  21.  
  22. class MainPage extends StatelessWidget {
  23. double getSmallDiameter(BuildContext context) =>
  24. MediaQuery.of(context).size.width * 2 / 3;
  25. double getBigDiameter(BuildContext context) =>
  26. MediaQuery.of(context).size.width * 7 / 8;
  27. @override
  28. Widget build(BuildContext context) {
  29. return Scaffold(
  30. backgroundColor: Color(0xFFEEEEEE),
  31. body: Stack(
  32. children: <Widget>[
  33. Positioned(
  34. right: -getSmallDiameter(context) / 3,
  35. top: -getSmallDiameter(context) / 3,
  36. child: Container(
  37. width: getSmallDiameter(context),
  38. height: getSmallDiameter(context),
  39. decoration: BoxDecoration(
  40. shape: BoxShape.circle,
  41. gradient: LinearGradient(
  42. colors: [Color(0xFFB226B2), Color(0xFFFF6DA7)],
  43. begin: Alignment.topCenter,
  44. end: Alignment.bottomCenter)),
  45. ),
  46. ),
  47. Positioned(
  48. left: -getBigDiameter(context) / 4,
  49. top: -getBigDiameter(context) / 4,
  50. child: Container(
  51. child: Center(
  52. child: Text(
  53. "logo",
  54. style: TextStyle(
  55. fontFamily: 'Pacifico',
  56. fontSize: 30,
  57. color: Colors.white),
  58. ),
  59. ),
  60. width: getBigDiameter(context),
  61. height: getBigDiameter(context),
  62. decoration: BoxDecoration(
  63. shape: BoxShape.circle,
  64. gradient: LinearGradient(
  65. colors: [Color(0xFFB226B2), Color(0xFFFF6DA7)],
  66. begin: Alignment.topCenter,
  67. end: Alignment.bottomCenter)),
  68. ),
  69. ),
  70. Positioned(
  71. right: -getBigDiameter(context) / 2,
  72. bottom: -getBigDiameter(context) / 2,
  73. child: Container(
  74. width: getBigDiameter(context),
  75. height: getBigDiameter(context),
  76. decoration: BoxDecoration(
  77. shape: BoxShape.circle, color: Color(0xFFF3E9EE)),
  78. ),
  79. ),
  80. Align(
  81. alignment: Alignment.bottomCenter,
  82. child: ListView(
  83. children: <Widget>[
  84. Container(
  85. decoration: BoxDecoration(
  86. color: Colors.white,
  87. border: Border.all(color: Colors.grey),
  88. borderRadius: BorderRadius.circular(5)),
  89. margin: EdgeInsets.fromLTRB(20, 300, 20, 10),
  90. padding: EdgeInsets.fromLTRB(10, 0, 10, 25),
  91. child: Column(
  92. children: <Widget>[
  93. TextField(
  94. decoration: InputDecoration(
  95. icon: Icon(Icons.email, color: Color(0xFFFF4891)),
  96. focusedBorder: UnderlineInputBorder(
  97. borderSide:
  98. BorderSide(color: Color(0xFFFF4891))),
  99. labelText: "Email ",
  100. labelStyle: TextStyle(color: Color(0xFFFF4891))),
  101. ),
  102. TextField(
  103. obscureText: true,
  104. decoration: InputDecoration(
  105. icon: Icon(Icons.vpn_key, color: Color(0xFFFF4891)),
  106. focusedBorder: UnderlineInputBorder(
  107. borderSide:
  108. BorderSide(color: Color(0xFFFF4891))),
  109. labelText: "Password ",
  110. labelStyle: TextStyle(color: Color(0xFFFF4891))),
  111. ),
  112. ],
  113. ),
  114. ),
  115. Align(
  116. alignment: Alignment.centerRight,
  117. child: Container(
  118. margin: EdgeInsets.fromLTRB(0, 0, 20, 20),
  119. child: Text(
  120. "FORGOT PASSWORD?",
  121. style: TextStyle(color: Color(0xFFFF4891)),
  122. ),
  123. ),
  124. ),
  125. Container(
  126. margin: EdgeInsets.fromLTRB(20, 0, 20, 30),
  127. child: Row(
  128. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  129. children: <Widget>[
  130. SizedBox(
  131. width: MediaQuery.of(context).size.width * 0.5,
  132. height: 40,
  133. child: Container(
  134. child: Material(
  135. borderRadius: BorderRadius.circular(20),
  136. color: Colors.transparent,
  137. child: InkWell(
  138. borderRadius: BorderRadius.circular(20),
  139. splashColor: Colors.amber,
  140. onTap: () {},
  141. child: Center(
  142. child: Text(
  143. "SIGN IN",
  144. style: TextStyle(
  145. color: Colors.white,
  146. fontWeight: FontWeight.w700),
  147. ),
  148. ),
  149. ),
  150. ),
  151. decoration: BoxDecoration(
  152. borderRadius: BorderRadius.circular(20),
  153. gradient: LinearGradient(
  154. colors: [Color(0xFFB226B2), Color(0xFFFF6DA7)],
  155. begin: Alignment.topCenter,
  156. end: Alignment.bottomCenter,
  157. )),
  158. ),
  159. ),
  160. FloatingActionButton(
  161. onPressed: () {},
  162. mini: true,
  163. elevation: 0,
  164. child: Image(
  165. image: AssetImage("assets/facebook.png"),
  166. ),
  167. ),
  168. FloatingActionButton(
  169. onPressed: () {},
  170. mini: true,
  171. elevation: 0,
  172. child: Image(
  173. image: AssetImage("assets/twitter.png"),
  174. ),
  175. )
  176. ],
  177. ),
  178. ),
  179. Row(
  180. mainAxisAlignment: MainAxisAlignment.center,
  181. children: <Widget>[
  182. Text(
  183. "DONT'T HAVE AN ACCOUNT? ",
  184. style: TextStyle(
  185. fontSize: 11,
  186. color: Colors.grey,
  187. fontWeight: FontWeight.w500,
  188. ),
  189. ),
  190. Text(
  191. "SIGN UP ",
  192. style: TextStyle(
  193. fontSize: 11,
  194. color: Color(0xFFFF4891),
  195. fontWeight: FontWeight.w700,
  196. ),
  197. )
  198. ],
  199. )
  200. ],
  201. ),
  202. ),
  203. ],
  204. ),
  205. );
  206. }
  207. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement