diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 16bf5b7..04619b7 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -620,7 +620,7 @@ "languageVersion": "2.8" } ], - "generated": "2020-10-27T02:24:43.007495Z", + "generated": "2020-11-02T09:37:11.598457Z", "generator": "pub", "generatorVersion": "2.8.2" } diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/example/ios/Runner/Base.lproj/Main.storyboard index f3c2851..6f73d39 100644 --- a/example/ios/Runner/Base.lproj/Main.storyboard +++ b/example/ios/Runner/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,13 +16,14 @@ - + - + + diff --git a/lib/pages/wallet_page/wallet_page_bloc.dart b/lib/pages/wallet_page/wallet_page_bloc.dart index e9d87ec..f949f30 100644 --- a/lib/pages/wallet_page/wallet_page_bloc.dart +++ b/lib/pages/wallet_page/wallet_page_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:zhiying_base_widget/utils/contants.dart'; -import 'package:zhiying_base_widget/widgets/wallet/wallet_appbar/model/WalletAppbarModel.dart'; +import 'package:zhiying_base_widget/widgets/wallet/wallet_appbar/model/wallet_appbar_model.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_data/model/wallet_header_model.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -11,7 +11,7 @@ import 'package:zhiying_comm/zhiying_comm.dart'; class WalletPageBloc extends BlocBase { StreamController>> _tabController = - StreamController>>(); + StreamController>>(); Stream>> get outData => _tabController.stream; @@ -26,10 +26,10 @@ class WalletPageBloc extends BlocBase { loadData(String skipIdentifier) { NetUtil.request('/api/v1/mod/${skipIdentifier}', method: NetMethod.GET, onCache: (data) { - _loadData(data); - }, onSuccess: (data) { - _loadData(data); - }); + _loadData(data); + }, onSuccess: (data) { + _loadData(data); + }); } void refresh() {} @@ -43,7 +43,7 @@ class WalletPageBloc extends BlocBase { for (var item in list) { if (item['mod_name'] == "my_wallet_appbar") { WalletAppbarModel walletAppbarModel = - WalletAppbarModel.fromJson(json.decode(item["data"])); + WalletAppbarModel.fromJson(json.decode(item["data"])); backgroundColor = HexColor.fromHex(walletAppbarModel.appBarBgColor); break; } diff --git a/lib/widgets/home/home_banner/bloc/home_banner_repository.dart b/lib/widgets/home/home_banner/bloc/home_banner_repository.dart index a9481a1..e7cfb22 100644 --- a/lib/widgets/home/home_banner/bloc/home_banner_repository.dart +++ b/lib/widgets/home/home_banner/bloc/home_banner_repository.dart @@ -1,41 +1,46 @@ import 'dart:convert'; import 'package:flutter/cupertino.dart'; -import 'package:zhiying_base_widget/widgets/home/home_banner/model/HomeBannerModel.dart'; +import 'package:zhiying_base_widget/widgets/home/home_banner/model/home_banner_model.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/util/net_util.dart'; class HomeBannerRepository { /// 读取缓存数据 - Future fetchCacheData({@required Map model}) async { + Future fetchCacheData( + {@required Map model}) async { var result = await NetUtil.getRequestCachedData('/api/v1/mod', params: { 'ids': [model['mod_id']] }); - if(NetUtil.isSuccess(result) && !EmptyUtil.isEmpty(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA])){ - return HomeBannerModel.fromJson(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA]); + if (NetUtil.isSuccess(result) && + !EmptyUtil.isEmpty(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA])) { + return HomeBannerModel.fromJson( + result[GlobalConfig.HTTP_RESPONSE_KEY_DATA]); } return null; } /// 获取父类传进来的数据 - Future fetchParentData({@required Map model}) async{ + Future fetchParentData( + {@required Map model}) async { try { String jsonInfo = model['data']; if (!EmptyUtil.isEmpty(jsonInfo)) { return HomeBannerModel.fromJson(jsonDecode(jsonInfo)); } - }catch(e){ + } catch (e) { Logger.log(e); } return null; - } /// 获取网路数据 - Future fetchNetData({@required Map model}) async { + Future fetchNetData( + {@required Map model}) async { // print('请求 modId = $model['mod_id']'); - var result = await NetUtil.post('/api/v1/mod', params: {'ids': [model['mod_id']]}, cache: true); + var result = await NetUtil.post( + '/api/v1/mod', params: {'ids': [model['mod_id']]}, cache: true); if (NetUtil.isSuccess(result)) { return HomeBannerModel.fromJson(result); } diff --git a/lib/widgets/home/home_banner/bloc/home_banner_state.dart b/lib/widgets/home/home_banner/bloc/home_banner_state.dart index 81d5dbc..065ed29 100644 --- a/lib/widgets/home/home_banner/bloc/home_banner_state.dart +++ b/lib/widgets/home/home_banner/bloc/home_banner_state.dart @@ -1,5 +1,5 @@ import 'package:equatable/equatable.dart'; -import 'package:zhiying_base_widget/widgets/home/home_banner/model/HomeBannerModel.dart'; +import 'package:zhiying_base_widget/widgets/home/home_banner/model/home_banner_model.dart'; abstract class HomeBannerState extends Equatable { const HomeBannerState(); diff --git a/lib/widgets/home/home_banner/home_banner_widget.dart b/lib/widgets/home/home_banner/home_banner_widget.dart index 46edc7c..2a3793f 100644 --- a/lib/widgets/home/home_banner/home_banner_widget.dart +++ b/lib/widgets/home/home_banner/home_banner_widget.dart @@ -4,7 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:zhiying_base_widget/widgets/home/home_banner/bloc/bloc.dart'; import 'package:zhiying_base_widget/widgets/home/home_banner/bloc/home_banner_repository.dart'; import 'package:zhiying_base_widget/widgets/home/home_banner/home_banner_sk.dart'; -import 'package:zhiying_base_widget/widgets/home/home_banner/model/HomeBannerModel.dart'; +import 'package:zhiying_base_widget/widgets/home/home_banner/model/home_banner_model.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; /// @@ -23,7 +23,8 @@ class _HomeBannerWidgetState extends State { @override Widget build(BuildContext context) { return BlocProvider( - create: (_) => HomeBannerBloc(repository: HomeBannerRepository()) + create: (_) => + HomeBannerBloc(repository: HomeBannerRepository()) ..add(HomeBannerInitEvent(widget.model)), child: HomeBannerContainer( model: widget.model, diff --git a/lib/widgets/home/home_banner/model/HomeBannerModel.dart b/lib/widgets/home/home_banner/model/home_banner_model.dart similarity index 100% rename from lib/widgets/home/home_banner/model/HomeBannerModel.dart rename to lib/widgets/home/home_banner/model/home_banner_model.dart diff --git a/lib/widgets/wallet/wallet_appbar/model/WalletAppbarModel.dart b/lib/widgets/wallet/wallet_appbar/model/wallet_appbar_model.dart similarity index 100% rename from lib/widgets/wallet/wallet_appbar/model/WalletAppbarModel.dart rename to lib/widgets/wallet/wallet_appbar/model/wallet_appbar_model.dart