main.dart 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. import 'package:namer_app/bug/addbug.dart';
  4. import 'package:namer_app/platform/addplatform.dart';
  5. import 'package:namer_app/bug/editbug.dart';
  6. import 'package:namer_app/platform/editplatform.dart';
  7. import 'package:namer_app/user/edituser.dart';
  8. import 'package:namer_app/footer.dart';
  9. import 'package:namer_app/head.dart';
  10. import 'package:namer_app/bug/listbug.dart';
  11. import 'package:namer_app/bug/listcomment.dart';
  12. import 'package:namer_app/listmember.dart';
  13. import 'package:namer_app/platform/listplatform.dart';
  14. import 'package:namer_app/listtable.dart';
  15. import 'package:namer_app/user/listuser.dart';
  16. import 'package:namer_app/login.dart';
  17. import 'package:flutter/rendering.dart';
  18. import 'package:namer_app/user/signup.dart';
  19. void main() {
  20. runApp(MyApp());
  21. }
  22. final _router = GoRouter(
  23. routes: [
  24. GoRoute(path: '/', builder: (context, state) => MyHomePage(), routes: [
  25. GoRoute(path: 'login', builder: (context, state) => LoginPage(), routes: [
  26. GoRoute(
  27. path: 'bug',
  28. builder: (context, state) => ListBugPage(),
  29. routes: [
  30. GoRoute(
  31. path: 'comment',
  32. builder: (context, state) => ListCommentPage(),
  33. ),
  34. GoRoute(
  35. path: 'editbug',
  36. builder: (context, state) => EditBugPage(),
  37. )
  38. ])
  39. ]),
  40. GoRoute(
  41. path: 'signup',
  42. builder: (context, state) => SignupPage(),
  43. routes: [
  44. GoRoute(
  45. path: 'listuser',
  46. builder: (context, state) => ListUserPage(),
  47. routes: [
  48. GoRoute(
  49. path: 'edit',
  50. builder: (context, state) => EditUserPage(),
  51. )
  52. ])
  53. ]),
  54. GoRoute(
  55. path: 'maintenance',
  56. builder: (context, state) => ListTablePage(),
  57. ),
  58. GoRoute(
  59. path: 'listplatform',
  60. builder: (context, state) => ListPlatformPage(),
  61. routes: [
  62. GoRoute(
  63. path: 'listmember',
  64. builder: (context, state) => ListMemberPage(),
  65. ),
  66. GoRoute(
  67. path: 'editplatform',
  68. builder: (context, state) => EditPlatformPage(),
  69. )
  70. ]),
  71. GoRoute(
  72. path: 'addbug',
  73. builder: (context, state) => AddBugPage(),
  74. ),
  75. GoRoute(
  76. path: 'addplatform',
  77. builder: (context, state) => AddPlatformPage(),
  78. ),
  79. ]),
  80. ],
  81. );
  82. class MyApp extends StatelessWidget {
  83. const MyApp({super.key});
  84. @override
  85. Widget build(BuildContext context) {
  86. return MaterialApp.router(
  87. debugShowCheckedModeBanner: false,
  88. title: 'Bug Listing',
  89. routerConfig: _router,
  90. );
  91. }
  92. }
  93. class MyHomePage extends StatelessWidget {
  94. @override
  95. Widget build(BuildContext context) {
  96. debugPaintSizeEnabled = false;
  97. return Scaffold(
  98. // appBar: Header(
  99. // title: Text('title'),
  100. // appBar: AppBar(),
  101. // widgets: <Widget>[Icon(Icons.more_vert)],
  102. // ),
  103. appBar: CustomAppbar(),
  104. body: Container(
  105. decoration: BoxDecoration(color: Colors.black.withOpacity(0.6)),
  106. child: Column(
  107. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  108. children: [
  109. Expanded(
  110. child: Center(
  111. child: Row(
  112. mainAxisAlignment: MainAxisAlignment.center,
  113. children: [
  114. Text(
  115. 'Welcome to Bug Tracker',
  116. style: TextStyle(
  117. color: Colors.white,
  118. fontSize: 40,
  119. fontWeight: FontWeight.bold),
  120. ),
  121. ],
  122. )),
  123. ),
  124. Padding(
  125. padding: const EdgeInsets.all(8.0),
  126. child: Text(
  127. 'Track, manage, and resolve bugs efficiently',
  128. style: TextStyle(color: Colors.white, fontSize: 16),
  129. ),
  130. ),
  131. Row(
  132. mainAxisAlignment: MainAxisAlignment.center,
  133. children: [
  134. Padding(
  135. padding: const EdgeInsets.symmetric(horizontal: 10),
  136. child: ElevatedButton(
  137. onPressed: () => context.go('/signup'),
  138. style: ElevatedButton.styleFrom(
  139. side: BorderSide(color: Colors.white),
  140. backgroundColor: Colors.transparent),
  141. child: Text(
  142. 'Sign Up',
  143. style: TextStyle(color: Colors.white),
  144. ),
  145. ),
  146. ),
  147. Padding(
  148. padding: const EdgeInsets.symmetric(horizontal: 10),
  149. child: ElevatedButton(
  150. onPressed: () => context.go('/login'),
  151. style: ElevatedButton.styleFrom(
  152. backgroundColor: Colors.black,
  153. ),
  154. child: Text(
  155. 'Login',
  156. style: TextStyle(color: Colors.white),
  157. ),
  158. ),
  159. ),
  160. ],
  161. ),
  162. Expanded(child: Container())
  163. ],
  164. ),
  165. ),
  166. bottomNavigationBar: Footer());
  167. }
  168. }