godilite / FlutterLaravel

This is just a simple app to show how to Authenticate a flutter app with Laravel passport
43 stars 27 forks source link

Unhandled Exception: Failed assertion: boolean expression must not be null #2

Open Malemelo opened 4 years ago

Malemelo commented 4 years ago

E/flutter (28696): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: Failed assertion: boolean expression must not be null E/flutter (28696): #0 _LoginState._login (package:flutter_app/screen/login.dart:181:12) E/flutter (28696): E/flutter (28696): #1 _LoginState.build. (package:flutter_app/screen/login.dart:130:39) E/flutter (28696): #2 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14) E/flutter (28696): #3 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:789:36) E/flutter (28696): #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter (28696): #5 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11) E/flutter (28696): #6 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5) E/flutter (28696): #7 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7) E/flutter (28696): #8 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:467:9) E/flutter (28696): #9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) E/flutter (28696): #10 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:117:9) E/flutter (28696): #11 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) E/flutter (28696): #12 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18) E/flutter (28696): #13 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7) E/flutter (28696): #14 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter (28696): #15 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter (28696): #16 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter (28696): #17 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter (28696): #18 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter (28696): #19 _rootRunUnary (dart:async/zone.dart:1138:13) E/flutter (28696): #20 _CustomZone.runUnary (dart:async/zone.dart:1031:19) E/flutter (28696): #21 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7) E/flutter (28696): #22 _invoke1 (dart:ui/hooks.dart:273:10) E/flutter (28696): #23 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5) E/flutter (28696):

h4rDkur commented 4 years ago

@Malemelo, you might have some backend issues

at login.dart or register.dart

    var res = await Network().authData(data, '/login');
    var body = json.decode(res.body);

    print(body); 

print body so it shows you the error. you might be missing some classess at controller if you are using laravel based on https://medium.com/swlh/authenticating-flutter-application-with-laravel-api-caea30abd57