import 'package:flutter/material.dart'; import 'package:fluro/fluro.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; import 'package:imagini/core/AppProvider.dart'; class LoginScreen extends StatefulWidget { static const String PATH = '/Login'; LoginScreen({Key key}) : super(key: key); @override _LoginScreenState createState() => _LoginScreenState(); } class _LoginScreenState extends State { // LoginBloc bloc; @override void dispose() { super.dispose(); // bloc.dispose(); } @override Widget build(BuildContext context) { _init(); return Scaffold( body: Center( child: ConstrainedBox( constraints: BoxConstraints(maxWidth: 500), child: Container( margin: EdgeInsets.fromLTRB(50, 0, 50, 0), height: 500, child: Column( children: [ Container( child: FittedBox( fit: BoxFit.contain, child: const FlutterLogo(), ), width: 175, margin: EdgeInsets.fromLTRB(0, 0, 0, 50), ), Expanded( child: TextField( decoration: InputDecoration( labelText: 'Server Address' ), ), ), Expanded( child: TextField( decoration: InputDecoration( labelText: 'Username / Email' ), ), ), Expanded( child: TextField( obscureText: true, enableSuggestions: false, autocorrect: false, decoration: InputDecoration( labelText: 'Password' ), ), ), SizedBox( width: double.infinity, child: PlatformButton( onPressed: () { AppProvider.getRouter(context).navigateTo(context, "/Home", transition: TransitionType.fadeIn); }, child: Text('Login') ), ), ], ), ), ), ), ); } void _init(){ // if(null == bloc){ // bloc = LoginBloc(AppProvider.getApplication(context)); // } } }