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) /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/json/zbbj.json)
static const String ASSETS_JSON_ZBBJ_JSON = '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) /// ![preview](file:///Users/akufe/Documents/akuCommunity/assets/static/car_park_empty.webp)
static const String ASSETS_STATIC_CAR_PARK_EMPTY_WEBP = static const String ASSETS_STATIC_CAR_PARK_EMPTY_WEBP =
'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:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.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/constants/app_theme.dart';
import 'package:akuCommunity/pages/splash/splash_page.dart'; import 'package:akuCommunity/pages/splash/splash_page.dart';
@ -94,7 +93,6 @@ class _MyAppState extends State<MyApp> {
home: SplashPage(), home: SplashPage(),
// //
localizationsDelegates: [ localizationsDelegates: [
RefreshLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,

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

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'widget/goods_app_bar.dart'; import 'widget/goods_app_bar.dart';
@ -68,8 +66,8 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
}, },
]; ];
RefreshController _refreshController = // RefreshController _refreshController =
RefreshController(initialRefresh: false); // RefreshController(initialRefresh: false);
@override @override
void initState() { void initState() {
@ -79,7 +77,7 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
void _onRefresh() async { void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500)); await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted(); // _refreshController.refreshCompleted();
} }
void _onLoading() async { void _onLoading() async {
@ -94,13 +92,13 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
'viewNum': '235', 'viewNum': '235',
}); });
if (mounted) setState(() {}); if (mounted) setState(() {});
_refreshController.loadComplete(); // _refreshController.loadComplete();
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_refreshController.dispose(); // _refreshController.dispose();
} }
Container _commentsClass() { Container _commentsClass() {
@ -186,16 +184,6 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
children: [ children: [
_commentsClass(), _commentsClass(),
Expanded( Expanded(
child: Container(
child: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder( child: ListView.builder(
padding: EdgeInsets.only(top: 30.w), padding: EdgeInsets.only(top: 30.w),
itemBuilder: (BuildContext context, int index) => Container( itemBuilder: (BuildContext context, int index) => Container(
@ -212,9 +200,6 @@ class _ViewCommentsPageState extends State<ViewCommentsPage> {
), ),
itemCount: _commentsCardList.length, 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/cupertino.dart';
import 'package:flutter/material.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/model/aku_shop_model.dart';
import 'package:akuCommunity/service/base_model.dart'; import 'package:akuCommunity/service/base_model.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
@ -26,8 +24,6 @@ class _MarketListState extends State<MarketList>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
List<AkuShopModel> _shopList = []; List<AkuShopModel> _shopList = [];
@ -201,22 +197,12 @@ class _MarketListState extends State<MarketList>
page++; page++;
// akuShop(page); // akuShop(page);
if (mounted) setState(() {}); if (mounted) setState(() {});
_refreshController.loadComplete();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return RefreshConfiguration( return CustomScrollView(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onLoading: _onLoading,
enablePullUp: true,
enablePullDown: false,
child: CustomScrollView(
slivers: [ slivers: [
widget.isGroup widget.isGroup
? SliverGoodsGroupCard() ? SliverGoodsGroupCard()
@ -233,8 +219,6 @@ class _MarketListState extends State<MarketList>
isShow: true, isShow: true,
)), )),
], ],
),
),
); );
} }
} }

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

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

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'things_card.dart'; import 'things_card.dart';
@ -20,31 +18,10 @@ class _ThingsListState extends State<ThingsList>
@override @override
bool get wantKeepAlive => true; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return SmartRefresher( return ListView.builder(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: ListView.builder(
padding: EdgeInsets.only(bottom: 98.w), padding: EdgeInsets.only(bottom: 98.w),
itemBuilder: (context, index) => ThingsCard( itemBuilder: (context, index) => ThingsCard(
time: widget.listCard[index]['time'], time: widget.listCard[index]['time'],
@ -54,7 +31,6 @@ class _ThingsListState extends State<ThingsList>
isRepair: widget.isRepair, isRepair: widget.isRepair,
), ),
itemCount: widget.listCard.length, itemCount: widget.listCard.length,
),
); );
} }
} }

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

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

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

@ -669,13 +669,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.4.4" 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: qr:
dependency: transitive dependency: transitive
description: description:

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

Loading…
Cancel
Save