Skip to content
Snippets Groups Projects
Commit 834ec94c authored by Maximilian Betz's avatar Maximilian Betz
Browse files

started adding login widget

parent 1f996a07
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
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
......@@ -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(),
},
));
}
......
......@@ -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');
},
),
],
),
);
}
}
......
# 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:
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment