|
|
@@ -1,12 +1,11 @@
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
-import 'package:latlong2/latlong.dart';
|
|
|
-import 'package:physigo/exercises/exercises_page.dart';
|
|
|
-import 'package:physigo/friends/friends_page.dart';
|
|
|
-import 'navigation/navigation_page.dart';
|
|
|
|
|
|
import 'firebase_options.dart';
|
|
|
import 'push_notifications_initializer.dart';
|
|
|
+import 'package:physigo/logIn.dart';
|
|
|
+import 'package:physigo/SignupPage.dart';
|
|
|
+import 'package:physigo/welcomeScreen.dart';
|
|
|
|
|
|
void main() async {
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
@@ -29,368 +28,13 @@ class PhysiGo extends StatelessWidget {
|
|
|
),
|
|
|
initialRoute: '/',
|
|
|
routes: {
|
|
|
- '/': (context) => MyHomePage(
|
|
|
- title: '',
|
|
|
- ),
|
|
|
- '/register': (context) => RegisterScreen(
|
|
|
- title: '',
|
|
|
- ),
|
|
|
- '/register2': (context) => RegisterScreen2(title: ''),
|
|
|
- '/register3': (context) => RegisterScreen3(title: ''),
|
|
|
+ '/': (context) => MyHomePage(title: '',),
|
|
|
+ '/register': (context) => SignupPage(),
|
|
|
+ //'/register2': (context) => RegisterScreen2(title: ''),
|
|
|
+ //'/register3': (context) => RegisterScreen3(title: ''),
|
|
|
'/login': (context) => LogIn(title: '')
|
|
|
},
|
|
|
//home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-class MyHomePage extends StatefulWidget {
|
|
|
- const MyHomePage({Key? key, required this.title}) : super(key: key);
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- State<MyHomePage> createState() => _MyHomePageState();
|
|
|
-}
|
|
|
-
|
|
|
-class _MyHomePageState extends State<MyHomePage> {
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return SafeArea(
|
|
|
- child: Scaffold(
|
|
|
- body: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Center(
|
|
|
- child: TextButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- MaterialPageRoute(
|
|
|
- // Example on how to use NavigationPage
|
|
|
- builder: (context) => NavigationPage(
|
|
|
- destination: LatLng(51.78036111980833, 19.451262207821234),
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- },
|
|
|
- child: const Text('Navigation')),
|
|
|
- ),
|
|
|
- Center(
|
|
|
- child: TextButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- MaterialPageRoute(
|
|
|
- builder: (context) => const ExercisesPage(),
|
|
|
- ),
|
|
|
- );
|
|
|
- },
|
|
|
- child: const Text('Exercises'),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Center(
|
|
|
- child: TextButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- MaterialPageRoute(
|
|
|
- builder: (context) => const FriendsPage(),
|
|
|
- ),
|
|
|
- );
|
|
|
- },
|
|
|
- child: const Text('Friends'),
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- Image.asset(
|
|
|
- 'assets/teamlogo.png',
|
|
|
- width: 260,
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- ElevatedButton(
|
|
|
- // Within the `FirstScreen` widget
|
|
|
- onPressed: () {
|
|
|
- // Navigate to the second screen using a named route.
|
|
|
- Navigator.pushNamed(context, '/register');
|
|
|
- },
|
|
|
- child: Text('Register'),
|
|
|
- ),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.pushNamed(context, '/login');
|
|
|
- },
|
|
|
- child: const Text('Log In'),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class RegisterScreen extends StatefulWidget {
|
|
|
- const RegisterScreen({Key? key, required this.title}) : super(key: key);
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- //_RegisterScreen createState() => _RegisterScreen();
|
|
|
- State<RegisterScreen> createState() => _RegisterScreen();
|
|
|
-}
|
|
|
-
|
|
|
-class _RegisterScreen extends State<RegisterScreen> {
|
|
|
- DateTime? _dateTime;
|
|
|
- String? _dateString;
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
- title: const Text('Register Screen'),
|
|
|
- ),
|
|
|
- body: Center(
|
|
|
- child: SizedBox(
|
|
|
- width: 300,
|
|
|
- child: Column(children: <Widget>[
|
|
|
- const SizedBox(height: 30),
|
|
|
- Text(
|
|
|
- 'Personal Information',
|
|
|
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- Image.asset(
|
|
|
- 'assets/user.png',
|
|
|
- width: 150,
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Name',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Surname',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- Row(children: <Widget>[
|
|
|
- Text(_dateString == null ? 'Select birthday date :' : _dateString.toString()),
|
|
|
- const SizedBox(width: 49),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- showDatePicker(
|
|
|
- context: context,
|
|
|
- initialDate: DateTime.now(),
|
|
|
- firstDate: DateTime(1900),
|
|
|
- lastDate: DateTime(2222))
|
|
|
- .then((date) {
|
|
|
- setState(() {
|
|
|
- _dateTime = date!;
|
|
|
- _dateString = "${date.day}/${date.month}/${date.year}";
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- child: const Text('Select date'),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- const SizedBox(height: 10),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.pushNamed(context, '/register2');
|
|
|
- },
|
|
|
- child: const Text('Next Page'),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- )),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class RegisterScreen2 extends StatefulWidget {
|
|
|
- const RegisterScreen2({Key? key, required this.title}) : super(key: key);
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- //_RegisterScreen createState() => _RegisterScreen();
|
|
|
- State<RegisterScreen2> createState() => _RegisterScreen2();
|
|
|
-}
|
|
|
-
|
|
|
-class _RegisterScreen2 extends State<RegisterScreen2> {
|
|
|
- bool isChecked = false;
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
- title: const Text('Register Screen'),
|
|
|
- ),
|
|
|
- body: Center(
|
|
|
- child: SizedBox(
|
|
|
- width: 300,
|
|
|
- child: Column(children: <Widget>[
|
|
|
- const SizedBox(height: 30),
|
|
|
- Text(
|
|
|
- 'Contact Details',
|
|
|
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- Image.asset(
|
|
|
- 'assets/communicate.png',
|
|
|
- width: 150,
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Mail',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Phone Number',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Home Adress..',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- Row(children: <Widget>[
|
|
|
- Text('Anonymous'),
|
|
|
- Checkbox(
|
|
|
- checkColor: Colors.white,
|
|
|
- value: isChecked,
|
|
|
- onChanged: (bool? value) {
|
|
|
- setState(() {
|
|
|
- isChecked = value!;
|
|
|
- });
|
|
|
- },
|
|
|
- ),
|
|
|
- ]),
|
|
|
- const SizedBox(height: 10),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- Navigator.pushNamed(context, '/register3');
|
|
|
- },
|
|
|
- child: const Text('Next Page'),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- )),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class RegisterScreen3 extends StatefulWidget {
|
|
|
- const RegisterScreen3({Key? key, required this.title}) : super(key: key);
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- //_RegisterScreen createState() => _RegisterScreen();
|
|
|
- State<RegisterScreen3> createState() => _RegisterScreen3();
|
|
|
-}
|
|
|
-
|
|
|
-class _RegisterScreen3 extends State<RegisterScreen3> {
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
- title: const Text('Register Screen'),
|
|
|
- ),
|
|
|
- body: Center(
|
|
|
- child: SizedBox(
|
|
|
- width: 300,
|
|
|
- child: Column(children: <Widget>[
|
|
|
- const SizedBox(height: 30),
|
|
|
- Text(
|
|
|
- 'User details',
|
|
|
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- Image.asset(
|
|
|
- 'assets/id-card.png',
|
|
|
- width: 150,
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Username',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Password',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Repeat password',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- const SizedBox(height: 10),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {},
|
|
|
- child: const Text('Finish'),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- )),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class LogIn extends StatefulWidget {
|
|
|
- const LogIn({Key? key, required this.title}) : super(key: key);
|
|
|
- final String title;
|
|
|
-
|
|
|
- @override
|
|
|
- //_RegisterScreen createState() => _RegisterScreen();
|
|
|
- State<LogIn> createState() => _LogIn();
|
|
|
-}
|
|
|
-
|
|
|
-class _LogIn extends State<LogIn> {
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
- title: const Text('Login Screen'),
|
|
|
- ),
|
|
|
- body: Center(
|
|
|
- child: SizedBox(
|
|
|
- width: 300,
|
|
|
- child: Column(children: <Widget>[
|
|
|
- const SizedBox(height: 30),
|
|
|
- Text(
|
|
|
- 'Welcome back!',
|
|
|
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- Image.asset(
|
|
|
- 'assets/hello.png',
|
|
|
- width: 150,
|
|
|
- ),
|
|
|
- const SizedBox(height: 30),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Mail or mobile phone',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- TextField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'Password',
|
|
|
- ),
|
|
|
- ),
|
|
|
- const SizedBox(height: 10),
|
|
|
- ElevatedButton(
|
|
|
- onPressed: () {},
|
|
|
- child: const Text('Log In'),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- )),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|