main.dart 10 KB

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