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