Advertisement
ZEdKasat

Untitled

Feb 3rd, 2022
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. // ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
  2.  
  3. import 'package:flutter/material.dart';
  4.  
  5. void main() {
  6. return runApp(const MaterialApp(
  7. home: Home(),
  8. ));
  9. }
  10.  
  11. class Home extends StatefulWidget {
  12. const Home({Key? key}) : super(key: key);
  13.  
  14. @override
  15. State<Home> createState() => _HomeState();
  16. }
  17.  
  18. class _HomeState extends State<Home> {
  19. int userLevel = 0;
  20.  
  21. List<String> quotes = [
  22. "A wise man gets more from his enemies than a fool from his Friends ",
  23. "Mindset is everything",
  24. "You can have the recipe for Success, but you still have to Cook!",
  25. "Learn from the mistakes of others. You can't live long enough to make them all yourself.",
  26. "Man can do what he wills, but he cannot will what he wills."
  27. ];
  28.  
  29. @override
  30. Widget build(BuildContext context) {
  31. return Scaffold(
  32. backgroundColor: Colors.grey[900],
  33. appBar: AppBar(
  34. title: const Text("Profile"),
  35. centerTitle: true,
  36. backgroundColor: Colors.grey[800],
  37. ),
  38. body: Padding(
  39. padding: const EdgeInsets.fromLTRB(30, 20, 30, 0),
  40. child: Column(
  41. crossAxisAlignment: CrossAxisAlignment.start,
  42. children: [
  43. Center(
  44. child: CircleAvatar(
  45. radius: 80,
  46. backgroundImage: NetworkImage(
  47. "https://images.unsplash.com/photo-1601645191163-3fc0d5d64e35?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=735&q=80"),
  48. ),
  49. ),
  50. Divider(
  51. height: 50,
  52. color: Colors.grey[600],
  53. ),
  54. Column(
  55. children: [
  56. Text(
  57. "NAME",
  58. style: TextStyle(
  59. color: Colors.grey[400], fontWeight: FontWeight.bold),
  60. ),
  61. Text(
  62. "Bruce Wayne",
  63. style: TextStyle(color: Colors.amber, fontSize: 25),
  64. )
  65. ],
  66. crossAxisAlignment: CrossAxisAlignment.start,
  67. ),
  68. SizedBox(
  69. height: 20,
  70. ),
  71. Column(
  72. children: [
  73. Text(
  74. "AGE",
  75. style: TextStyle(
  76. color: Colors.grey[400], fontWeight: FontWeight.bold),
  77. ),
  78. Text(
  79. "24",
  80. style: TextStyle(color: Colors.amber, fontSize: 25),
  81. )
  82. ],
  83. crossAxisAlignment: CrossAxisAlignment.start,
  84. ),
  85. SizedBox(
  86. height: 20,
  87. ),
  88. Row(
  89. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  90. children: [
  91. Column(
  92. children: [
  93. Text(
  94. "GENDER",
  95. style: TextStyle(
  96. color: Colors.grey[400], fontWeight: FontWeight.bold),
  97. ),
  98. Text(
  99. 'Male',
  100. style: TextStyle(color: Colors.amber, fontSize: 25),
  101. )
  102. ],
  103. crossAxisAlignment: CrossAxisAlignment.start,
  104. ),
  105. Column(
  106. children: [
  107. Text(
  108. "LEVEL",
  109. style: TextStyle(
  110. color: Colors.grey[400], fontWeight: FontWeight.bold),
  111. ),
  112. Text(
  113. '$userLevel',
  114. style: TextStyle(color: Colors.amber, fontSize: 25),
  115. )
  116. ],
  117. crossAxisAlignment: CrossAxisAlignment.start,
  118. ),
  119. ],
  120. ),
  121. Center(
  122. child: OutlinedButton.icon(
  123. onPressed: () {},
  124. icon: Icon(
  125. Icons.email,
  126. color: Colors.amber,
  127. ),
  128. label: Text(
  129. "bruce@wayne.tech",
  130. style: TextStyle(color: Colors.amber, fontSize: 25),
  131. ),
  132. ),
  133. ),
  134. Column(
  135. children: quotes.map((q) {
  136. return Container(
  137. color: Colors.grey[800],
  138. margin: EdgeInsets.symmetric(vertical: 1, horizontal: 0),
  139. padding: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
  140. child: Text(
  141. q,
  142. style: TextStyle(color: Colors.amber),
  143. ),
  144. );
  145. }).toList(),
  146. ),
  147. Row(
  148. children: [
  149. Expanded(
  150. flex: 2,
  151. child: Container(
  152. color: Colors.blue,
  153. height: 80,
  154. child: Center(child: Text("1")),
  155. ),
  156. ),
  157. Expanded(
  158. flex: 1,
  159. child: Container(
  160. color: Colors.green,
  161. height: 80,
  162. width: 80,
  163. child: Center(child: Text("2")),
  164. ),
  165. ),
  166. Expanded(
  167. flex: 3,
  168. child: Container(
  169. color: Colors.red,
  170. height: 80,
  171. width: 80,
  172. child: Center(child: Text("3")),
  173. ),
  174. ),
  175. ],
  176. )
  177. ],
  178. ),
  179. ),
  180. floatingActionButton: FloatingActionButton(
  181. onPressed: () {
  182. setState(() {
  183. userLevel += 1;
  184. });
  185. },
  186. child: const Icon(Icons.arrow_upward_rounded),
  187. backgroundColor: Colors.grey[800],
  188. ),
  189. );
  190. }
  191. }
  192.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement