LoginPage.dart (931B)
1 // TODO fix placeholder 2 3 import 'package:flutter/cupertino.dart'; 4 import 'package:flutter/material.dart'; 5 import 'package:flutter_bloc/flutter_bloc.dart'; 6 7 import '../blocs/AuthenticationBloc.dart'; 8 import '../blocs/LoginBloc.dart'; 9 import '../components/LoginForm.dart'; 10 import '../repos/UserRepository.dart'; 11 12 class LoginPage extends StatelessWidget { 13 final UserRepository userRepository; 14 15 LoginPage({Key key, @required this.userRepository}) 16 : assert(userRepository != null), 17 super(key: key); 18 19 @override 20 Widget build(BuildContext context) { 21 return Scaffold( 22 appBar: AppBar( 23 title: const Text('Login'), 24 ), 25 body: BlocProvider( 26 create: (context) { 27 return LoginBloc( 28 authenticationBloc: BlocProvider.of<AuthenticationBloc>(context), 29 userRepository: userRepository, 30 ); 31 }, 32 child: LoginForm(), 33 ), 34 ); 35 } 36 }