remove pull_to_refresh package and some shit code.

hmxc
小赖 4 years ago
parent 9d2c156998
commit e66894cb76

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -474,6 +474,14 @@ class R {
/// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/json/zbbj.json)
static const String ASSETS_JSON_ZBBJ_JSON = 'assets/json/zbbj.json';
/// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/car_card_grey.webp)
static const String ASSETS_STATIC_CAR_CARD_GREY_WEBP =
'assets/static/car_card_grey.webp';
/// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/car_card_yellow.webp)
static const String ASSETS_STATIC_CAR_CARD_YELLOW_WEBP =
'assets/static/car_card_yellow.webp';
/// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/car_park_empty.webp)
static const String ASSETS_STATIC_CAR_PARK_EMPTY_WEBP =
'assets/static/car_park_empty.webp';

@ -9,7 +9,6 @@ import 'package:fluwx/fluwx.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/constants/app_theme.dart';
import 'package:akuCommunity/pages/splash/splash_page.dart';
@ -94,7 +93,6 @@ class _MyAppState extends State<MyApp> {
home: SplashPage(),
//
localizationsDelegates: [
RefreshLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,

@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class CarParkingModel {
String code;
int type;
int status;
String effectiveTimeEnd;
String get typeName {
switch (type) {
@ -18,7 +19,7 @@ class CarParkingModel {
}
String get carTypeName {
switch (type) {
switch (status) {
case 1:
return '产权车位';
case 2:
@ -76,6 +77,7 @@ class CarParkingModel {
code = json['code'];
type = json['type'];
effectiveTimeEnd = json['effectiveTimeEnd'];
status = json['status'];
}
Map<String, dynamic> toJson() {

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'widget/goods_app_bar.dart';
@ -68,8 +66,8 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
},
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
// RefreshController _refreshController =
// RefreshController(initialRefresh: false);
@override
void initState() {
@ -79,7 +77,7 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
// _refreshController.refreshCompleted();
}
void _onLoading() async {
@ -94,13 +92,13 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
'viewNum': '235',
});
if (mounted) setState(() {});
_refreshController.loadComplete();
// _refreshController.loadComplete();
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
// _refreshController.dispose();
}
Container _commentsClass() {
@ -186,34 +184,21 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
children: [
_commentsClass(),
Expanded(
child: Container(
child: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
padding: EdgeInsets.only(top: 30.w),
itemBuilder: (BuildContext context, int index) => Container(
color: Colors.white,
child: GoodsCommentsCard(
imagePath: _commentsCardList[index]['imagePath'],
name: _commentsCardList[index]['name'],
subtitle: _commentsCardList[index]['subtitle'],
content: _commentsCardList[index]['content'],
contentImageList: _commentsCardList[index]
['contentImageList'],
viewNum: _commentsCardList[index]['viewNum'],
),
),
itemCount: _commentsCardList.length,
),
child: ListView.builder(
padding: EdgeInsets.only(top: 30.w),
itemBuilder: (BuildContext context, int index) => Container(
color: Colors.white,
child: GoodsCommentsCard(
imagePath: _commentsCardList[index]['imagePath'],
name: _commentsCardList[index]['name'],
subtitle: _commentsCardList[index]['subtitle'],
content: _commentsCardList[index]['content'],
contentImageList: _commentsCardList[index]
['contentImageList'],
viewNum: _commentsCardList[index]['viewNum'],
),
),
itemCount: _commentsCardList.length,
),
)
],

@ -1,91 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'widget/record_card.dart';
class LifePayRecordPage extends StatefulWidget {
LifePayRecordPage({Key key}) : super(key: key);
@override
_LifePayRecordPageState createState() => _LifePayRecordPageState();
}
class _LifePayRecordPageState extends State<LifePayRecordPage> {
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
}
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '缴费记录',
body: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView(
children: [
Container(
margin: EdgeInsets.only(
top: 34.w,
left: 32.w,
right: 32.w,
),
child: RichText(
text: TextSpan(
style: TextStyle(fontSize: 24.sp),
children: <InlineSpan>[
TextSpan(
text: '如果有疑问,请联系物业客服',
style: TextStyle(color: Color(0xff666666))),
TextSpan(
text: '400-6754322',
style: TextStyle(color: Color(0xffff8200)),
),
]),
),
),
RecordCard(fun: LifePayBillPage().to),
RecordCard(fun: LifePayBillPage().to),
RecordCard(fun: LifePayBillPage().to),
RecordCard(fun: LifePayBillPage().to),
],
),
),
),
);
}
}

@ -1,160 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
class RecordCard extends StatelessWidget {
final Function fun;
RecordCard({Key key, this.fun}) : super(key: key);
final List<Map<String, dynamic>> _listBill = [
{
'title': '物业管理费',
'value': '深蓝公寓 1幢1单元306',
'titleStyle': TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize30,
color: ktextPrimary,
),
'valueStyle': TextStyle(
fontSize: BaseStyle.fontSize24,
color: BaseStyle.color999999,
),
'top': 30,
'isShow': false,
},
{
'title': '2019年',
'value': '- ¥1000.00',
'titleStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextSubColor,
),
'valueStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: Color(0xfffc361d),
),
'top': 50,
'isShow': true,
},
{
'title': '创建时间',
'value': '2020/08/01 10:00',
'titleStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextSubColor,
),
'valueStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextPrimary,
),
'top': 30,
'isShow': false,
},
{
'title': '付款方式',
'value': '支付宝',
'titleStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextSubColor,
),
'valueStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextPrimary,
),
'top': 30,
'isShow': false,
},
{
'title': '订单号',
'value': '2020080100030001433244',
'titleStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextSubColor,
),
'valueStyle': TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextPrimary,
),
'top': 30,
'isShow': false,
},
];
Container _billItem(String title, value, TextStyle titleStyle, valueStyle,
double top, bool isShow, Function fun) {
return Container(
margin: EdgeInsets.only(top: top.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: titleStyle,
),
isShow
? InkWell(
onTap: fun,
child: Row(
children: [
Text(
value,
style: valueStyle,
),
Container(
margin: EdgeInsets.only(left: 24.w),
child: Icon(
AntDesign.right,
color: BaseStyle.color999999,
size: 30.w,
),
),
],
),
)
: Text(
value,
style: valueStyle,
),
],
),
);
}
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(
top: 32.w,
left: 32.w,
right: 32.w,
),
padding: EdgeInsets.only(
left: 20.w,
right: 20.w,
bottom: 32.w,
top: 2.w,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _listBill
.map((item) => _billItem(
item['title'],
item['value'],
item['titleStyle'],
item['valueStyle'],
item['top'].toDouble(),
item['isShow'],
fun))
.toList(),
),
);
}
}

