@@ -614,7 +614,7 @@ | |||||
"languageVersion": "2.1" | "languageVersion": "2.1" | ||||
} | } | ||||
], | ], | ||||
"generated": "2020-10-14T02:50:46.733318Z", | |||||
"generated": "2020-10-14T06:28:04.630762Z", | |||||
"generator": "pub", | "generator": "pub", | ||||
"generatorVersion": "2.8.2" | "generatorVersion": "2.8.2" | ||||
} | } |
@@ -9,6 +9,7 @@ import 'package:zhiying_base_widget/utils/contants.dart'; | |||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:provider/provider.dart'; | import 'package:provider/provider.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | |||||
import 'hot_ranking_page_bloc.dart'; | import 'hot_ranking_page_bloc.dart'; | ||||
@@ -80,14 +81,13 @@ class __HotRankingPageContainerState extends State<_HotRankingPageContainer> { | |||||
return StreamBuilder( | return StreamBuilder( | ||||
stream: _bloc.outData, | stream: _bloc.outData, | ||||
builder: (context, asyncSnapshot) { | builder: (context, asyncSnapshot) { | ||||
var model = asyncSnapshot.data; | var model = asyncSnapshot.data; | ||||
if (model == null) { | if (model == null) { | ||||
return HotRankingPageSkeleton(); | return HotRankingPageSkeleton(); | ||||
} | } | ||||
for (var item in model) { | for (var item in model) { | ||||
WidgetModel widgetModel = | WidgetModel widgetModel = | ||||
WidgetModel.fromJson(Map<String, dynamic>.from(item)); | |||||
WidgetModel.fromJson(Map<String, dynamic>.from(item)); | |||||
if (item.containsKey("mod_name") && | if (item.containsKey("mod_name") && | ||||
item['mod_name'] == "hot_rank_bg_img") { | item['mod_name'] == "hot_rank_bg_img") { | ||||
_bloc.backgroundImage = json.decode(item['data'])['bg_img']; | _bloc.backgroundImage = json.decode(item['data'])['bg_img']; | ||||
@@ -124,7 +124,7 @@ class __HotRankingPageContainerState extends State<_HotRankingPageContainer> { | |||||
} else { | } else { | ||||
for (var item in model) { | for (var item in model) { | ||||
WidgetModel widgetModel = | WidgetModel widgetModel = | ||||
WidgetModel.fromJson(Map<String, dynamic>.from(item)); | |||||
WidgetModel.fromJson(Map<String, dynamic>.from(item)); | |||||
if (item.containsKey("mod_name") && | if (item.containsKey("mod_name") && | ||||
item['mod_name'] == "hot_rank_tab_view") { | item['mod_name'] == "hot_rank_tab_view") { | ||||
list.add(Expanded( | list.add(Expanded( | ||||
@@ -149,14 +149,22 @@ class _SilverAppBarDelegate extends SliverPersistentHeaderDelegate { | |||||
final Widget child; | final Widget child; | ||||
@override | @override | ||||
double get minExtent => MediaQuery.of(context).padding.top + 44; | |||||
double get minExtent => | |||||
MediaQuery | |||||
.of(context) | |||||
.padding | |||||
.top + 44; | |||||
@override | @override | ||||
double get maxExtent => MediaQuery.of(context).padding.top + 44; | |||||
double get maxExtent => | |||||
MediaQuery | |||||
.of(context) | |||||
.padding | |||||
.top + 44; | |||||
@override | @override | ||||
Widget build( | |||||
BuildContext context, double shrinkOffset, bool overlapsContent) { | |||||
Widget build(BuildContext context, double shrinkOffset, | |||||
bool overlapsContent) { | |||||
return child; | return child; | ||||
} | } | ||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; | |||||
import 'package:zhiying_base_widget/widgets/hot_ranking/hot_ranking_appbar/model/hot_ranking_appbaar_model.dart'; | import 'package:zhiying_base_widget/widgets/hot_ranking/hot_ranking_appbar/model/hot_ranking_appbaar_model.dart'; | ||||
import 'package:zhiying_comm/util/extension/color.dart'; | import 'package:zhiying_comm/util/extension/color.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | |||||
class HotRankingAppBar extends StatelessWidget { | class HotRankingAppBar extends StatelessWidget { | ||||
final Map<String, dynamic> data; | final Map<String, dynamic> data; | ||||
@@ -14,31 +15,36 @@ class HotRankingAppBar extends StatelessWidget { | |||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
var model = HotRankingAppbarModel.fromJson(json.decode(data['data'])); | var model = HotRankingAppbarModel.fromJson(json.decode(data['data'])); | ||||
return Container( | return Container( | ||||
height: MediaQuery.of(context).padding.top + 56, | |||||
height: MediaQuery | |||||
.of(context) | |||||
.padding | |||||
.top + 56, | |||||
child: AppBar( | child: AppBar( | ||||
elevation: 0, | elevation: 0, | ||||
leading: Navigator.canPop(context) | leading: Navigator.canPop(context) | ||||
? IconButton( | ? IconButton( | ||||
icon: Icon(Icons.arrow_back_ios), | |||||
onPressed: () { | |||||
Navigator.of(context).pop(); | |||||
}) | |||||
icon: Icon(Icons.arrow_back_ios), | |||||
onPressed: () { | |||||
Navigator.of(context).pop(); | |||||
}) | |||||
: Container(), | : Container(), | ||||
backgroundColor: HexColor.fromHex(model.appBarBgColor==""?"#00000000":model.appBarBgColor), | |||||
backgroundColor: HexColor.fromHex( | |||||
model.appBarBgColor == "" ? "#00000000" : model.appBarBgColor), | |||||
centerTitle: true, | centerTitle: true, | ||||
title: Container( | title: Container( | ||||
child: Stack( | child: Stack( | ||||
alignment: Alignment.center, | alignment: Alignment.center, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Text( | Text( | ||||
model.appBarName??"", | |||||
model.appBarName ?? "", | |||||
style: | style: | ||||
TextStyle(color: HexColor.fromHex(model.appBarNameColor??"")), | |||||
TextStyle( | |||||
color: HexColor.fromHex(model.appBarNameColor ?? "")), | |||||
), | ), | ||||
CachedNetworkImage( | CachedNetworkImage( | ||||
height: 40.w, | height: 40.w, | ||||
width: 144.w, | width: 144.w, | ||||
imageUrl: model.appBarNameImg??"", | |||||
imageUrl: model.appBarNameImg ?? "", | |||||
fit: BoxFit.fill, | fit: BoxFit.fill, | ||||
) | ) | ||||
], | ], | ||||