pub.dev 사이트에 modal_bottom_sheet 패키지가 있습니다.
이거 사용하려고 패키지를 받았더니 이런화면이 등장합니다...
: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
../…/bottom_sheets/bar_bottom_sheet.dart:102
.push(ModalBottomSheetRoute<T>(
^^^^^^^^^^^^^^^^^^^^^
: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
../…/bottom_sheets/bar_bottom_sheet.dart:125
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return result;
^
구글링을 하다가 현재 플러터 버전과 라이브러리의 버전이 호환되지 않아 에러가 발생했다는 것을 알게되었고, 해결책을 발견했습니다.
dependency_overrides:
modal_bottom_sheet: ^3.0.0-pre
이 내용을 pubspec.yaml 파일에 추가하면 에러를 해결할 수 있습니다.
버전이 맞지 않는 라이브러리는 에러가 발생할 수 있습니다.