Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'Adapt.dart';
  3. import 'package:flutter/services.dart';
  4. import 'package:d_guide/e_screen/Escreen.dart';
  5. import 'package:d_guide/JoyStick/joy_stick.dart';
  6. import 'setting_page.dart';
  7. import 'mobile_phone_binding.dart';
  8. import 'user_routes.dart';
  9. import 'help_feedback.dart';
  10. import 'package:d_guide/MyProfileG/main_page.dart';
  11.  
  12. class profileMainPage extends StatefulWidget {
  13. @override
  14. profileMainPageState createState() => profileMainPageState();
  15. }
  16.  
  17. class profileMainPageState extends State<profileMainPage> {
  18. var userID = "14525549255";
  19.  
  20. @override
  21. void initState() {
  22. // TODO: implement initState
  23. SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  24. super.initState();
  25. }
  26.  
  27. @override
  28. Widget build(BuildContext context) {
  29. Widget _statusBar = Container(
  30. height: Adapt.px(300),
  31. decoration: BoxDecoration(
  32. image: DecorationImage(
  33. image: AssetImage("assets/images/status_bar.png"),
  34. fit: BoxFit.fitWidth,
  35. ),
  36. ),
  37. child: Stack(
  38. children: <Widget>[
  39. //Setting Button
  40. Align(
  41. alignment: Alignment.topRight,
  42. child: IconButton(
  43. onPressed: () {
  44. Navigator.push(context,
  45. MaterialPageRoute(builder: (context) => SettingPage()));
  46. },
  47. icon: Icon(
  48. Icons.settings,
  49. color: Theme.of(context).primaryColor,
  50. size: Adapt.px(60),
  51. ),
  52. ),
  53. ),
  54. //Username and update button
  55. Align(
  56. alignment: Alignment.centerLeft,
  57. child: Text(
  58. userID,
  59. style: TextStyle(fontSize: 20.0),
  60. ),
  61. ),
  62. Align(
  63. alignment: Alignment.centerRight,
  64. child: FlatButton(
  65. onPressed: () {
  66. Navigator.push(
  67. context,
  68. MaterialPageRoute(
  69. builder: (context) => MobilePhoneBinding()));
  70. },
  71. child: Row(
  72. children: <Widget>[
  73. Text(
  74. "Update Phone Number",
  75. style: Theme.of(context).textTheme.caption,
  76. ),
  77. Icon(
  78. Icons.keyboard_arrow_right,
  79. color: Theme.of(context).textTheme.caption.color,
  80. ),
  81. ],
  82. ),
  83. ))
  84. ],
  85. ),
  86. );
  87.  
  88. Widget _info = Container(
  89. decoration: BoxDecoration(color: Colors.white),
  90. margin: EdgeInsets.symmetric(vertical: Adapt.px(20)),
  91. padding: EdgeInsets.symmetric(vertical: 8),
  92. child: Column(
  93. children: <Widget>[
  94. ListTile(
  95. leading: Image.asset("assets/images/my_route.png"),
  96. title: Text("My Routes"),
  97. trailing: Icon(Icons.keyboard_arrow_right),
  98. onTap: () {
  99. Navigator.pushNamed(context, "/userRoutes");
  100. },
  101. ),
  102. Divider(),
  103. ListTile(
  104. leading: Image.asset("assets/images/HF.png"),
  105. title: Text("FAQ & Feedback"),
  106. trailing: Icon(Icons.keyboard_arrow_right),
  107. onTap: () {
  108. Navigator.pushNamed(context, "/helpFeedback");
  109. },
  110. ),
  111. ],
  112. ),
  113. );
  114.  
  115. return MaterialApp(
  116. title: 'StatusBar',
  117. theme: ThemeData(
  118. primarySwatch: Colors.blue,
  119. scaffoldBackgroundColor: Color.fromRGBO(237, 237, 237, 1.0),
  120. ),
  121. home: Scaffold(
  122. body: Container(
  123. child: ListView(
  124. children: <Widget>[
  125. _statusBar,
  126. Divider(
  127. height: 1,
  128. ),
  129. _info,
  130. ],
  131. ),
  132. ),
  133. ),
  134. );
  135. }
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement