A visualized dynamic programming for log collection based on flutter.

Related tags

Templates magpie_log
Overview

A visualized dynamic programming for log collection based on flutter.

Pub使用

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';

Dart使用方式

在自己工程首页调用MagpieLog.instance.init初始化方法

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

这里需要注意context必须是包含Navigator的context

redux圈选使用方式

redux圈选 你的工程需要使用flutter-redux做状态管理 需要注入一个中间件CircleMiddleWare

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

其中的AppState也就是store存储的数据集必须继承LogState 因为我们需要toJson方法才能更好的获取参数

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

随后就可以使用我们的redux圈选

页面圈选使用

需要注册navigator监听LogObserver,当然我们需要你显示的设置页面settings这样我们才能获取页面的唯一标识

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

setState()圈选使用

继承WidgetLogState即可实现对应方法

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.服务端配合,动态化配置的上传和加载

2.级联赋值问题 导致日志参数和数据一样,可以增加用户配置

3.store 参数为空 级联圈参null不全问题

致谢

1.感谢PonnamKarthik的fluttertoast插件

2.感谢Rubber的rubber插件

Mapie系列链接

Mapie包含了一系列的开源项目,访问对应仓库以便了解更多。

Magpie Workflow

Flutter可视化工作流。 https://github.com/wuba/magpie

Magpie Native&Dart SDK

与Workflow配套,用于接入App,Flutter的SDK。https://github.com/wuba/magpie_sdk

Magpie Fly

所见即所得的Flutter UI组件库。https://github.com/wuba/magpie_fly

You might also like...

Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Compatibility ✅ Android ❌ iOS (active issue: iOS support for quick actions) Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? F

Sep 26, 2022

Dynamic Text Highlighting (DTH) package for Dart & Flutter.

Dynamic Text Highlighting (DTH) package for Dart & Flutter.

Dynamic Text Highlighting (DTH) This package is used to highlight, in a completely dynamic way, keywords, or phrases, wherever they are present in a s

Oct 3, 2022

Flutter Insert, Update, Delete and add form view dynamic

salesapp Insert, Update, Delete and form view add dynamic. Getting Started This project is a starting point for a Flutter application. A few resources

Dec 22, 2021

Flutter drawer (dynamic ready side menu)

Flutter drawer (dynamic ready side menu)

Flutter side menu (Drawer) Getting Started Use KFDrawer widget as Scaffold's body with items property (ListKFDrawerItem) you should define onPressed

Dec 5, 2022

Wallpaper App made with Flutter with Dynamic Theming.

Wallpaper App made with Flutter with Dynamic Theming.

Wallpaper App made with Flutter This is a wallpaper app made with flutter. This is just a UI demo. If you want to learn how to apply an image as wallp

Jan 2, 2023

Home app - A dynamic flutter app which can be used to generate alerts, set alarms and send sms or call someone

Home app - A dynamic flutter app which can be used to generate alerts, set alarms and send sms or call someone

first_app A dynamic flutter app which can be used to generate alerts, set alarms

Apr 9, 2022

Esizer - A Flutter package provide responsive, dynamic, configurable size for each device screen size

Esizer - A Flutter package provide responsive, dynamic, configurable size for each device screen size

ESizer A Flutter package provide responsive, dynamic, configurable size for each

Feb 15, 2022

A Flutter plugin to use iOS 16.1+ Live Activities ⛹️ & iPhone 14 Pro Dynamic Island ⚫️ features

A Flutter plugin to use iOS 16.1+ Live Activities ⛹️ & iPhone 14 Pro Dynamic Island ⚫️ features

Live Activities A Flutter plugin to use iOS 16.1+ Live Activities & iPhone 14 Pro Dynamic Island features. 🧐 What is it ? This plugin use iOS Activit

Dec 26, 2022

Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

widget_tree_depth_counter Widget Tree Depth Counter WidgetTreeDepthCounter is a simple widget to count the amount of nested widget tree, useful in the

Aug 1, 2022
Comments
  • Demo运行报错

    Demo运行报错

    error: /Users/sj1910/Downloads/magpie_log-master/example/ios/Flutter/Debug.xcconfig:2: could not find included file 'Flutter.xcconfig' in search paths (in target 'Runner' from project 'Runner')

    opened by sj1910 0
Owner
Wuba
Wuba Open Source
Wuba
Vineet Kalghatgi 32 May 13, 2022
Dynamic var - Dart dilinde dynamic ve var veri tiplerini anlamanızı kolaylaştıracak örnektir.

dynamic ve var arasındaki fark dynamic Tanımlanan değişkenin tipi daha sonra kod içerisinde değişebilir. Örneğin int olarak tanımlanan bir a değişkeni

Abdullah Sevmez 0 Jan 1, 2022
A simple log catch server powered by flutter.

flutter_logcat A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

bebe 1 Jan 9, 2022
A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14

Facebook Sdk For Flutter LinkedIn GitHub facebook_sdk_flutter allows you to fetch deep links, deferred deep links and log facebook app events. This wa

Saad Farhan 23 Dec 17, 2022
How login , register and log out Firebase Textformfield with focusNode. InheritedWidget example.

flutter_fire_base_register How login, register and log out Firebase. Textformfield with focusNode InheritedWidget exam. Stream provider usage. App Hom

Taylan YILDIZ 1 May 8, 2021
All four are used to log into a Firebase backend.

Auth This library package works with four plugins: firebase_auth google_sign_in flutter_facebook_login flutter_twitter All four are used to log into a

Andrious Solutions Ltd. 46 Dec 14, 2022
The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files.

ArDrive Web The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files. Have any questions? Join the ArDrive

ArDrive App 36 Dec 14, 2022
Flutter-Apps-Collection: a collection of apps made in flutter for learning purpose

Flutter-Apps-Collection This is a repository of a collection of apps made in flutter for learning purpose Some Screenshots . . . Apps build in Flutter

Himanshu Singh 96 May 27, 2022
A dynamic, Stream-based API for job scheduling in Dart, capable of processing on different triggers.

Pendulum A library for task-scheduling in Dart. Exports a Task class that returns Streams, with a number of versatile options to customize how Tasks a

Aditya Kishore 1 Aug 22, 2020
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Divyanshu Shekhar 39 Sep 26, 2022