diff --git a/README.md b/README.md index 1b250e9430845ea16aa04ef0fb43c5d3f6f83db1..29622c0c54fac3af0ab5370a1a2bfbbe239f4802 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A cross plattform project for android and ios to log events offline everywhere a - Textfield to show current locally selected and offline available collection - Button "get Collection devices from Sensor" - Button "store Collection devices locally" - +- Select a Mission from the new Sensor-Mission-Management to get a set of devices. diff --git a/lib/login.dart b/lib/login.dart new file mode 100644 index 0000000000000000000000000000000000000000..4628bee0e1db3e4d764829af4f8651a8e0246457 --- /dev/null +++ b/lib/login.dart @@ -0,0 +1,98 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class LoginPage extends StatefulWidget{ + static String tag = 'login-page'; + + const LoginPage({Key? key}) : super(key: key); + @override + _LoginPageState createState() => _LoginPageState(); +} + +class _LoginPageState extends State<LoginPage> { + @override + Widget build(BuildContext context){ + + const logo = Hero( + tag: 'blabla', + child: CircleAvatar( + backgroundColor: Colors.transparent, + radius: 48.0, + child: Text('LOGIN'), + ) + ); + + final email = TextFormField( + keyboardType: TextInputType.emailAddress, + autofocus: false, + initialValue: 'initialValue@aa.com', + decoration: InputDecoration( + hintText: 'sensor e-mail address', + contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(32.0) + ) + ) + ); + + final password = TextFormField( + autofocus: false, + initialValue: 'your password', + decoration: InputDecoration( + hintText: 'sensor password', + contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(32.0) + ) + ) + ); + + + final loginButton = Padding( + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: Material( + borderRadius: BorderRadius.circular(30.0), + shadowColor: Colors.lightBlueAccent.shade100, + elevation: 5.0, + child: MaterialButton( + minWidth: 200.0, + height: 42.0, + onPressed: (){ + + }, + color: Colors.lightBlueAccent, + child: const Text('Log In', style: TextStyle(color: Colors.white)), + ), + ), + ); + + final forgotLabel = FlatButton( + onPressed: () { }, + child: const Text('Forgot password?', + style: TextStyle(color: Colors.black54), + ), + ); + + return Scaffold( + backgroundColor: Colors.white, + body: Center( + child: ListView( + shrinkWrap: true, + padding: const EdgeInsets.only(left: 24.0, right: 24.0), + children: <Widget>[ + logo, + const SizedBox(height: 48.0), + email, + const SizedBox(height: 8.0), + password, + const SizedBox(height: 24.0), + loginButton, + forgotLabel + + + ], + ) + ) + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 720fa4f5290685e886d28c4c94c94835098888c4..c907cf4df6b867d45977224142cc34621d3ca556 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'addevent.dart'; import 'viewevents.dart'; import 'overview.dart'; import 'configuration.dart'; +import 'login.dart'; void main() { @@ -90,6 +91,7 @@ void main() { '/second': (context) => const AddEvent(), '/third': (context) => const ViewEvents(), '/forth': (context) => const Configuration(), + '/fifth': (context) => const LoginPage(), }, )); } diff --git a/lib/viewevents.dart b/lib/viewevents.dart index 31dff0f545a7bb19cb2acb3cf1896b3e0cc57951..0c8009bcbad80840a9dfcf51672ab9beaecce297 100644 --- a/lib/viewevents.dart +++ b/lib/viewevents.dart @@ -141,6 +141,21 @@ class ViewEvents extends StatelessWidget { ), ), ), + bottomNavigationBar: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + FloatingActionButton.extended( + heroTag: null, + tooltip: 'Login to Sensor', + icon: null, + label: const Text('Login'), + onPressed: () { + // Provide + Navigator.pushNamed(context, '/fifth'); + }, + ), + ], + ), ); } } diff --git a/pubspec.lock b/pubspec.lock index 5f39eaccdf0f2de11504602898825dc6c361138f..bcd47c7b2eacdcddc8cd8f45744aa748fee869b9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,20 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + another_flushbar: + dependency: transitive + description: + name: another_flushbar + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.28" + another_transformer_page_view: + dependency: transitive + description: + name: another_transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" async: dependency: transitive description: @@ -83,6 +97,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + flutter_login: + dependency: "direct main" + description: + name: flutter_login + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + flutter_signin_button: + dependency: transitive + description: + name: flutter_signin_button + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -93,6 +121,13 @@ packages: description: flutter source: sdk version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "9.2.0" geolocator: dependency: "direct main" description: @@ -177,6 +212,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" path: dependency: transitive description: @@ -226,6 +268,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.4" + provider: + dependency: transitive + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.2" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1+1" shared_preferences: dependency: "direct main" description: @@ -336,6 +392,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + url_launcher: + dependency: transitive + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.20" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 87d46a2fb95778aa223e400d5cb4d34914b47228..6fcb55b4bdda4feb84eb553c3e1f11216efe76c1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: shared_preferences: ^2.0.12 http: ^0.13.4 geolocator: ^8.1.1 + flutter_login: ^3.1.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.