搜索插件、代码仓与 APP 分类

GitHub 代码仓andrea689/flutter_bloc_devtools

flutter_bloc_devtools

用于 flutter_bloc 的远程 DevTools。此包将所有 Bloc(不支持 Cubit)连接到远程 DevTools 服务器,使开发者能够在运行时检查 Bloc 的变化。

flutter_bloc_devtools 项目封面
星标
70
复刻
15
最近推送(UTC)
2021年12月30日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Remote Devtools for flutter_bloc

Remote Devtools support for Blocs of flutter_bloc.

N.B. Cubit is not supported

Devtools Demo

Installation

Add the library to pubspec.yaml:

dependencies:
  flutter_bloc_devtools: ^0.1.0

BlocObserver configuration

Add RemoteDevToolsObserver to your Bloc.observer:

void main() async {
  final observer = RemoteDevToolsObserver('192.168.1.7:8000');
  await observer.connect();
  Bloc.observer = observer;

  runApp(const CounterApp());
}

Making your Events and States Mappable

Events and States have to implements Mappable:

class CounterState extends Equatable implements Mappable {
  final int counter;

  const CounterState({
    this.counter,
  });

  @override
  List<Object> get props => [
        counter,
      ];

  @override
  Map<String, dynamic> toMap() => {
        'counter': counter,
      };
}

Using remotedev

Use the Javascript Remote Devtools package. Start the remotedev server on your machine

npm install -g remotedev-server
remotedev --port 8000

Run your application. It will connect to the remotedev server. You can now debug your flutter_bloc application by opening up http://localhost:8000 in a web browser.

Examples

Andrea Valenzano GitHub avatar
GitHub 作者

Andrea Valenzano ↗

Software Engineer @ 3Bee - Flutter enthusiast

Catania
语言DartRubySwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项

  • bloc^6.1.0
  • socketcluster_client^0.2.0
  • pedantic开发依赖^1.9.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