Open jaredbaszler opened 2 years ago
Was able to reproduce this bug today in a new project using flutter create
and the following code.
I also changed the target to desktop as well as web and I got the same error at the same location on both targets.
import 'package:flutter/material.dart';
import 'package:flutter_login/flutter_login.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return FlutterLogin(
title: 'Bug Example',
theme: LoginTheme(
primaryColor: const Color.fromRGBO(170, 30, 46, 1),
accentColor: const Color.fromRGBO(243, 188, 71, 1),
titleStyle: const TextStyle(
fontFamily: 'Helvetica Neue Condensed',
fontSize: 32,
),
),
userValidator: (emailAddress) {
return null;
},
passwordValidator: (password) {
return null;
},
onLogin: (loginData) async {
print('onLogin firing');
return null;
},
onRecoverPassword: (name) => null,
onSubmitAnimationCompleted: (loginData) {
print('onSubmitAnimationCompleted firing');
// Navigator.of(context).pushReplacement(MaterialPageRoute(
// builder: (context) => PCShipments(),
// ));
},
);
}
}
and my pubspec.yaml
is:
name: pc_portal_frontend
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter
flutter_login: ^3.1.0
dev_dependencies:
flutter_lints: ^1.0.0
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
After successful login, persistent error continues.
Error:
Expected behavior For the
onSubmitAnimationCompleted
event to fire and navigate to my next screen.Information (please complete the following information):
I had recently converted to null safety. Below is my
pubspec.yaml
file.