Flutter App Login with NodeJS API at backend & keep user logged in using JWT token | Part 8

preview_player
Показать описание
#flutter #nodejs #jwt

_______________________________________________
Comment below for any queries 😀
Follow and support me:

Be sure to ask for help in the comments if you need any. Suggestions for future Flutter tutorials are also very welcome! :)

For mobile application development keep learning freely from proto coders point
Рекомендации по теме
Комментарии
Автор

Thank you very much sir. This video was really helpful

dhanukalakshan
Автор

Could you pls share details of what type of architecture pattern is used over here

dinshad
Автор

hi, thank you for the good video, i have a question can i build both of flutter app and node backend in the same IDE, vs code for example ?

lifestylenounou
Автор

Can we fetch the token in any page directly from the shared preferences?

zuuylxz
Автор

can you please share login.dart and api code ?

sunnydagar
Автор

E/flutter (23037): Unhandled Exception: LateInitializationError: Field 'prefs' has not been initialized.
E/flutter (23037): #0 _LoginDemoState.prefs
E/flutter (23037): #1 _LoginDemoState.loginUser
E/flutter (23037): <asynchronous suspension>
E/flutter (23037):

sabersouhaimi-szrq
Автор

my token is null
this condition use =
class _SplashScreenPageState extends State<SplashScreenPage> {
time() async {
final SharedPreferences prefs = await
var token =

Future.delayed(
const Duration(seconds: 3),
() {
if (token != null) {

context,
MaterialPageRoute(
builder: (context) => const HomePage(),
),
(route) => false);
} else {

context,
MaterialPageRoute(
builder: (context) => const LoginPage(),
),
(route) => false);
}
},
);
}

@override
void initState() {
// TODO: implement setState
super.initState();
time();
}

PIXELWAVESOLUTION
Автор

I get this error
Error: Superclass has no method named 'initState'.
super.initState();

where should the initState be defined rather?
and what do we need this for exactly?

Thank you for your time!

in main.dart too ?

CanCaner