|
123456789101112131415161718192021222324252627282930313233343536373839 |
- import 'dart:async';
-
- import 'package:zhiying_comm/util/base_bloc.dart';
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- class WalletPageBloc extends BlocBase {
- List<Map<String, dynamic>> _tabs = List();
-
- StreamController<List<Map<String, dynamic>>> _tabController =
- StreamController<List<Map<String, dynamic>>>();
-
- Stream<List<Map<String, dynamic>>> get outData => _tabController.stream;
-
- @override
- void dispose() {
- _tabController.close();
- _tabController = null;
- }
-
- loadData(String skipIdentifier) {
- NetUtil.request('/api/v1/mod/${skipIdentifier}', method: NetMethod.GET,
- onCache: (data) {
- _loadData(data);
- }, onSuccess: (data) {
- _loadData(data);
- });
- }
-
- void refresh() {}
-
- ///处理加载的数据
- void _loadData(data) {
- print(data["mod_lis"]);
- var list = List.from(data["mod_list"]).map((v) {
- return Map<String, dynamic>.from(v);
- }).toList();
- _tabController.add(list);
- }
- }
|