|
|
@@ -1,5 +1,6 @@
|
|
|
import 'dart:async';
|
|
|
import 'dart:convert';
|
|
|
+import 'dart:math';
|
|
|
|
|
|
import 'package:address_picker/address_picker.dart';
|
|
|
import 'package:bbyyy/beans/ad_bean_entity.dart';
|
|
|
@@ -18,6 +19,7 @@ import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
import 'package:bbyyy/my_tools/my_tools.dart';
|
|
|
import 'package:bbyyy/my_tools/my_views.dart';
|
|
|
+import 'package:bbyyy/paegs/home_page/recommended_today_page.dart';
|
|
|
import 'package:bbyyy/paegs/root_page/root_page_view.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
@@ -150,176 +152,286 @@ class _HomePageState extends State<HomePage>
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
child: Scaffold(
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
- body: Column(
|
|
|
- children: [
|
|
|
- Stack(
|
|
|
+ body: SmartRefresher(
|
|
|
+ controller: _reController,
|
|
|
+ onRefresh: onRefresh,
|
|
|
+ onLoading: onLoading,
|
|
|
+ enablePullDown: true,
|
|
|
+ enablePullUp: true,
|
|
|
+ child: CustomScrollView(
|
|
|
+ slivers: [
|
|
|
+ carouselAndSearch(context),
|
|
|
+ recommendedToday(),
|
|
|
+ storeCategory(),
|
|
|
+ shopList()
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget shopList() {
|
|
|
+ return SliverList(
|
|
|
+ delegate: SliverChildBuilderDelegate(
|
|
|
+ (c, index) {
|
|
|
+ return MyViews().pubShopItem(puShop[index], context);
|
|
|
+ },
|
|
|
+ childCount: puShop.length,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget storeCategory() {
|
|
|
+ return SliverPersistentHeader(
|
|
|
+ pinned: true, //是否固定在顶部
|
|
|
+ floating: false,
|
|
|
+ delegate: _SliverAppBarDelegate(
|
|
|
+ minHeight: 54,
|
|
|
+ maxHeight: 54,
|
|
|
+ child: Column(
|
|
|
children: [
|
|
|
- AnimatedContainer(
|
|
|
- height: H,
|
|
|
- duration: Duration(milliseconds: 200),
|
|
|
- child: Swiper(
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
- return netImgs.length == 0
|
|
|
- ? Image.asset(
|
|
|
- "${imgs[index]}",
|
|
|
- fit: BoxFit.cover,
|
|
|
- )
|
|
|
- : MyViews().netImg(
|
|
|
- imgURL(netImgs[index]), H, double.infinity,
|
|
|
- placeholder: 'images/svg/goodsDefImg.svg');
|
|
|
+ Container(
|
|
|
+ color: Colors.white,
|
|
|
+ height: 53,
|
|
|
+ child: ListView.builder(
|
|
|
+ padding: EdgeInsets.only(left: 12, right: 12),
|
|
|
+ itemBuilder: (c, index) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ setState(() {
|
|
|
+ selectedIndex = index;
|
|
|
+ _reController.requestRefresh();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ padding:
|
|
|
+ EdgeInsets.only(right: 15, left: 15, bottom: 9),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ tabs[index],
|
|
|
+ style: TextStyle(
|
|
|
+ color: index == selectedIndex
|
|
|
+ ? MyColors.cFF4233
|
|
|
+ : MyColors.c666666,
|
|
|
+ fontSize: 14),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 10,
|
|
|
+ child: Visibility(
|
|
|
+ child: SvgPicture.asset('images/svg/tab.svg'),
|
|
|
+ visible: index == selectedIndex,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ ),
|
|
|
+ height: 53,
|
|
|
+ ),
|
|
|
+ );
|
|
|
},
|
|
|
- itemCount:
|
|
|
- netImgs.length == 0 ? imgs.length : netImgs.length,
|
|
|
- viewportFraction: 1,
|
|
|
- scale: 1,
|
|
|
- autoplay: true,
|
|
|
+ itemCount: tabs.length,
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
),
|
|
|
),
|
|
|
- SafeArea(
|
|
|
- bottom: false,
|
|
|
- child: Stack(
|
|
|
+ Container(
|
|
|
+ height: 1,
|
|
|
+ color: MyColors.cf2f2f2,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )));
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget recommendedToday() {
|
|
|
+ return SliverToBoxAdapter(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.only(left: 16, right: 10),
|
|
|
+ height: 54,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '梆梆今日折扣',
|
|
|
+ style: TextStyle(color: MyColors.c333333, fontSize: 14),
|
|
|
+ ),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: (){
|
|
|
+ MyTools().toPage(context, RecommendedTodayPage(), (then){});
|
|
|
+ },
|
|
|
+ behavior:HitTestBehavior.translucent,
|
|
|
+ child: Row(
|
|
|
children: [
|
|
|
- // AnimatedOpacity(
|
|
|
- // duration: Duration(milliseconds: 200),
|
|
|
- // opacity: showS ? 0.0 : 1.0,
|
|
|
- // child: Container(
|
|
|
- // margin: EdgeInsets.only(top: 18),
|
|
|
- // width: double.infinity,
|
|
|
- // child: Row(
|
|
|
- // children: [
|
|
|
- // GestureDetector(
|
|
|
- // onTap: () {
|
|
|
- // setState(() {
|
|
|
- // pageIndex = 0;
|
|
|
- // _reController.requestRefresh();
|
|
|
- // });
|
|
|
- // },
|
|
|
- // behavior: HitTestBehavior.translucent,
|
|
|
- // child: Container(
|
|
|
- // height: 28,
|
|
|
- // width: 60,
|
|
|
- // alignment: Alignment.center,
|
|
|
- // child: Column(
|
|
|
- // children: [
|
|
|
- // Text(
|
|
|
- // '货帮',
|
|
|
- // style: TextStyle(
|
|
|
- // color: pageIndex == 0
|
|
|
- // ? MyColors.cFF4233
|
|
|
- // : MyColors.c333333,
|
|
|
- // fontSize: 16,
|
|
|
- // fontWeight: FontWeight.bold),
|
|
|
- // ),
|
|
|
- // Visibility(
|
|
|
- // child: Container(
|
|
|
- // width: 32,
|
|
|
- // height: 2,
|
|
|
- // decoration: BoxDecoration(
|
|
|
- // color: MyColors.cFF4233,
|
|
|
- // borderRadius:
|
|
|
- // BorderRadius.circular(1)),
|
|
|
- // ),
|
|
|
- // visible: pageIndex == 0,
|
|
|
- // ),
|
|
|
- // ],
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // Container(
|
|
|
- // width: 40,
|
|
|
- // ),
|
|
|
- // GestureDetector(
|
|
|
- // onTap: () {
|
|
|
- // setState(() {
|
|
|
- // pageIndex = 1;
|
|
|
- // _reController.requestRefresh();
|
|
|
- // });
|
|
|
- // },
|
|
|
- // behavior: HitTestBehavior.translucent,
|
|
|
- // child: Container(
|
|
|
- // height: 28,
|
|
|
- // width: 60,
|
|
|
- // alignment: Alignment.center,
|
|
|
- // child: Column(
|
|
|
- // children: [
|
|
|
- // Text(
|
|
|
- // '商品',
|
|
|
- // style: TextStyle(
|
|
|
- // color: pageIndex == 1
|
|
|
- // ? MyColors.cFF4233
|
|
|
- // : MyColors.c333333,
|
|
|
- // fontSize: 16,
|
|
|
- // fontWeight: FontWeight.bold),
|
|
|
- // ),
|
|
|
- // Visibility(
|
|
|
- // child: Container(
|
|
|
- // width: 32,
|
|
|
- // height: 2,
|
|
|
- // decoration: BoxDecoration(
|
|
|
- // color: MyColors.cFF4233,
|
|
|
- // borderRadius:
|
|
|
- // BorderRadius.circular(1)),
|
|
|
- // ),
|
|
|
- // visible: pageIndex == 1,
|
|
|
- // ),
|
|
|
- // ],
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // ],
|
|
|
- // mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- Positioned(
|
|
|
- left: 0,
|
|
|
- child: Container(
|
|
|
- padding:
|
|
|
- EdgeInsets.only(left: 10, right: 10, top: 12),
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- addressSelection();
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- padding: EdgeInsets.only(left: 11, right: 14),
|
|
|
- decoration: BoxDecoration(
|
|
|
- boxShadow: [
|
|
|
- BoxShadow(
|
|
|
- color: MyColors.c7FE1E1E1,
|
|
|
- blurRadius: 5.0,
|
|
|
- ),
|
|
|
- ],
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(20)),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Icon(
|
|
|
- Icons.location_on_rounded,
|
|
|
- color: MyColors.c333333,
|
|
|
- size: 20,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- province == null
|
|
|
- ? MyCookie().location != null
|
|
|
- ? MyCookie().location.city
|
|
|
- : '成都市'
|
|
|
- : city,
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c333333,
|
|
|
- fontSize: 12,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
+ Text(
|
|
|
+ '查看更多',
|
|
|
+ style: TextStyle(color: MyColors.c666666, fontSize: 12),
|
|
|
+ ),
|
|
|
+ Icon(
|
|
|
+ Icons.chevron_right,
|
|
|
+ color: MyColors.c666666,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 1,
|
|
|
+ color: MyColors.cf2f2f2,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 168,
|
|
|
+ child: ListView.builder(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
|
|
+ itemBuilder: (c, index) {
|
|
|
+ return Container(
|
|
|
+ margin: EdgeInsets.only(right: 10),
|
|
|
+ height: 138,
|
|
|
+ width: 100,
|
|
|
+ padding: EdgeInsets.all(5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: MyColors.c7FE1E1E1,
|
|
|
+ blurRadius: 5.0,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ MyViews().netImg('', 90, 90,
|
|
|
+ placeholder: 'images/svg/goodsDefImg.svg'),
|
|
|
+ Text(
|
|
|
+ '8.9元充10元话费',
|
|
|
+ style: TextStyle(color: MyColors.c333333, fontSize: 11),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '¥8.90',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233,
|
|
|
+ fontSize: 13,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border:
|
|
|
+ Border.all(color: MyColors.cFF4233, width: 1),
|
|
|
+ borderRadius: BorderRadius.circular(7),
|
|
|
+ ),
|
|
|
+ height: 14,
|
|
|
+ width: 30,
|
|
|
+ child: Text('详情',style: TextStyle(color: MyColors.cFF4233,fontSize: 9),),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ )
|
|
|
+ ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ )
|
|
|
+ ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ itemCount: 10,
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget carouselAndSearch(BuildContext context) {
|
|
|
+ return SliverPersistentHeader(
|
|
|
+ pinned: true,
|
|
|
+ floating: false,
|
|
|
+ delegate: _SliverAppBarDelegate(
|
|
|
+ minHeight: minH,
|
|
|
+ maxHeight: maxH,
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Swiper(
|
|
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
+ return netImgs.length == 0
|
|
|
+ ? Image.asset(
|
|
|
+ "${imgs[index]}",
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ )
|
|
|
+ : MyViews().netImg(
|
|
|
+ imgURL(netImgs[index]), H, double.infinity,
|
|
|
+ placeholder: 'images/svg/goodsDefImg.svg');
|
|
|
+ },
|
|
|
+ itemCount: netImgs.length == 0 ? imgs.length : netImgs.length,
|
|
|
+ viewportFraction: 1,
|
|
|
+ scale: 1,
|
|
|
+ autoplay: true,
|
|
|
+ ),
|
|
|
+ SafeArea(
|
|
|
+ bottom: false,
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Positioned(
|
|
|
+ left: 0,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.only(left: 10, right: 10, top: 12),
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ addressSelection();
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.only(left: 11, right: 14),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: MyColors.c7FE1E1E1,
|
|
|
+ blurRadius: 5.0,
|
|
|
),
|
|
|
],
|
|
|
- ),
|
|
|
- height: 40,
|
|
|
- alignment: Alignment.center,
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.circular(20)),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Icon(
|
|
|
+ Icons.location_on_rounded,
|
|
|
+ color: MyColors.c333333,
|
|
|
+ size: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ province == null
|
|
|
+ ? MyCookie().location != null
|
|
|
+ ? MyCookie().location.city
|
|
|
+ : '成都市'
|
|
|
+ : city,
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333,
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
+ height: 40,
|
|
|
+ alignment: Alignment.center,
|
|
|
),
|
|
|
- alignment: Alignment.center,
|
|
|
),
|
|
|
+ alignment: Alignment.center,
|
|
|
),
|
|
|
- Container(
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ top: 0,
|
|
|
+ right: 0,
|
|
|
+ child: Container(
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 12),
|
|
|
child: GestureDetector(
|
|
|
onTap: () {
|
|
|
@@ -332,8 +444,9 @@ class _HomePageState extends State<HomePage>
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
child: AnimatedContainer(
|
|
|
height: 40,
|
|
|
- width:
|
|
|
- !showS ? 40 : MediaQuery.of(context).size.width,
|
|
|
+ width: !showS
|
|
|
+ ? 40
|
|
|
+ : MediaQuery.of(context).size.width - 20,
|
|
|
child: Row(
|
|
|
children: [
|
|
|
SvgPicture.asset(
|
|
|
@@ -423,88 +536,12 @@ class _HomePageState extends State<HomePage>
|
|
|
),
|
|
|
alignment: Alignment.centerRight,
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 168,
|
|
|
- child: ListView.builder(
|
|
|
- padding: EdgeInsets.only(left: 12, right: 12),
|
|
|
- itemBuilder: (c, index) {
|
|
|
- return Container(margin:EdgeInsets.only(right: 10),height: 138,width: 100,color: Colors.amber,);
|
|
|
- },
|
|
|
- itemCount: 10,
|
|
|
- scrollDirection: Axis.horizontal,
|
|
|
- ),
|
|
|
- ),
|
|
|
- Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- height: 53,
|
|
|
- child: ListView.builder(
|
|
|
- padding: EdgeInsets.only(left: 12, right: 12),
|
|
|
- itemBuilder: (c, index) {
|
|
|
- return GestureDetector(
|
|
|
- onTap: () {
|
|
|
- setState(() {
|
|
|
- selectedIndex = index;
|
|
|
- _reController.requestRefresh();
|
|
|
- });
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- padding:
|
|
|
- EdgeInsets.only(right: 15, left: 15, bottom: 9),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- tabs[index],
|
|
|
- style: TextStyle(
|
|
|
- color: index == selectedIndex
|
|
|
- ? MyColors.cFF4233
|
|
|
- : MyColors.c666666,
|
|
|
- fontSize: 14),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 10,
|
|
|
- child: Visibility(
|
|
|
- child: SvgPicture.asset('images/svg/tab.svg'),
|
|
|
- visible: index == selectedIndex,
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.end,
|
|
|
- ),
|
|
|
- height: 53,
|
|
|
- ),
|
|
|
- );
|
|
|
- },
|
|
|
- itemCount: tabs.length,
|
|
|
- scrollDirection: Axis.horizontal,
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 1,
|
|
|
- color: MyColors.cf2f2f2,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: SmartRefresher(
|
|
|
- controller: _reController,
|
|
|
- onRefresh: onRefresh,
|
|
|
- onLoading: onLoading,
|
|
|
- enablePullDown: true,
|
|
|
- enablePullUp: true,
|
|
|
- child: body(),
|
|
|
),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
+ ],
|
|
|
+ )),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -771,48 +808,6 @@ class _HomePageState extends State<HomePage>
|
|
|
}, (error) {});
|
|
|
}
|
|
|
|
|
|
- body() {
|
|
|
- if (pageIndex == 1) {
|
|
|
- return body1();
|
|
|
- } else if (pageIndex == 0) {
|
|
|
- return body2();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- body1() {
|
|
|
- if (data.length == 0) {
|
|
|
- return SingleChildScrollView(child: noData());
|
|
|
- } else {
|
|
|
- return GridView.builder(
|
|
|
- controller: _controller,
|
|
|
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
- crossAxisCount: 2,
|
|
|
- childAspectRatio: 164 / 261,
|
|
|
- mainAxisSpacing: 8,
|
|
|
- crossAxisSpacing: 8),
|
|
|
- itemCount: data.length,
|
|
|
- padding: EdgeInsets.only(left: 14, right: 14, top: 14, bottom: 65),
|
|
|
- itemBuilder: (context, index) {
|
|
|
- return MyViews().getGoodsItem(data[index], context);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- body2() {
|
|
|
- if (puShop.length == 0) {
|
|
|
- return SingleChildScrollView(child: noData());
|
|
|
- } else {
|
|
|
- return ListView.builder(
|
|
|
- controller: _controller,
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
- return MyViews().pubShopItem(puShop[index], context);
|
|
|
- },
|
|
|
- itemCount: puShop.length,
|
|
|
- padding: EdgeInsets.all(10),
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
void addressSelection() {
|
|
|
StateSetter ss;
|
|
|
showModalBottomSheet(
|
|
|
@@ -934,3 +929,34 @@ class _HomePageState extends State<HomePage>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
|
|
+ _SliverAppBarDelegate({
|
|
|
+ @required this.minHeight,
|
|
|
+ @required this.maxHeight,
|
|
|
+ @required this.child,
|
|
|
+ });
|
|
|
+
|
|
|
+ final double minHeight;
|
|
|
+ final double maxHeight;
|
|
|
+ final Widget child;
|
|
|
+
|
|
|
+ @override
|
|
|
+ double get minExtent => minHeight;
|
|
|
+
|
|
|
+ @override
|
|
|
+ double get maxExtent => max(maxHeight, minHeight);
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(
|
|
|
+ BuildContext context, double shrinkOffset, bool overlapsContent) {
|
|
|
+ return new SizedBox.expand(child: child);
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
|
|
|
+ return maxHeight != oldDelegate.maxHeight ||
|
|
|
+ minHeight != oldDelegate.minHeight ||
|
|
|
+ child != oldDelegate.child;
|
|
|
+ }
|
|
|
+}
|