memory_checker 0.0.5 copy "memory_checker: ^0.0.5" to clipboard
memory_checker: ^0.0.5 copied to clipboard

To finder memory leak by Dart VM Service。Support for Windows/Linux/Android/iOS, not support for Web.

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

5
likes
40
pub points
15%
popularity

Publisher

unverified uploader

To finder memory leak by Dart VM Service。Support for Windows/Linux/Android/iOS, not support for Web.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter, isolate, vm_service

More

Packages that depend on memory_checker