@ -4,8 +4,6 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/model/aku_shop_model.dart';
import 'package:akuCommunity/service/base_model.dart';
import 'package:akuCommunity/utils/headers.dart';
@ -26,8 +24,6 @@ class _MarketListState extends State<MarketList>
with AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
List<AkuShopModel> _shopList = [];
@ -201,40 +197,28 @@ class _MarketListState extends State<MarketList>
page++;
// akuShop(page);
if (mounted) setState(() {});
_refreshController.loadComplete();
}
@override
Widget build(BuildContext context) {
super.build(context);
return RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onLoading: _onLoading,
enablePullUp: true,
enablePullDown: false,
child: CustomScrollView(
slivers: [
widget.isGroup
? SliverGoodsGroupCard()
: SliverPadding(
padding: EdgeInsets.only(
top: 30.w,
left: 32.w,
right: 32.w,
),
sliver: _shopList.length == 0
? SliverToBoxAdapter(child: GoodsCardSkeleton())
: SliverGoodsCard(
shoplist: _shopList,
isShow: true,
)),
],
),
),
return CustomScrollView(
slivers: [
widget.isGroup
? SliverGoodsGroupCard()
: SliverPadding(
padding: EdgeInsets.only(
top: 30.w,
left: 32.w,
right: 32.w,
),
sliver: _shopList.length == 0
? SliverToBoxAdapter(child: GoodsCardSkeleton())
: SliverGoodsCard(
shoplist: _shopList,
isShow: true,
)),
],
);
}
}

@ -4,7 +4,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/utils/headers.dart';
@ -18,8 +17,6 @@ class ShopMessagePage extends StatefulWidget {
}
class _ShopMessagePageState extends State<ShopMessagePage> {
RefreshController _refreshController =
RefreshController(initialRefresh: false);
List<Map<String, dynamic>> _listNotice = [
{
'status': '已读',
@ -51,15 +48,12 @@ class _ShopMessagePageState extends State<ShopMessagePage> {
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
// void refundRouter() {
@ -77,7 +71,6 @@ class _ShopMessagePageState extends State<ShopMessagePage> {
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
InkWell _inkWellLook(String type, content, lookType) {
@ -192,26 +185,15 @@ class _ShopMessagePageState extends State<ShopMessagePage> {
),
)
],
body: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
itemBuilder: (context, index) => _containerCard(
_listNotice[index]['status'],
_listNotice[index]['type'],
_listNotice[index]['imagePath'],
_listNotice[index]['content'],
_listNotice[index]['lookType'],
),
itemCount: _listNotice.length,
),
body: ListView.builder(
itemBuilder: (context, index) => _containerCard(
_listNotice[index]['status'],
_listNotice[index]['type'],
_listNotice[index]['imagePath'],
_listNotice[index]['content'],
_listNotice[index]['lookType'],
),
itemCount: _listNotice.length,
),
);
}

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'order_card.dart';
class OrderList extends StatefulWidget {
@ -132,9 +130,6 @@ class _OrderListState extends State<OrderList>
}
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
@ -142,47 +137,32 @@ class _OrderListState extends State<OrderList>
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
itemBuilder: (context, index) => OrderCard(
status: _listGood[index]['status'],
totalPrice: _listGood[index]['totalPrice'],
payPrice: _listGood[index]['payPrice'],
listContent: _listGood[index]['listContent'],
listButton: _listGood[index]['listButton'],
listOrderDetail: _listGood[index]['listOrderDetail'],
),
itemCount: _listGood.length,
),
return ListView.builder(
itemBuilder: (context, index) => OrderCard(
status: _listGood[index]['status'],
totalPrice: _listGood[index]['totalPrice'],
payPrice: _listGood[index]['payPrice'],
listContent: _listGood[index]['listContent'],
listButton: _listGood[index]['listButton'],
listOrderDetail: _listGood[index]['listOrderDetail'],
),
itemCount: _listGood.length,
);
}
}

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'things_card.dart';
@ -20,41 +18,19 @@ class _ThingsListState extends State<ThingsList>
@override
bool get wantKeepAlive => true;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
padding: EdgeInsets.only(bottom: 98.w),
itemBuilder: (context, index) => ThingsCard(
time: widget.listCard[index]['time'],
tag: widget.listCard[index]['tag'],
content: widget.listCard[index]['content'],
imageList: widget.listCard[index]['imageList'],
isRepair: widget.isRepair,
),
itemCount: widget.listCard.length,
return ListView.builder(
padding: EdgeInsets.only(bottom: 98.w),
itemBuilder: (context, index) => ThingsCard(
time: widget.listCard[index]['time'],
tag: widget.listCard[index]['tag'],
content: widget.listCard[index]['content'],
imageList: widget.listCard[index]['imageList'],
isRepair: widget.isRepair,
),
itemCount: widget.listCard.length,
);
}
}

@ -9,8 +9,8 @@ class CarManageCard extends StatelessWidget {
String get _assetImage {
return model.outdated
? R.ASSETS_STATIC_PARKING_GREY_WEBP
: R.ASSETS_STATIC_PARKING_YELLOW_WEBP;
? R.ASSETS_STATIC_CAR_CARD_GREY_WEBP
: R.ASSETS_STATIC_CAR_CARD_YELLOW_WEBP;
}
@override
@ -22,6 +22,7 @@ class CarManageCard extends StatelessWidget {
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(_assetImage)),
borderRadius: BorderRadius.circular(8.w),
boxShadow: model.shadow,
),
clipBehavior: Clip.antiAlias,
child: Column(
@ -54,7 +55,7 @@ class CarManageCard extends StatelessWidget {
),
),
Text(
model.typeName,
model.carTypeName,
style: Theme.of(context).textTheme.subtitle2.copyWith(
fontWeight: FontWeight.bold,
),

@ -40,7 +40,7 @@ class _CarManagePageState extends State<CarManagePage> {
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '我的车',
title: '我的车',
actions: [
// TextButton(
// onPressed: () {},

@ -22,6 +22,7 @@ class CarparkingCard extends StatelessWidget {
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(_assetImage)),
borderRadius: BorderRadius.circular(8.w),
boxShadow: model.shadow,
),
clipBehavior: Clip.antiAlias,
child: Column(

@ -669,13 +669,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.4"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
qr:
dependency: transitive
description:

@ -16,8 +16,6 @@ dependencies:
permission_handler: ^6.1.1
# 版本信息
package_info: ^2.0.0
#上拉加载
pull_to_refresh: ^1.6.4
provider: ^5.0.0
# 屏幕适配
flutter_screenutil: ^5.0.0-nullsafety.11

Loading…
Cancel
Save