Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Library not compatible with flutter 3.16.0 - incorrect type definition #164

@ghost

Description

Description

This library cannot be used with flutter 3.16.0 as one of it's functions contains a method call that returns a future which is incorrectly assigned to a different type causing the compilation error.

Steps to reproduce

  1. Install flutter
  2. Use this library - I use DioAdapter like so: DioAdapter dioAdapter = DioAdapter(dio: myDioInstance); dioAdapter.onPost(...);
  3. See error
../../../.pub-cache/hosted/pub.dev/http_mock_adapter-0.6.0/lib/src/mixins/request_handling.dart:32:42: Error: A value of type 'FutureOr<List<int>>' can't be assigned to a variable of type 'List<int>'.
 - 'List' is from 'dart:core'.
          bytes = options.requestEncoder!(data, options);

Expected behavior

Library can be used with no issues.

System details

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1.1 23B81 darwin-arm64, locale en-NZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.84.2)
[✓] Connected device (3 available)
[✓] Network resources

Additional context

Offending line: https://github.com/lomsa-dev/http-mock-adapter/blob/e8298ff3e8e669ca44edbe3c41b8b2f0d4303839/lib/src/mixins/request_handling.dart#L32

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions