Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: UnimplementedError: dispose() has not been implemented. #1203

Closed
maknon opened this issue Mar 9, 2024 · 2 comments
Closed

Error: UnimplementedError: dispose() has not been implemented. #1203

maknon opened this issue Mar 9, 2024 · 2 comments
Assignees
Labels
1 backlog bug Something isn't working

Comments

@maknon
Copy link

maknon commented Mar 9, 2024

Which API doesn't behave as documented, and how does it misbehave?
Name here the specific methods or fields that are not behaving as documented, and explain clearly what is happening.

Minimal reproduction project

import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:just_audio/just_audio.dart';

void main() {
  runApp(MaterialApp(
    home: MyApp(),
    scrollBehavior: const ScrollBehavior().copyWith(dragDevices: {
      PointerDeviceKind.touch,
      PointerDeviceKind.mouse,
    }),
  ));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  PageController page = PageController(initialPage: 0);
  late AudioPlayer player;

  @override
  void initState() {
    super.initState();
    player = AudioPlayer();
  }

  @override
  void dispose() {
    player.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Page View Example"),
      ),
      body: PageView(
        onPageChanged: (int page) async {
          player.stop();
          final List<UriAudioSource> mediaList = [];
          mediaList.add(AudioSource.uri(Uri.parse(
                'https://everyayah.com/data/Abu_Bakr_Ash-Shaatree_64kbps/001001.mp3')));
          final playlist = ConcatenatingAudioSource(
            useLazyPreparation: true,
            shuffleOrder: DefaultShuffleOrder(),
            children: mediaList,
          );
          await player.setAudioSource(
              playlist, initialIndex: 0, initialPosition: Duration.zero);
        },
        scrollDirection: Axis.horizontal,
        controller: page,
        pageSnapping: true,
        children: [
          Container(
            child: Center(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text(
                      "Page-1",
                      style: TextStyle(color: Colors.white, fontSize: 20),
                    ),
                  ],
                )
            ),
            color: Colors.pinkAccent,
          ),
          Container(
              child: Center(
                  child: Text(
                    "Page-2",
                    style: TextStyle(color: Colors.white, fontSize: 20),
                  )),
              color: Colors.blue
          ),
        ],
      ),
    );
  }
}

To Reproduce (i.e. user steps, not code)
when you swipe back and forth slowly in web version, it throws the error

Error messages

Error: UnimplementedError: dispose() has not been implemented.
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3      throw_
packages/just_audio_platform_interface/just_audio_platform_interface.dart 182:5  dispose
packages/just_audio/just_audio.dart 1494:23                                      _disposePlatform
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31               <fn>
dart-sdk/lib/async/zone.dart 1666:54                                             runBinary
dart-sdk/lib/async/future_impl.dart 177:22                                       handleError
dart-sdk/lib/async/future_impl.dart 850:46                                       handleError
dart-sdk/lib/async/future_impl.dart 871:13                                       _propagateToListeners
dart-sdk/lib/async/future_impl.dart 651:5                                        [_completeError]
dart-sdk/lib/async/future_impl.dart 737:7                                        callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                                 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                                  _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7               <fn>

Flutter SDK version

E:\Support\flutter\bin\flutter.bat doctor --verbose
[!] Flutter (Channel beta, 3.19.0-0.1.pre, on Microsoft Windows [Version 10.0.22631.3235], locale en-US)
    • Flutter version 3.19.0-0.1.pre on channel beta at E:\Support\flutter
    ! The flutter binary is not on your path. Consider adding E:\Support\flutter\bin to your path.
    ! The dart binary is not on your path. Consider adding E:\Support\flutter\bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1a9a60d044 (8 weeks ago), 2024-01-10 13:38:09 -0800
    • Engine revision bbebee1465
    • Dart version 3.3.0 (build 3.3.0-279.0.dev)
    • DevTools version 2.31.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:/Users/ias12/AppData/Local/Android/Sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34525.116
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.3)
    • Android Studio at C:\Users\ias12\AppData\Local\Programs\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11446219)

[√] IntelliJ IDEA Community Edition (version 2024.1)
    • IntelliJ at C:\Users\ias12\AppData\Local\Programs\IntelliJ IDEA Community Edition
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 241.14494.17

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.3235]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 122.0.2365.80

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.
@maknon maknon added 1 backlog bug Something isn't working labels Mar 9, 2024
@ryanheise
Copy link
Owner

Closing since the issue does not follow the submission instructions. Section 1 skipped. Section 2 not followed.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants