• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

flutter_flipperkit: Flipper (Extensible mobile app debugger) for flutter.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

flutter_flipperkit

开源软件地址:

https://gitee.com/leanflutter/flutter_flipperkit

开源软件介绍:

flutter_flipperkit

pub version

Table of Contents generated with DocToc

Introduction

Flipper (Extensible mobile app debugger) for flutter. View document

Features

  • Network inspector
  • Shared preferences inspector
  • Redux inspector
  • Database Browser

Quick Start

Prerequisites

Before starting make sure you have:

Installation

Add this to your package's pubspec.yaml file:

dependencies:  flutter_flipperkit: ^0.0.28

Or

dependencies:  flutter_flipperkit:    git:      url: https://github.com/leanflutter/flutter_flipperkit      ref: master

Android

Change your project files according to the example:

android/settings.gradle:

include ':app'def localPropertiesFile = new File(rootProject.projectDir, "local.properties")def properties = new Properties()assert localPropertiesFile.exists()localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }def flutterSdkPath = properties.getProperty("flutter.sdk")assert flutterSdkPath != null, "flutter.sdk not set in local.properties"apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"+ def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()+ def plugins = new Properties()+ def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')+ assert pluginsFile.exists()+ pluginsFile.withReader("UTF-8") { reader -> plugins.load(reader) }+ plugins.each { name, path ->+     def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()+     if (name == 'flutter_flipperkit') {+         include ':flipper-no-op'+         project(':flipper-no-op').projectDir = new File(pluginDirectory, 'flipper-no-op')+     }+ }

iOS

Open ios/Runner.xcworkspace Add a empty Swift file (e.g Runner-Noop.swift) into Runner Group And make sure the Runner-Bridging-Header.h file is created.

Change your project ios/Podfile file according to the example:

# Uncomment this line to define a global platform for your project- # platform :ios, '9.0'+platform :ios, '10.0'# CocoaPods analytics sends network stats synchronously affecting flutter build latency.ENV['COCOAPODS_DISABLE_STATS'] = 'true'project 'Runner', {  'Debug' => :debug,  'Profile' => :release,  'Release' => :release,}def flutter_root  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)  unless File.exist?(generated_xcode_build_settings_path)    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"  end  File.foreach(generated_xcode_build_settings_path) do |line|    matches = line.match(/FLUTTER_ROOT\=(.*)/)    return matches[1].strip if matches  end  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"endrequire File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)flutter_ios_podfile_setuptarget 'Runner' do  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))endpost_install do |installer|  installer.pods_project.targets.each do |target|    flutter_additional_ios_build_settings(target)  endend

Usage

import 'package:flutter_flipperkit/flutter_flipperkit.dart';void main() {  FlipperClient flipperClient = FlipperClient.getDefault();  flipperClient.addPlugin(new FlipperNetworkPlugin(    // If you use http library, you must set it to false and use https://pub.dev/packages/flipperkit_http_interceptor    // useHttpOverrides: false,    // Optional, for filtering request    filter: (HttpClientRequest request) {      String url = '${request.uri}';      if (url.startsWith('https://via.placeholder.com') || url.startsWith('https://gravatar.com')) {        return false;      }      return true;    }  ));  flipperClient.addPlugin(new FlipperReduxInspectorPlugin());  flipperClient.addPlugin(new FlipperSharedPreferencesPlugin());  flipperClient.start();  runApp(MyApp());}...

Please refer to examples, to integrate flutter_flipperkit into your project.

You can install packages from the command line:

$ flutter clean$ flutter packages get

Run the app

$ flutter run

Related Links

Discussion

If you have any suggestions or questions about this project, you can discuss it by Telegram Group with me.

License

MIT LicenseCopyright (c) 2019-2021 LiJianying <[email protected]>Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap