基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

40 line
969 B

  1. import 'dart:async';
  2. import 'package:zhiying_comm/util/base_bloc.dart';
  3. import 'package:zhiying_comm/zhiying_comm.dart';
  4. class WalletPageBloc extends BlocBase {
  5. List<Map<String, dynamic>> _tabs = List();
  6. StreamController<List<Map<String, dynamic>>> _tabController =
  7. StreamController<List<Map<String, dynamic>>>();
  8. Stream<List<Map<String, dynamic>>> get outData => _tabController.stream;
  9. @override
  10. void dispose() {
  11. _tabController.close();
  12. _tabController = null;
  13. }
  14. loadData(String skipIdentifier) {
  15. NetUtil.request('/api/v1/mod/${skipIdentifier}', method: NetMethod.GET,
  16. onCache: (data) {
  17. _loadData(data);
  18. }, onSuccess: (data) {
  19. _loadData(data);
  20. });
  21. }
  22. void refresh() {}
  23. ///处理加载的数据
  24. void _loadData(data) {
  25. print(data["mod_lis"]);
  26. var list = List.from(data["mod_list"]).map((v) {
  27. return Map<String, dynamic>.from(v);
  28. }).toList();
  29. _tabController.add(list);
  30. }
  31. }