main.dart 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. import 'package:firebase_core/firebase_core.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:latlong2/latlong.dart';
  4. import 'navigation/navigation_page.dart';
  5. import 'firebase_options.dart';
  6. void main() async {
  7. WidgetsFlutterBinding.ensureInitialized();
  8. await Firebase.initializeApp(
  9. options: DefaultFirebaseOptions.currentPlatform,
  10. );
  11. runApp(const PhysiGo());
  12. }
  13. class PhysiGo extends StatelessWidget {
  14. const PhysiGo({Key? key}) : super(key: key);
  15. @override
  16. Widget build(BuildContext context) {
  17. return MaterialApp(
  18. title: 'PhsyGo',
  19. theme: ThemeData(
  20. primarySwatch: Colors.blueGrey,
  21. ),
  22. initialRoute: '/',
  23. routes: {
  24. '/': (context) => MyHomePage(title: '',),
  25. '/register': (context) => RegisterScreen(title: '',),
  26. '/register2': (context) => RegisterScreen2(title: ''),
  27. '/register3': (context) => RegisterScreen3(title: ''),
  28. '/login': (context) => LogIn(title: '')
  29. },
  30. //home: const MyHomePage(title: 'Flutter Demo Home Page'),
  31. );
  32. }
  33. }
  34. class MyHomePage extends StatefulWidget {
  35. const MyHomePage({Key? key, required this.title}) : super(key: key);
  36. final String title;
  37. @override
  38. State<MyHomePage> createState() => _MyHomePageState();
  39. }
  40. class _MyHomePageState extends State<MyHomePage> {
  41. @override
  42. Widget build(BuildContext context) {
  43. return Scaffold(
  44. appBar: AppBar(
  45. title: const Text('Welcome to PhysiGo'),
  46. ),
  47. body: Center(
  48. child: Column(
  49. children: <Widget>[
  50. const SizedBox(height: 30),
  51. Image.asset(
  52. 'assets/teamlogo.png',
  53. width: 260,
  54. ),
  55. const SizedBox(height: 30),
  56. ElevatedButton(
  57. // Within the `FirstScreen` widget
  58. onPressed: () {
  59. // Navigate to the second screen using a named route.
  60. Navigator.pushNamed(context, '/register');
  61. },
  62. child: Text('Register'),
  63. ),
  64. ElevatedButton(
  65. onPressed: () {
  66. Navigator.pushNamed(context, '/login');
  67. },
  68. child: const Text('Log In'),
  69. )
  70. ],
  71. ),
  72. ),
  73. );
  74. }
  75. }
  76. class RegisterScreen extends StatefulWidget {
  77. const RegisterScreen({Key? key, required this.title}) : super(key: key);
  78. final String title;
  79. @override
  80. //_RegisterScreen createState() => _RegisterScreen();
  81. State<RegisterScreen> createState() => _RegisterScreen();
  82. }
  83. class _RegisterScreen extends State<RegisterScreen> {
  84. DateTime? _dateTime;
  85. String? _dateString;
  86. @override
  87. Widget build(BuildContext context) {
  88. return Scaffold(
  89. appBar: AppBar(
  90. title: const Text('Register Screen'),
  91. ),
  92. body: Center(
  93. child: SizedBox(
  94. width: 300,
  95. child: Column(children: <Widget>[
  96. const SizedBox(height: 30),
  97. Text(
  98. 'Personal Information',
  99. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  100. ),
  101. const SizedBox(height: 30),
  102. Image.asset(
  103. 'assets/user.png',
  104. width: 150,
  105. ),
  106. const SizedBox(height: 30),
  107. TextField(
  108. decoration: InputDecoration(
  109. hintText: 'Name',
  110. ),
  111. ),
  112. const SizedBox(height: 10),
  113. TextField(
  114. decoration: InputDecoration(
  115. hintText: 'Surname',
  116. ),
  117. ),
  118. const SizedBox(height: 10),
  119. Row(children: <Widget>[
  120. Text(_dateString == null
  121. ? 'Select birthday date :'
  122. : _dateString.toString()),
  123. const SizedBox(width: 49),
  124. ElevatedButton(
  125. onPressed: () {
  126. showDatePicker(
  127. context: context,
  128. initialDate: DateTime.now(),
  129. firstDate: DateTime(1900),
  130. lastDate: DateTime(2222))
  131. .then((date) {
  132. setState(() {
  133. _dateTime = date!;
  134. _dateString = "${date.day}/${date.month}/${date.year}";
  135. });
  136. });
  137. },
  138. child: const Text('Select date'),
  139. ),
  140. ]),
  141. const SizedBox(height: 10),
  142. ElevatedButton(
  143. onPressed: () {
  144. Navigator.pushNamed(context, '/register2');
  145. },
  146. child: const Text('Next Page'),
  147. ),
  148. ]),
  149. )),
  150. );
  151. }
  152. }
  153. class RegisterScreen2 extends StatefulWidget {
  154. const RegisterScreen2({Key? key, required this.title}) : super(key: key);
  155. final String title;
  156. @override
  157. //_RegisterScreen createState() => _RegisterScreen();
  158. State<RegisterScreen2> createState() => _RegisterScreen2();
  159. }
  160. class _RegisterScreen2 extends State<RegisterScreen2> {
  161. bool isChecked = false;
  162. @override
  163. Widget build(BuildContext context) {
  164. return Scaffold(
  165. appBar: AppBar(
  166. title: const Text('Register Screen'),
  167. ),
  168. body: Center(
  169. child: SizedBox(
  170. width: 300,
  171. child: Column(children: <Widget>[
  172. const SizedBox(height: 30),
  173. Text(
  174. 'Contact Details',
  175. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  176. ),
  177. const SizedBox(height: 30),
  178. Image.asset(
  179. 'assets/communicate.png',
  180. width: 150,
  181. ),
  182. const SizedBox(height: 30),
  183. TextField(
  184. decoration: InputDecoration(
  185. hintText: 'Mail',
  186. ),
  187. ),
  188. const SizedBox(height: 10),
  189. TextField(
  190. decoration: InputDecoration(
  191. hintText: 'Phone Number',
  192. ),
  193. ),
  194. const SizedBox(height: 10),
  195. TextField(
  196. decoration: InputDecoration(
  197. hintText: 'Home Adress..',
  198. ),
  199. ),
  200. const SizedBox(height: 10),
  201. Row(children: <Widget>[
  202. Text('Anonymous'),
  203. Checkbox(
  204. checkColor: Colors.white,
  205. value: isChecked,
  206. onChanged: (bool? value) {
  207. setState(() {
  208. isChecked = value!;
  209. });
  210. },),
  211. ]),
  212. const SizedBox(height: 10),
  213. ElevatedButton(
  214. onPressed: () {
  215. Navigator.pushNamed(context, '/register3');
  216. },
  217. child: const Text('Next Page'),
  218. ),
  219. ]),
  220. )),
  221. );
  222. }
  223. }
  224. class RegisterScreen3 extends StatefulWidget {
  225. const RegisterScreen3({Key? key, required this.title}) : super(key: key);
  226. final String title;
  227. @override
  228. //_RegisterScreen createState() => _RegisterScreen();
  229. State<RegisterScreen3> createState() => _RegisterScreen3();
  230. }
  231. class _RegisterScreen3 extends State<RegisterScreen3> {
  232. @override
  233. Widget build(BuildContext context) {
  234. return Scaffold(
  235. appBar: AppBar(
  236. title: const Text('Register Screen'),
  237. ),
  238. body: Center(
  239. child: SizedBox(
  240. width: 300,
  241. child: Column(children: <Widget>[
  242. const SizedBox(height: 30),
  243. Text(
  244. 'User details',
  245. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  246. ),
  247. const SizedBox(height: 30),
  248. Image.asset(
  249. 'assets/id-card.png',
  250. width: 150,
  251. ),
  252. const SizedBox(height: 30),
  253. TextField(
  254. decoration: InputDecoration(
  255. hintText: 'Username',
  256. ),
  257. ),
  258. const SizedBox(height: 10),
  259. TextField(
  260. decoration: InputDecoration(
  261. hintText: 'Password',
  262. ),
  263. ),
  264. const SizedBox(height: 10),
  265. TextField(
  266. decoration: InputDecoration(
  267. hintText: 'Repeat password',
  268. ),
  269. ),
  270. const SizedBox(height: 10),
  271. const SizedBox(height: 10),
  272. ElevatedButton(
  273. onPressed: () {
  274. },
  275. child: const Text('Finish'),
  276. ),
  277. ]),
  278. )),
  279. );
  280. }
  281. }
  282. class LogIn extends StatefulWidget {
  283. const LogIn({Key? key, required this.title}) : super(key: key);
  284. final String title;
  285. @override
  286. //_RegisterScreen createState() => _RegisterScreen();
  287. State<LogIn> createState() => _LogIn();
  288. }
  289. class _LogIn extends State<LogIn> {
  290. @override
  291. Widget build(BuildContext context) {
  292. return Scaffold(
  293. appBar: AppBar(
  294. title: const Text('Login Screen'),
  295. ),
  296. body: Center(
  297. child: SizedBox(
  298. width: 300,
  299. child: Column(children: <Widget>[
  300. const SizedBox(height: 30),
  301. Text(
  302. 'Welcome back!',
  303. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  304. ),
  305. const SizedBox(height: 30),
  306. Image.asset(
  307. 'assets/hello.png',
  308. width: 150,
  309. ),
  310. const SizedBox(height: 30),
  311. TextField(
  312. decoration: InputDecoration(
  313. hintText: 'Mail or mobile phone',
  314. ),
  315. ),
  316. const SizedBox(height: 10),
  317. TextField(
  318. decoration: InputDecoration(
  319. hintText: 'Password',
  320. ),
  321. ),
  322. const SizedBox(height: 10),
  323. ElevatedButton(
  324. onPressed: () {
  325. },
  326. child: const Text('Log In'),
  327. ),
  328. ]),
  329. )),
  330. );
  331. }
  332. }