import 'dart:async'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; class MainPageBloc extends BlocBase { Map _mains = Map(); StreamController> _mainController = StreamController>(); Stream> get outData => _mainController.stream; @override void dispose() { _mainController.close(); _mainController = null; } void loadData(List ids) { NetUtil.request('/api/v1/config.json', onSuccess: (data) { List list = data; List> tabs = list.map((item) { return Map.from(item); }).toList(); _mainController.add(tabs.first); }); } }