Usage

import 'package:memory_checker/memory_checker.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      ...
      navigatorObservers: [
        LeakObserver()
      ],
    );
  }
}

LeakObserver will notify if there are some leaks found by VMService

Welcome for pr: https://github.com/asjqkkkk/memory_checker/compare

Welcome for issue: https://github.com/asjqkkkk/memory_checker/issues/new

Notice

If you meet this error: Bad state: Insecure HTTP is not allowed by platform

you need add some file to solve this problem

Android

This behavior may be omitted following migration guide: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android.

add in android/app/src/main/AndroidManifest.xml:

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="receipt"
        android:usesCleartextTraffic="true" <!-- This Line -->
        android:icon="@mipmap/ic_launcher">

iOS

Allow insecure/HTTP requests globally across your application on iOS, you can add this to your ios/Runner/info.plist under the main dictionary definition:

<key>NSAppTransportSecurity</key>
<dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
</dict>

Be warned that you will need to have an explanation for Apple's review team when enabling this, otherwise your app will get rejected on submission.

(see Bad state: Insecure HTTP is not allowed by platform)

Performance

If there is a page leak:

image

Then tap it:

image

And you can see the leak retainpath:

image

Libraries

all
animation_widgets
checker_util
common_ui
cus_expansionTile
draggable_button
iso_pool
leak_info_page
leak_instance_page
leak_observer
leak_page
memory_checker
overlay_util