基础组件库
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.

wallet_page_bloc.dart 747 B

1234567891011121314151617181920212223242526272829
  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. void refresh() {
  15. NetUtil.request('/api/v1/config.json', onSuccess: (data) {
  16. List list = data;
  17. _tabs = list.map((item) {
  18. return Map<String, dynamic>.from(item);
  19. }).toList();
  20. _tabController.add(_tabs);
  21. });
  22. }
  23. }