A visualized dynamic programming for log collection based on flutter

A visualized dynamic programming for log collection based on flutter.

Pub use

1. Depend on it

Add this to your package’s pubspec.yaml

dependencies:
 magpie_log: ^1.0.1

2. Install it

You can install packages from the command line:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:magpie_log/magpie_log.dart';

How to use Dart

Call the MagpieLog.instance.initinitialization method on the homepage of your own project

Widget build(BuildContext context) {
    MagpieLog.instance.init(context, 
        ReportMethod.timing, 
        ReportChannel.natives,
        callback: _receiverMagpieData, 
        time: 1 * 60 * 1000,     
        count: 3);
    return Container();
}

It should be noted here that the context must be the context that contains the Navigator

How to use redux circle selection

Redux circle your project needs to use flutter-redux for state management needs to inject a middlewareCircleMiddleWare

final store = Store<AppState>(reducer,
      middleware: [CircleMiddleWare()], initialState: AppState.initState());

The AppState, which is the data set stored by the store, must be inherited LogState because we need the toJson method to get better parameters.

class AppState extends LogState {
  Map<String, dynamic> toJson() => _$AppStateToJson(this);
}

Then you can use our redux circle selection

Use page circle selection

Need to register the navigator to monitor LogObserver, of course we need the settings page settings you display so that we can get the unique identifier of the page

MaterialApp(
    routes: {
      '/': (BuildContext context) => TopScreen(),
      '/UnderScreen': (BuildContext context) => UnderScreen(),
    },
    navigatorObservers: [
      LogObserver<AppState>(),
    ],
    title: 'Flutter Demo',
    theme: ThemeData(primarySwatch: Colors.deepOrange),
  ),

setState() circle to use

The WidgetLogStatecorresponding method can be realized by inheritance

class AddTextState extends WidgetLogState<AddTextWidget> {
  @override
  Map<String, dynamic> toJson() {
    Map map = Map<String, dynamic>();
    map["count"] = count.toString();
    return map;
  }

  @override
  String getActionName() {
    return "AddText";
  }

  @override
  int getIndex() {
    return 0;
  }
}

To be perfected

1. Cooperate with the server to upload and load dynamic configuration

2. The cascade assignment problem causes the log parameters to be the same as the data, which can increase user configuration

3. The store parameter is empty. The cascade circle parameter is null.

Thanks

1. Thanks to the fluttertoast plugin by PonnamKarthik

2. Thanks to Rubber’s rubber plug-in

Mapie series link

Mapie contains a series of open source projects, visit the corresponding repository to learn more.

Magpie Workflow

Flutter visualizes the workflow. https://github.com/wuba/magpie

Magpie Native&Dart SDK

Matched with Workflow, used to access App, Flutter SDK. https://github.com/wuba/magpie_sdk

Magpie Fly

WYSIWYG Flutter UI component library. https://github.com/wuba/magpie_fly

Download Details:

Author: wuba

Source Code: https://github.com/wuba/magpie_log

#flutter #dart #mobile-apps

A visualized dynamic programming for log collection based on flutter
3.65 GEEK