Flutter current route active tracking debug

route_active_mixin.dart

import 'package:flutter/material.dart';
import 'package:nft/my_app.dart';
import 'package:nft/utils/app_log.dart';

mixin RouteActiveMixin<T extends StatefulWidget> on State<T>
implements RouteAware {
bool _subscribed = false;
bool active = false;

@override
void didChangeDependencies() {
super.didChangeDependencies();
if (!_subscribed) {
MyApp.routeObserver.subscribe(this, ModalRoute.of(context));
_subscribed = true;
}
}

@override
void dispose() {
if (_subscribed) {…

--

--

nhancv.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store