category page add keepalive mixin

hmxc
小赖 4 years ago
parent e151406e74
commit a9d5ae7a39

@ -97,26 +97,6 @@ class _ExpressPackageCardState extends State<ExpressPackageCard> {
],
),
],
40.w.heightBox,
Row(
children: [
Spacer(),
MaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(74.w)),
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
height: 50.w,
color: kPrimaryColor,
elevation: 0,
focusElevation: 0,
hoverElevation: 0,
disabledElevation: 0,
highlightElevation: 0,
onPressed: () {},
child: '确认领取'.text.size(24.sp).bold.color(ktextPrimary).make(),
)
],
),
],
),
);

@ -14,10 +14,12 @@ class CategorySubView extends StatefulWidget {
_CategorySubViewState createState() => _CategorySubViewState();
}
class _CategorySubViewState extends State<CategorySubView> {
class _CategorySubViewState extends State<CategorySubView>
with AutomaticKeepAliveClientMixin {
List<MarketCategoryModel> _models = [];
@override
Widget build(BuildContext context) {
super.build(context);
return EasyRefresh(
header: MaterialHeader(),
firstRefresh: true,
@ -41,4 +43,7 @@ class _CategorySubViewState extends State<CategorySubView> {
),
);
}
@override
bool get wantKeepAlive => true;
}

Loading…
Cancel
Save