music unexpectedly play when app is close | Flutter

i have an application and i play music for user while using it.
so i handle when user is not in resuming mode the song should stop. it works very fine but i found a bug.
the bug is when i minimize the app and go to some app like Instagram and see a reels when tap the home screen and suddenly the music play. but my AppLifecycleState doesn’t change.
this is my code :

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(
    LayoutBuilder(
      builder: ((context, constraints) {
        Responsive().init(constraints: constraints);
        return const MaterialApp(
          debugShowCheckedModeBanner: false,
          home: AppRouter(),
        );
      }),
    ),
  );
}

class AppRouter extends StatefulWidget {
  const AppRouter({super.key});

  @override
  State<AppRouter> createState() => _AppRouterState();
}

class _AppRouterState extends State<AppRouter> with WidgetsBindingObserver {
  List<AppLifecycleState> appStates = [];

  Future<void> _playAudio() async {
    await QUser().audioPlayer.play(AssetSource(QUser().audioSource));
  }

  bool wasAudioPlaying = true;

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) async {
    log(state.toString());

    if (appStates.length > 10) {
      final last = appStates[appStates.length - 1];
      appStates = [];
      appStates.add(last);
    }
    appStates.add(state);

    if (state == AppLifecycleState.resumed) {
      if (wasAudioPlaying) {
        await QUser().audioPlayer.resume();
      }
    } else {
      if (appStates[appStates.length - 2] == AppLifecycleState.resumed) {
        if (QUser().audioPlayer.state == PlayerState.playing) {
          wasAudioPlaying = true;
        } else if (QUser().audioPlayer.state == PlayerState.paused) {
          wasAudioPlaying = false;
        }
      }

      await QUser().audioPlayer.pause();
    }
  }

  @override
  initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
  }

  @override
  dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return BlocProvider<AppBloc>(
      create: (context) => AppBloc(),
      child: BlocConsumer<AppBloc, AppState>(
        listener: (context, state) async {
          if (state.isLoading) {
            LoadingScreen().show(
              context: context,
              text: "منتظر بمانید",
            );
          } else {
            LoadingScreen().hide();
          }

          if (state.exception is InternetConnectionException) {
            await showErrorDialog(
              context: context,
              text: "ارتباط خود را با اینترنت بررسی نمیایید",
            );
          } else if (state.exception is GenericException) {
            await showErrorDialog(
              context: context,
              text: "مشکلی پیش آمده، لطفا دوباره تلاش کنید",
            );
          }
        },
        builder: (context, state) {
          if (state is OnboardingAppState) {
            return const OnBoardingView();
          } else if (state is RegisterAppState) {
            return const RegisterView();
          } else if (state is AppRulesAppState) {
            return const AppRulesView();
          } else if (state is LoginAppState) {
            return const LoginView();
          } else if (state is ChooseProfileIconAppState) {
            return ChooseProfileIconView(
              isRegistered: state.isRegistered,
            );
          } else if (state is ConfirmNumberAppState) {
            return ConfirmNumberView(
              isRegistered: state.isRegistered,
            );
          } else if (state is ProfileAppState) {
            return const ProfileView();
          } else if (state is HomeAppState) {
            if (QUser().audioPlayer.state == PlayerState.paused) {
              return HomeView(
                runAnimation: state.runAnimation,
              );
            } else {
              QUser().audioPlayer.setReleaseMode(ReleaseMode.loop);
              _playAudio();
              return HomeView(
                runAnimation: state.runAnimation,
              );
            }
          } else if (state is RulesAppState) {
            return const RulesView();
          } else if (state is CommentAppState) {
            return const CommentView();
          } else if (state is CategoryAppState) {
            return const CategoryView();
          } else if (state is PickPlayerAppState) {
            return const PickPlayerView();
          } else if (state is SelectTimeAppState) {
            return const SelectTimeView();
          } else if (state is GameAppState) {
            return GameView(
              question: state.question,
              player: state.player,
              seconds: state.seconds,
            );
          } else if (state is GameEndAppState) {
            return const GameEndView();
          } else if (state is InitialAppState) {
            return const InitialApp();
          } else {
            context.read<AppBloc>().add(const InitialAppEvent());
            return const Scaffold(
              body: Center(
                child: CircularProgressIndicator(),
              ),
            );
          }
        },
      ),
    );
  }
}

when my app is closed or minimized the song shouldn’t play at all. i handle it very well but when i play a sound from somewhere else like Instagram the app doesn’t work properly

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật