작성
·
530
·
수정됨
0
계속 이부분에서 오류가 나는데, 오류 설명이 이렇습니다.
어떻게 해결해야 할까요..
lib/common/provider/go_router.dart:15:24:
Error: The argument type 'String? Function(GoRouterState)' can't be assigned to the parameter type 'FutureOr<String?> Function(BuildContext, GoRouterState)?'.
- 'GoRouterState' is from 'package:go_router/src/state.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/go_router-12.0.1/lib/src/state.dart').
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
redirect: provider.redirectLogic,
^
Restarted application in 587ms.
------------------------------------------------------
위부분의 문제를 redirectLogic을 타고들어가 기존 제너릭 앞에 buildContext context를 넣어주니 오류는 사라졌습니다. 그런데 앱실행 후에 또 다른 문제가 발생했습니다;
화면은 계속 이 상태에 머물러 있고,
에러는 이렇게 뜹니다. 이건 어떻게 해야할까요ㅠㅠ
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]
Unhandled Exception: DioException [bad response]: The request returned an invalid status code of 401.
E/flutter (13865): #0 DioMixin.fetch.<anonymous closure> (package:dio/src/dio_mixin.dart:507:7)
E/flutter (13865): #1 _RootZone.runUnary (dart:async/zone.dart:1661:54)
E/flutter (13865): #2 FutureListener.handleError (dart:async/futureimpl.dart:174:22)
E/flutter (13865): #3 Future._propagateToListeners.handleError (dart:async/future_impl.dart:852:47)
E/flutter (13865): #4 Future._propagateToListeners (dart:async/future_impl.dart:873:13)
E/flutter (13865): #5 Future._completeError (dart:async/future_impl.dart:649:5)
E/flutter (13865): #6 SyncCompleter.completeError (dart:async/future_impl.dart:60:12)
E/flutter (13865): #7 Completer.completeError (dart:async/futureimpl.dart:26:5)
E/flutter (13865): #8 Future.any.onError (dart:async/future.dart:620:45)
E/flutter (13865): #9 _RootZone.runBinary (dart:async/zone.dart:1666:54)
E/flutter (13865): #10 FutureListener.handleError (dart:async/futureimpl.dart:171:22)
E/flutter (13865): #11 Future._propagateToListeners.handleError (dart:async/future_impl.dart:852:47)
E/flutter (13865): #12 Future._propagateToListeners (dart:async/future_impl.dart:873:13)
E/flutter (13865): #13 Future._completeError (dart:async/future_impl.dart:649:5)
E/flutter (13865): #14 Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:739:7)
E/flutter (13865): #15 microtaskLoop (dart:async/schedulemicrotask.dart:40:21)
E/flutter (13865): #16 startMicrotaskLoop (dart:async/schedulemicrotask.dart:49:5)
일부 서치글을 통해 에뮬레이터 앱을 지우고 새로 여니 로그인화면으로 넘어갔습니다! 이 문제는 해결됐습니다~