浏览代码

LogIn & Register graphic only

David Sokol Zelazko 3 年之前
父节点
当前提交
55e041f6c8
共有 2 个文件被更改,包括 328 次插入86 次删除
  1. 310 5
      app/lib/main.dart
  2. 18 81
      app/pubspec.lock

+ 310 - 5
app/lib/main.dart

@@ -23,18 +23,36 @@ class PhysiGo extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return MaterialApp(
-      title: 'PhysiGo',
+      title: 'PhsyGo',
       theme: ThemeData(
-        primarySwatch: Colors.blue,
+        primarySwatch: Colors.blueGrey,
       ),
-      home: const HomePage(),
+      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 HomePage extends StatelessWidget {
-  const HomePage({Key? key}) : super(key: key);
+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(
@@ -83,9 +101,296 @@ class HomePage extends StatelessWidget {
                 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'),
+          ),
+        ]),
+      )),
+    );
+  }
+}

+ 18 - 81
app/pubspec.lock

@@ -8,20 +8,6 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "2.8.2"
-  awesome_notifications:
-    dependency: "direct main"
-    description:
-      name: awesome_notifications
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "0.6.21"
-  body_detection:
-    dependency: "direct main"
-    description:
-      name: body_detection
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "0.0.3"
   boolean_selector:
     dependency: transitive
     description:
@@ -92,48 +78,48 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.2.0"
-  firebase_core:
+  firebase_auth:
     dependency: "direct main"
     description:
-      name: firebase_core
+      name: firebase_auth
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.15.0"
-  firebase_core_platform_interface:
+    version: "3.3.18"
+  firebase_auth_platform_interface:
     dependency: transitive
     description:
-      name: firebase_core_platform_interface
+      name: firebase_auth_platform_interface
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "4.4.0"
-  firebase_core_web:
+    version: "6.2.6"
+  firebase_auth_web:
     dependency: transitive
     description:
-      name: firebase_core_web
+      name: firebase_auth_web
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.6.4"
-  firebase_messaging:
+    version: "3.3.15"
+  firebase_core:
     dependency: "direct main"
     description:
-      name: firebase_messaging
+      name: firebase_core
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "11.4.0"
-  firebase_messaging_platform_interface:
+    version: "1.17.0"
+  firebase_core_platform_interface:
     dependency: transitive
     description:
-      name: firebase_messaging_platform_interface
+      name: firebase_core_platform_interface
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "3.5.0"
-  firebase_messaging_web:
+    version: "4.4.0"
+  firebase_core_web:
     dependency: transitive
     description:
-      name: firebase_messaging_web
+      name: firebase_core_web
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "2.4.0"
+    version: "1.6.4"
   flutter:
     dependency: "direct main"
     description: flutter
@@ -303,48 +289,6 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.8.0"
-  permission_handler:
-    dependency: "direct main"
-    description:
-      name: permission_handler
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "9.2.0"
-  permission_handler_android:
-    dependency: transitive
-    description:
-      name: permission_handler_android
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "9.0.2+1"
-  permission_handler_apple:
-    dependency: transitive
-    description:
-      name: permission_handler_apple
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "9.0.4"
-  permission_handler_platform_interface:
-    dependency: transitive
-    description:
-      name: permission_handler_platform_interface
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "3.7.0"
-  permission_handler_windows:
-    dependency: transitive
-    description:
-      name: permission_handler_windows
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "0.1.0"
-  platform:
-    dependency: transitive
-    description:
-      name: platform
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "3.1.0"
   plugin_platform_interface:
     dependency: transitive
     description:
@@ -373,13 +317,6 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "3.0.1+1"
-  rxdart:
-    dependency: "direct main"
-    description:
-      name: rxdart
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "0.27.3"
   sky_engine:
     dependency: transitive
     description: flutter