I have a problem with my login in Flutter. When I click the login button, a pop up token information appears. When I click login it should go to the home page.

This is my source code.
login_page.dart
void _validateInputs() {
if (_formKey.currentState!.validate()) {
//If all data are correct then save data to out variables
_formKey.currentState!.save();
doLogin(txtEditEmail.text, txtEditPwd.text);
}
}
doLogin(email, password) async {
final GlobalKey<State> _keyLoader = GlobalKey<State>();
Dialogs.loading(context, _keyLoader, "Proses ...");
try {
String? token;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
token = sharedPreferences.getString('token');
final response = await http.post(
Uri.parse("http://192.168.100.211:8080/login"),
headers: {
'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json',
'Authorization': 'Bearer $token',},
body: json.encode({
"email": email,
"password": password,
}));
final output = json.decode(response.body);
if (response.statusCode == 200) {
Navigator.of(_keyLoader.currentContext!, rootNavigator: false).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
output['message'],
style: const TextStyle(fontSize: 16),
)),
);
if (output['success'] == true) {
saveSession(email);
}
//debugPrint(output['message']);
} else {
Navigator.of(_keyLoader.currentContext!, rootNavigator: false).pop();
//debugPrint(output['message']);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
output.toString(),
style: const TextStyle(fontSize: 16),
)),
);
}
} catch (e) {
Navigator.of(_keyLoader.currentContext!, rootNavigator: false).pop();
Dialogs.popUp(context, '$e');
debugPrint('$e');
}
}
Can friends help solve my problem?