提交 726b0bca authored 作者: yueweilu's avatar yueweilu

添加 必要const

上级 00a35c97
......@@ -144,7 +144,7 @@ class BookInfoPage extends StatelessWidget {
children: [
StarScore(
score: num,
star: Star(
star: const Star(
fillColor: Colours.cE2,
size: 12,
emptyColor: Colours.cE2,
......
......@@ -3,7 +3,6 @@ library forget_pwd;
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
......
......@@ -23,10 +23,10 @@ class _HomePageState extends State<HomePage> {
},
child: Container(
color: Colors.cyan,
child: Text('read_web'),
height: 40,
// width: double.infinity,
alignment: Alignment.center,
child: const Text('read_web'),
),
),
GestureDetector(
......@@ -35,10 +35,10 @@ class _HomePageState extends State<HomePage> {
},
child: Container(
color: Colors.indigo,
child: Text('关于我们'),
height: 40,
width: double.infinity,
alignment: Alignment.center,
child: const Text('关于我们'),
),
)
......
......@@ -14,14 +14,13 @@ class _TestPageState extends State<TestPage> with AutomaticKeepAliveClientMixin
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('分类'),
title: const Text('分类'),
bottom: PreferredSize(
preferredSize: Size.fromHeight(48.w),
child: Container(
child: Row(
children: [
// TabBar放在左侧
Expanded(
const Expanded(
child: TabBar(
tabs: [
Tab(text: 'Tab 1'),
......@@ -35,14 +34,13 @@ class _TestPageState extends State<TestPage> with AutomaticKeepAliveClientMixin
// 筛选按钮放在右侧
IconButton(
icon: Icon(Icons.filter_list),
icon: const Icon(Icons.filter_list),
onPressed: () {
// 处理筛选按钮点击事件
},
),
],
),
),
)
),
body: Column(
......
......@@ -76,9 +76,7 @@ class _LibraryPageState extends State<LibraryPage> {
],
),
controller.filterLabels.isEmpty?const SizedBox():_buildLabel(),
Container(
// color: Colors.red,
child: Expanded(
Expanded(
child: CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefresh,
......@@ -103,13 +101,12 @@ class _LibraryPageState extends State<LibraryPage> {
),
),
),
),
)
],
),
Visibility(
visible: controller.show,
child: Container(
child: SizedBox(
height: double.infinity,
child: FilterPage(
controller: controller,
......@@ -151,7 +148,7 @@ class _LibraryPageState extends State<LibraryPage> {
}
Widget _buildCategory(){
return Container(
return SizedBox(
height: 38.w,
child: GetBuilder<LibraryController>(
init: LibraryController(context),
......
......@@ -53,7 +53,6 @@ class _LoginPageState extends State<LoginPage> {
autovalidateMode: AutovalidateMode.always,
onChanged: (){
setState(() {
print('++++++++++++++++');
});
},
key: _formKey,
......@@ -65,7 +64,7 @@ class _LoginPageState extends State<LoginPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 120.w,),
Container(
SizedBox(
width: 180.w,
height: 42.w,
// color: Colors.cyan,
......@@ -174,7 +173,6 @@ class _LoginPageState extends State<LoginPage> {
text: '立即登录',
isEnabled: controller.enable,
onPressed: () {
print('11111111111111111');
controller.onLogin(context);
// context.goNamed(Routes.order);
},
......
......@@ -13,10 +13,9 @@ class BuildRead extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Stack(
return Stack(
children: [
Container(
SizedBox(
width: double.infinity,
child: Image.asset(
'assets/images/read_bg.png',fit: BoxFit.contain,
......@@ -68,7 +67,6 @@ class BuildRead extends StatelessWidget {
),
)
],
),
);
}
}
......@@ -39,7 +39,6 @@ class PayCouponController extends GetxController with GetSingleTickerProviderSta
price: payController.originalPrice.toString()
);
for(CouponModel model in result.list!) {
print('================================${tag}');
model.type = num.parse(tag);
}
......@@ -59,7 +58,6 @@ class PayCouponController extends GetxController with GetSingleTickerProviderSta
refreshController.finishRefresh(IndicatorResult.success);
refreshController.resetFooter();
} catch (error) {
print('--------------------------------$error');
refreshController.finishRefresh(IndicatorResult.fail);
}
}
......
......@@ -81,7 +81,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
},
child: Container(
margin: EdgeInsets.only(right: 15.w),
child: Text('取消'),
child: const Text('取消'),
)
):const SizedBox(),
],
......
......@@ -82,7 +82,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
},
child: Container(
margin: EdgeInsets.only(right: 15.w),
child: Text('取消'),
child: const Text('取消'),
)
):const SizedBox(),
],
......
......@@ -122,9 +122,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
itemCount: widget.controller.discussInputImages.length,
),
),
Container(
// color: Colors.red,
child: MediaQuery.removePadding(
MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
......@@ -175,7 +173,6 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
},
itemCount: widget.controller.discussInputAudios.length,
),
),
)
],
)
......
......@@ -82,7 +82,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
},
child: Container(
margin: EdgeInsets.only(right: 15.w),
child: Text('取消'),
child: const Text('取消'),
)
):const SizedBox(),
],
......
......@@ -40,7 +40,7 @@ class _SplashPageState extends State<SplashPage> {
return Scaffold(
extendBodyBehindAppBar: true,
// appBar: AppBar(),
body: Container(
body: SizedBox(
height: double.infinity,
width: double.infinity,
child: Image.asset('assets/images/splash.png',fit: BoxFit.cover,),
......
......@@ -59,9 +59,9 @@ class HomeCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('名称',textAlign: TextAlign.start,),
const Text('名称',textAlign: TextAlign.start,),
SizedBox(height: 20.w,),
Text(
const Text(
'描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
maxLines: 3,
overflow: TextOverflow.ellipsis,
......
......@@ -53,7 +53,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [
Row(
children: [
Container(
SizedBox(
width: 26.w,
height: 26.w,
// color: Colors.cyan,
......@@ -99,7 +99,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [
Row(
children: [
Container(
SizedBox(
width: 26.w,
height: 26.w,
child: Image.asset('assets/images/report_study.png',fit: BoxFit.cover,)
......@@ -147,7 +147,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [
Row(
children: [
Container(
SizedBox(
width: 26.w,
height: 26.w,
child: Image.asset('assets/images/report_test.png',fit: BoxFit.cover,)
......@@ -214,7 +214,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [
Row(
children: [
Container(
SizedBox(
width: 26.w,
height: 26.w,
// color: Colors.cyan,
......
......@@ -11,13 +11,11 @@ class BuildCard extends StatelessWidget {
Widget build(BuildContext context) {
return Stack(
children: [
Container(
child: Image.asset(
Image.asset(
'assets/images/report_bg.png',
width: double.infinity,
fit: BoxFit.contain,
),
),
Positioned(
left: 0,
top: 0,
......
......@@ -56,7 +56,7 @@ class _AboutPageState extends State<AboutPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
child: Text('《用户协议》',textAlign: TextAlign.right,style: TextStyle(fontSize: 10.w,color: Color(0xFF2A82D9)),),
child: Text('《用户协议》',textAlign: TextAlign.right,style: TextStyle(fontSize: 10.w,color: const Color(0xFF2A82D9)),),
onTap: (){
context.pushNamed(Routes.terms,queryParameters: {'url':'$kServerUrl$kUserAgreement','title':'用户协议'});
},
......@@ -65,7 +65,7 @@ class _AboutPageState extends State<AboutPage> {
Container(width: 1.w,height: 10.w,color: const Color(0xFFC8C8C8),),
Gaps.vGaps15,
GestureDetector(
child: Text('《隐私协议》',textAlign: TextAlign.left,style: TextStyle(fontSize: 10.w,color: Color(0xFF2A82D9))),
child: Text('《隐私协议》',textAlign: TextAlign.left,style: TextStyle(fontSize: 10.w,color: const Color(0xFF2A82D9))),
onTap:(){
context.pushNamed(Routes.terms,queryParameters: {'url':'$kServerUrl$kUserPriAgreement','title':'隐私政策'});
} ,
......
......@@ -18,8 +18,7 @@ class BuildCell extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Row(
Row(
children: [
Container(
width: 27.w,
......@@ -41,7 +40,6 @@ class BuildCell extends StatelessWidget {
)
],
),
),
Text(model.options == 1?'+${model.numbers}':'-${model.numbers}',style: TextStyle(fontSize: 17.w,fontWeight: Fonts.medium,color: model.options == 1?AppTheme.primary:Colours.c3),)
],
),
......
......@@ -22,9 +22,7 @@ class _CoinRechargePageState extends State<CoinRechargePage> with AutomaticKeepA
padding: EdgeInsets.symmetric(vertical: 17.w),
width: double.infinity,
margin: EdgeInsets.fromLTRB(10.w, 0.w, 10.w, 0.w),
child: Container(
// color: Colors.red,
child:Stack(
child: Stack(
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.center,
......@@ -47,7 +45,6 @@ class _CoinRechargePageState extends State<CoinRechargePage> with AutomaticKeepA
),
)
],
)
),
),
Container(
......@@ -75,7 +72,7 @@ class _CoinRechargePageState extends State<CoinRechargePage> with AutomaticKeepA
child: RichText(text: TextSpan(
children: [
TextSpan(text: '充值即代表同意',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c9)),
TextSpan(text: '《用户充值协议》',style: TextStyle(fontSize: 13.w,height: 1.5,color: Color(0xFF2A82D9))),
TextSpan(text: '《用户充值协议》',style: TextStyle(fontSize: 13.w,height: 1.5,color: const Color(0xFF2A82D9))),
]
)),
),
......
......@@ -8,7 +8,7 @@ class BuildItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ColorFiltered(
colorFilter: ColorFilter.mode(Colors.transparent, BlendMode.saturation),
colorFilter: const ColorFilter.mode(Colors.transparent, BlendMode.saturation),
child: Container(
margin: EdgeInsets.only(left: 10.w, top: 10.w, right: 5.w),
child: Stack(
......
......@@ -46,7 +46,7 @@ class _UserDiscussDesPageState extends State<UserDiscussDesPage> {
),
child: Column(children: [
ClipRRect(
borderRadius:BorderRadius.only(topLeft: Radius.circular(5.w),topRight: Radius.circular(5)),
borderRadius:BorderRadius.only(topLeft: Radius.circular(5.w),topRight: const Radius.circular(5)),
child: Container(
width: double.infinity,
color: Colors.white,
......
......@@ -133,7 +133,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
margin: EdgeInsets.only(top: 10.w),
child: ClipRRect(
borderRadius: BorderRadius.circular(17.5.w),
child: Container(
child: SizedBox(
width: 35.w,
height: 35.w,
child: CustomImage.network(url: model.personPic??'',placeholder: Image.asset('assets/images/user_default_icon.png'),),
......@@ -224,7 +224,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
widget.userDiscussDesController?.setDiscussModel(model);
widget.userDiscussDesController?.setFatherDiscussModel(fatherModel);
},
child: Container(
child: SizedBox(
height: 25.w,
width: 15.w,
// color: Colors.yellow,
......
......@@ -25,7 +25,7 @@ class _UserGenderPageState extends State<UserGenderPage> {
builder: (controller) => Scaffold(
appBar: CustomAppBar(
title: const Text('设置性别'),
actions: [],
actions: const [],
),
body: Container(
margin: EdgeInsets.symmetric(
......
......@@ -11,9 +11,7 @@ class UserInfoController extends GetxController {
}) async {
// String result = await CommonAPI.upload(path:path,fileTypes: 'user');
OssTool tool = OssTool('zxts-user-file');
print('------path--------------------------$path');
final response = await tool.putObjectFile(path);
print('------response--------------------------${response.realUri}');
_changeInfo(response.realUri.toString());
}
......
......@@ -96,7 +96,6 @@ class _UserNickPageState extends State<UserNickPage> {
onTap: () {
// 处理点击事件,可以执行任意操作
_textFieldController.clear();
print('Image Clicked!');
},
child: Image(
image: const AssetImage('assets/images/del.png'),
......
......@@ -37,7 +37,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
return Scaffold(
appBar: CustomAppBar(
title: const Text('待支付'),
actions: [],
actions: const [],
),
body: Column(
children: [
......
......@@ -37,7 +37,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
return Scaffold(
appBar: CustomAppBar(
title: const Text('已取消'),
actions: [],
actions: const [],
),
body: Column(
children: [
......
......@@ -37,7 +37,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
return Scaffold(
appBar: CustomAppBar(
title: const Text('已完成'),
actions: [],
actions: const [],
),
body: Column(
children: [
......
......@@ -24,7 +24,7 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
builder: (controller) => Scaffold(
appBar: CustomAppBar(
title: const Text('已完成'),
actions: [],
actions: const [],
),
body: Container(
width: double.infinity,
......@@ -73,7 +73,7 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
crossAxisAlignment:
CrossAxisAlignment.start, // 下面的Text靠左
children: [
Container(
SizedBox(
height: 47.5.w,
child: Text(
controller.model.bookList==null?'':
......@@ -206,7 +206,7 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
child: Align(
alignment: Alignment.centerRight,
child: Padding(
padding: EdgeInsets.only(right: 15.2),
padding: EdgeInsets.only(right: 15.2.w),
child: Container(
height: 23.w,
width: 60.w,
......
......@@ -17,7 +17,7 @@ class _UserOrderRefundedState extends State<UserOrderRefundedPage> {
builder: (controller) => Scaffold(
appBar: CustomAppBar(
title: const Text('已退款'),
actions: [],
actions: const [],
),
body:Column(children: [
Container(
......@@ -67,7 +67,7 @@ class _UserOrderRefundedState extends State<UserOrderRefundedPage> {
crossAxisAlignment:
CrossAxisAlignment.start, // 下面的Text靠左
children: [
Container(
SizedBox(
height: 62.5.w,
child: Text(
controller.model?.bookList?[0].name??'',
......
......@@ -3,7 +3,7 @@ part of utils;
class EncryptUtil {
/// md5 加密
static String encodeMd5(String data) {
var content = Utf8Encoder().convert(data);
var content = const Utf8Encoder().convert(data);
var digest = md5.convert(content);
return hex.encode(digest.bytes);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论