import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:physigo/firebase_options.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); runApp(const PhysiGo()); } class PhysiGo extends StatelessWidget { const PhysiGo({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'PhsyGo', theme: ThemeData( primarySwatch: Colors.blueGrey, ), initialRoute: '/', routes: { '/': (context) => MyHomePage(title: '',), '/register': (context) => RegisterScreen(title: '',), '/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 createState() => _MyHomePageState(); } class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Welcome to PhysiGo'), ), body: Center( child: Column( children: [ 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 createState() => _RegisterScreen(); } class _RegisterScreen extends State { 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: [ 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: [ 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 createState() => _RegisterScreen2(); } class _RegisterScreen2 extends State { 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: [ 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: [ 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 createState() => _RegisterScreen3(); } class _RegisterScreen3 extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Register Screen'), ), body: Center( child: SizedBox( width: 300, child: Column(children: [ 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 createState() => _LogIn(); } class _LogIn extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Login Screen'), ), body: Center( child: SizedBox( width: 300, child: Column(children: [ 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'), ), ]), )), ); } }