A visualized dynamic programming for log collection based on flutter.
Add this to your package’s pubspec.yaml
dependencies:
magpie_log: ^1.0.1
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.
Now in your Dart code, you can use:
import 'package:magpie_log/magpie_log.dart';
Call the MagpieLog.instance.init
initialization 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
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
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),
),
The WidgetLogState
corresponding 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;
}
}
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.
1. Thanks to the fluttertoast plugin by PonnamKarthik
2. Thanks to Rubber’s rubber plug-in
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
Author: wuba
Source Code: https://github.com/wuba/magpie_log
#flutter #dart #mobile-apps