Commit 663b2342 authored by Manuel's avatar Manuel

added nice design to login page

parent e30cd5ab
# This is a generated file; do not edit or check into version control.
integration_test=C:\\Libs\\flutter\\packages\\integration_test\\
path_provider=C:\\Libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-1.6.27\\
path_provider_linux=C:\\Libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
path_provider_macos=C:\\Libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+8\\
path_provider_windows=C:\\Libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.5\\
integration_test=C:\\_libs\\flutter\\packages\\integration_test\\
path_provider=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-1.6.27\\
path_provider_linux=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
path_provider_macos=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+8\\
path_provider_windows=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.5\\
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\Libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-03-10 23:11:13.267004","version":"2.0.1"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\_libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\_libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-03-11 10:31:52.781121","version":"2.0.1"}
\ No newline at end of file
......@@ -3,60 +3,60 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-03-10 23:08:31.372244.
apex_flutter_sdk:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/apex_flutter_sdk-1.1.1+1/lib/
archive:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib/
args:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib/
async:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0/lib/
boolean_selector:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
characters:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
charcode:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0/lib/
circlegraph:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/circlegraph-0.0.6/lib/
clock:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib/
collection:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
convert:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/
crypto:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.5/lib/
cupertino_icons:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib/
enhanced_future_builder:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/enhanced_future_builder-1.0.3/lib/
fake_async:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
ffi:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib/
file:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0/lib/
flutter:file:///C:/Libs/flutter/packages/flutter/lib/
flutter_driver:file:///C:/Libs/flutter/packages/flutter_driver/lib/
flutter_spinkit:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-5.0.0/lib/
flutter_test:file:///C:/Libs/flutter/packages/flutter_test/lib/
fuchsia_remote_debug_protocol:file:///C:/Libs/flutter/packages/fuchsia_remote_debug_protocol/lib/
graphview:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/graphview-0.6.7/lib/
http:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/
http_parser:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib/
integration_test:file:///C:/Libs/flutter/packages/integration_test/lib/
localstorage:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/localstorage-3.0.6+9/lib/
logger:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/logger-0.9.4/lib/
matcher:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
meta:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
path:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib/
path_provider:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/lib/
path_provider_linux:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/lib/
path_provider_macos:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/lib/
path_provider_platform_interface:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-1.0.4/lib/
path_provider_windows:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.5/lib/
pedantic:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/
platform:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/
plugin_platform_interface:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.0.3/lib/
process:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0/lib/
shamsi_date:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/shamsi_date-0.8.1/lib/
sky_engine:file:///C:/Libs/flutter/bin/cache/pkg/sky_engine/lib/
source_span:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0/lib/
stack_trace:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
stream_channel:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
string_scanner:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/
sync_http:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.2.0/lib/
term_glyph:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/
test_api:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib/
typed_data:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
vm_service:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-5.5.0/lib/
webdriver:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-2.1.2/lib/
win32:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/
xdg_directories:file:///C:/Libs/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.1.2/lib/
# Generated by pub on 2021-03-11 10:11:51.659292.
apex_flutter_sdk:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/apex_flutter_sdk-1.1.1+1/lib/
archive:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib/
args:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib/
async:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0/lib/
boolean_selector:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
characters:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
charcode:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0/lib/
circlegraph:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/circlegraph-0.0.6/lib/
clock:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib/
collection:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
convert:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/
crypto:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.5/lib/
cupertino_icons:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.2/lib/
enhanced_future_builder:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/enhanced_future_builder-1.0.3/lib/
fake_async:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
ffi:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib/
file:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0/lib/
flutter:file:///C:/_libs/flutter/packages/flutter/lib/
flutter_driver:file:///C:/_libs/flutter/packages/flutter_driver/lib/
flutter_spinkit:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-5.0.0/lib/
flutter_test:file:///C:/_libs/flutter/packages/flutter_test/lib/
fuchsia_remote_debug_protocol:file:///C:/_libs/flutter/packages/fuchsia_remote_debug_protocol/lib/
graphview:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/graphview-0.6.7/lib/
http:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/
http_parser:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib/
integration_test:file:///C:/_libs/flutter/packages/integration_test/lib/
localstorage:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/localstorage-3.0.6+9/lib/
logger:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/logger-0.9.4/lib/
matcher:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
meta:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
path:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib/
path_provider:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27/lib/
path_provider_linux:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/lib/
path_provider_macos:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/lib/
path_provider_platform_interface:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-1.0.4/lib/
path_provider_windows:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.5/lib/
pedantic:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/
platform:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/
plugin_platform_interface:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.0.3/lib/
process:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0/lib/
shamsi_date:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/shamsi_date-0.8.1/lib/
sky_engine:file:///C:/_libs/flutter/bin/cache/pkg/sky_engine/lib/
source_span:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0/lib/
stack_trace:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
stream_channel:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
string_scanner:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/
sync_http:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.2.0/lib/
term_glyph:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/
test_api:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19/lib/
typed_data:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
vm_service:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-5.5.0/lib/
webdriver:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-2.1.2/lib/
win32:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/
xdg_directories:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.1.2/lib/
dashboard:lib/
sdk.dir=C:\\Users\\herry\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\Libs\\flutter
\ No newline at end of file
sdk.dir=C:\\Users\\Manuel\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\_libs\\flutter
\ No newline at end of file
......@@ -6,32 +6,25 @@ class LoginForm extends StatefulWidget {
final Function(String, String) loginAttempt;
final String error;
final bool isBusy;
LoginForm(this.loginAttempt, this.error);
LoginForm(this.loginAttempt, this.error, this.isBusy);
}
class _LoginFormState extends State<LoginForm> {
bool _busy = false;
String _username = "";
String _password = "";
void _submit() {
setState(() {
_busy = true;
});
widget.loginAttempt(_username, _password);
if (!widget.isBusy) widget.loginAttempt(_username, _password);
}
@override
Widget build(BuildContext context) {
_busy = false;
return FractionallySizedBox(
widthFactor: .3,
child: FocusTraversalGroup(
return FocusTraversalGroup(
policy: OrderedTraversalPolicy(),
child: FractionallySizedBox(
widthFactor: .6,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
......@@ -41,10 +34,11 @@ class _LoginFormState extends State<LoginForm> {
),
SizedBox(height: 32),
TextField(
readOnly: _busy,
readOnly: widget.isBusy,
autofocus: true,
decoration: InputDecoration(
hintText: "Username",
counterText: "",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
borderSide: BorderSide(
......@@ -58,12 +52,14 @@ class _LoginFormState extends State<LoginForm> {
maxLines: 1,
maxLength: 50,
),
SizedBox(height: 16),
TextField(
readOnly: _busy,
readOnly: widget.isBusy,
autofocus: false,
obscureText: true,
decoration: InputDecoration(
hintText: "Password",
counterText: "",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
borderSide: BorderSide(
......@@ -86,7 +82,8 @@ class _LoginFormState extends State<LoginForm> {
style: TextStyle(color: Colors.red),
),
),
// login button
SizedBox(height: 16),
TextButton.icon(
onPressed: _submit,
icon: Icon(
......@@ -99,7 +96,9 @@ class _LoginFormState extends State<LoginForm> {
style: TextStyle(fontSize: 20, color: Colors.white),
),
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).primaryColor,
backgroundColor: widget.isBusy
? Colors.grey
: Theme.of(context).primaryColor,
padding: EdgeInsets.all(18),
),
),
......
......@@ -16,24 +16,81 @@ class LoginPage extends StatefulWidget {
class _LoginPageState extends State<LoginPage> {
String _error;
bool _isBusy = false;
final Logger logger = Logger();
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: LoginForm(tryLogin, _error),
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.blue[300],
Colors.blue,
],
),
),
padding: EdgeInsets.symmetric(horizontal: 32, vertical: 64),
child: Container(
color: Colors.white,
child: Row(
children: [
Expanded(
flex: 4,
child: Container(
child: LoginForm(tryLogin, _error, _isBusy),
),
),
Expanded(
flex: 3,
child: Container(
constraints: BoxConstraints.expand(),
child: Stack(
children: [
Container(
constraints: BoxConstraints.expand(),
child: Image.asset(
"assets/login_image.jpg",
fit: BoxFit.cover,
alignment: Alignment(-.2, 0),
),
),
Container(
color: Color.fromRGBO(33, 150, 243, .5),
),
],
),
),
),
],
),
),
),
);
}
///
/// attempts to receive a token from the server
///
void tryLogin(String username, String password) async {
logger.i("Loggin Attempt($username, ******)");
setState(() {
_error = "";
_isBusy = true;
});
BackendUser user;
await Future.delayed(Duration(seconds: 1));
try {
user = await LoginHelper().login(username, password);
} on LoginException catch (e) {
setState(() {
_error = e.message;
_isBusy = false;
});
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment