提交 c0740ecd authored 作者: yueweilu's avatar yueweilu

优化代码

上级 86f0a2eb
......@@ -19,10 +19,6 @@ void main() {
Future.wait([
UserStore.to.profile(),
]).whenComplete(() {
// String name = EncryptUtil.aesEncrypt('我是谁');
// print('2222222---------$name');
// final result = EncryptUtil.aesDecrypt(name);
// Console.log('解密--------------------------$result');
FlutterBugly.postCatchedException(() {
// 如果需要 ensureInitialized,请在这里运行。
WidgetsFlutterBinding.ensureInitialized();
......@@ -34,8 +30,6 @@ void main() {
});
// runApp(const MyApp());
//FlutterNativeSplash.remove();
});
});
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
......@@ -44,7 +38,6 @@ void main() {
class MyApp extends StatelessWidget {
const MyApp({Key? key}): super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
......
......@@ -26,11 +26,6 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
bool canTap = true;
@override
void onInit() {
super.onInit();
}
@override
void onReady() {
getBookDetails();
......
......@@ -44,7 +44,7 @@ class BuildCounter extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('合计 ¥${controller.allPrice.toStringAsFixed(2)}',style: TextStyle(color: AppTheme.primary,fontSize: 16.w,fontWeight: Fonts.boldSemi)),
Text('已选 ${controller.num} 件',style: TextStyle(color: Color(0xFF999999),fontSize: 12.w,))
Text('已选 ${controller.num} 件',style: TextStyle(color: const Color(0xFF999999),fontSize: 12.w,))
],
)
],
......
......@@ -13,6 +13,8 @@ import 'package:flutter_sound_platform_interface/flutter_sound_recorder_platform
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../utils/index.dart';
part 'view.dart';
......
......@@ -74,7 +74,7 @@ class _RecordPageState extends State<RecordPage> {
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFAF0E6),
color: const Color(0xFFFAF0E6),
border: Border.all(
color: Colors.indigo,
width: 3,
......@@ -89,7 +89,7 @@ class _RecordPageState extends State<RecordPage> {
//disabledColor: Colors.grey,
child: Text(_mPlayer!.isPlaying ? 'Stop' : 'Play'),
),
SizedBox(
const SizedBox(
width: 20,
),
Text(_mPlayer!.isPlaying
......@@ -165,7 +165,7 @@ class _RecordPageState extends State<RecordPage> {
List<FileSystemEntity> files = tempDir!.listSync();
for (FileSystemEntity file in files) {
print('File: ${file.path}');
Console.log('File: ${file.path}');
}
setState(() {
......
......@@ -125,120 +125,118 @@ class _StudyReportPageState extends State<StudyReportPage> {
),
Gaps.hGaps10,
Expanded(
child: Container(// color: Colors.limeAccent,
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 15.w,top: 15.w,bottom: 15.w,right: 30),
height: 172,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colours.cC7.withOpacity(0.5),
offset: Offset(1, 3.w),
blurRadius: 10.w,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Row(
children: [
SizedBox(
width: 26.w,
height: 26.w,
child: Image.asset('assets/images/report_test.png',fit: BoxFit.cover,)
// color: Colors.cyan,
),
Gaps.hGaps10,
Text('知识测评',style: TextStyle(fontSize: 18.w,height: 1.3,color: Colours.c3,fontWeight: Fonts.boldSemi),)
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(text: TextSpan(
children: [
TextSpan(text: '测评总数',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 21.5.w),),
TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
]
))
],
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(text: TextSpan(
children: [
TextSpan(text: '测评正确率',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 8.w),),
TextSpan(text:controller.model.questionAccuracy!=null?controller.model.questionAccuracy.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '%',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
]
))
],
),
],
)
)
],
),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 15.w,top: 15.w,bottom: 15.w,right: 30),
height: 172,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colours.cC7.withOpacity(0.5),
offset: Offset(1, 3.w),
blurRadius: 10.w,
spreadRadius: 0,
),
],
),
Gaps.vGaps10,
Container(
padding: EdgeInsets.only(left: 15.w,top: 15.w,bottom: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colours.cC7.withOpacity(0.5),
offset: Offset(1, 3.w),
blurRadius: 10.w,
spreadRadius: 0,
),
],
),
height: 172.w,
child: Column(
children: [
Row(
children: [
SizedBox(
width: 26.w,
height: 26.w,
// color: Colors.cyan,
child: Image.asset('assets/images/report_discuss.png',fit: BoxFit.cover,)
),
Gaps.hGaps10,
Text('讨论',style: TextStyle(fontSize: 18.w,height: 1.3,color: Colours.c3,fontWeight: Fonts.boldSemi),)
child: Column(
children: [
Row(
children: [
SizedBox(
width: 26.w,
height: 26.w,
child: Image.asset('assets/images/report_test.png',fit: BoxFit.cover,)
// color: Colors.cyan,
),
Gaps.hGaps10,
Text('知识测评',style: TextStyle(fontSize: 18.w,height: 1.3,color: Colours.c3,fontWeight: Fonts.boldSemi),)
],
),
Expanded(
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildItem(title: '发起讨论', num: controller.model.commentPostNums.toString()),
_buildItem(title: '参与讨论', num: controller.model.commentReplyNums.toString())
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(text: TextSpan(
children: [
TextSpan(text: '测评总数',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 21.5.w),),
TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
]
))
],
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(text: TextSpan(
children: [
TextSpan(text: '测评正确率',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 8.w),),
TextSpan(text:controller.model.questionAccuracy!=null?controller.model.questionAccuracy.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '%',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
]
))
],
),
],
)
)
],
),
),
Gaps.vGaps10,
Container(
padding: EdgeInsets.only(left: 15.w,top: 15.w,bottom: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colours.cC7.withOpacity(0.5),
offset: Offset(1, 3.w),
blurRadius: 10.w,
spreadRadius: 0,
),
],
),
height: 172.w,
child: Column(
children: [
Row(
children: [
SizedBox(
width: 26.w,
height: 26.w,
// color: Colors.cyan,
child: Image.asset('assets/images/report_discuss.png',fit: BoxFit.cover,)
),
)
],
),
)
],
),
Gaps.hGaps10,
Text('讨论',style: TextStyle(fontSize: 18.w,height: 1.3,color: Colours.c3,fontWeight: Fonts.boldSemi),)
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildItem(title: '发起讨论', num: controller.model.commentPostNums.toString()),
_buildItem(title: '参与讨论', num: controller.model.commentReplyNums.toString())
],
),
)
],
),
)
],
),
)
]
......
......@@ -35,7 +35,7 @@ class _UserGenderPageState extends State<UserGenderPage> {
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xFFC7C7C7).withOpacity(0.5),
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: Offset(3.w, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
......
......@@ -224,171 +224,169 @@ class BuiltAwaiting extends StatelessWidget {
}
Widget _buildList(BuildContext context) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: Container(
margin: EdgeInsets.only(top: 4.5.w, right: 4.w),
width: 100,
height: 20,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// 左半部分的文字
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(180.w),
bottomLeft: Radius.circular(180.w)),
color: Colours.cC31F4C,
),
height: double.infinity,
width: 50,
child: Align(
alignment: Alignment.center,
child: Text(
'等待付款',
style: TextStyle(
color: Colors.white,
fontSize: 10.w,
fontWeight: Fonts.medium,
),
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: Container(
margin: EdgeInsets.only(top: 4.5.w, right: 4.w),
width: 100,
height: 20,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// 左半部分的文字
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(180.w),
bottomLeft: Radius.circular(180.w)),
color: Colours.cC31F4C,
),
height: double.infinity,
width: 50,
child: Align(
alignment: Alignment.center,
child: Text(
'等待付款',
style: TextStyle(
color: Colors.white,
fontSize: 10.w,
fontWeight: Fonts.medium,
),
),
),
),
// 右半部分的文字
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(180.w),
bottomRight: Radius.circular(180.w)),
color: Colours.cC31F4C2,
),
height: double.infinity,
width: 50,
child: Align(
alignment: Alignment.center,
child: Text(
// 右半部分的文字
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(180.w),
bottomRight: Radius.circular(180.w)),
color: Colours.cC31F4C2,
),
height: double.infinity,
width: 50,
child: Align(
alignment: Alignment.center,
child: Text(
'${(30 - (DateTime.now().difference(DateTime.parse(model.createTime.toString()))).inMinutes)==0?
1:30 - (DateTime.now().difference(DateTime.parse(model.createTime.toString()))).inMinutes}分钟',
style: TextStyle(
color: Colours.cC31F4C,
fontSize: 10.w,
fontWeight: Fonts.medium),
),
style: TextStyle(
color: Colours.cC31F4C,
fontSize: 10.w,
fontWeight: Fonts.medium),
),
),
],
),
),
],
),
),
SizedBox(
height: 2.w,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
height: 92.w,
width: 260.5.w,
child: ListView.builder(
itemBuilder: (BuildContext context, int index) {
CartListModel cartModel = model.cartList![index];
return Container(
margin: EdgeInsets.only(
right: 8.w,
),
padding: EdgeInsets.all(2.w),
height: 88.w,
width: 73,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
offset: const Offset(0, 0),
blurRadius: 4.5.w,
spreadRadius: 0.w,
),
],
),
child: Image.network(
cartModel.img ?? '',
// 用实际图片链接替换
fit: BoxFit.cover,
),
);
},
scrollDirection: Axis.horizontal,
itemCount: model.cartList?.length,
),
),
Align(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(
height: 25.w,
),
SizedBox(
height: 2.w,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
height: 92.w,
width: 260.5.w,
child: ListView.builder(
itemBuilder: (BuildContext context, int index) {
CartListModel cartModel = model.cartList![index];
return Container(
margin: EdgeInsets.only(
right: 8.w,
),
Padding(
padding: EdgeInsets.only(right: 26.w),
child: Text(
${model.totalPrice ?? ''}',
style: TextStyle(
color: Colours.cAB1941,
fontWeight: Fonts.medium,
fontSize: 14.w,
padding: EdgeInsets.all(2.w),
height: 88.w,
width: 73,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
offset: const Offset(0, 0),
blurRadius: 4.5.w,
spreadRadius: 0.w,
),
),
],
),
Padding(
padding: EdgeInsets.only(right: 26.w, top: 0.5),
child: Text(
'共${model.cartList!.isEmpty ? 0 : model.cartList?.length}件',
style: TextStyle(
color: Colours.c9,
fontSize: 10.w,
),
),
child: Image.network(
cartModel.img ?? '',
// 用实际图片链接替换
fit: BoxFit.cover,
),
SizedBox(
height: 13.5.w,
);
},
scrollDirection: Axis.horizontal,
itemCount: model.cartList?.length,
),
),
Align(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(
height: 25.w,
),
Padding(
padding: EdgeInsets.only(right: 26.w),
child: Text(
${model.totalPrice ?? ''}',
style: TextStyle(
color: Colours.cAB1941,
fontWeight: Fonts.medium,
fontSize: 14.w,
),
),
Container(
height: 23.w,
width: 60.w,
margin: EdgeInsets.only(right: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.w),
border:
Border.all(color: Colours.cC31F4C, width: 0.5.w)),
child: Center(
child: GestureDetector(
onTap: () {
context.pushNamed(Routes.orderEvaluate);
},
child: Text(
'付款',
style: TextStyle(
fontSize: 10.w, color: Colours.cC31F4C),
)),
),
Padding(
padding: EdgeInsets.only(right: 26.w, top: 0.5),
child: Text(
'共${model.cartList!.isEmpty ? 0 : model.cartList?.length}件',
style: TextStyle(
color: Colours.c9,
fontSize: 10.w,
),
),
],
),
)
],
),
],
),
),
SizedBox(
height: 13.5.w,
),
Container(
height: 23.w,
width: 60.w,
margin: EdgeInsets.only(right: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.w),
border:
Border.all(color: Colours.cC31F4C, width: 0.5.w)),
child: Center(
child: GestureDetector(
onTap: () {
context.pushNamed(Routes.orderEvaluate);
},
child: Text(
'付款',
style: TextStyle(
fontSize: 10.w, color: Colours.cC31F4C),
)),
),
),
],
),
)
],
),
],
);
}
}
......@@ -35,7 +35,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
return Scaffold(
appBar: CustomAppBar(
title: const Text('等待付款'),
actions: [],
actions: const [],
),
body: Column(
children: [
......
......@@ -17,7 +17,7 @@ class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> {
builder: (controller) => Scaffold(
appBar: CustomAppBar(
title: const Text('已取消'),
actions: [],
actions: const [],
),
body:Column(children: [
Container(
......@@ -67,7 +67,7 @@ class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> {
crossAxisAlignment:
CrossAxisAlignment.start, // 下面的Text靠左
children: [
Container(
SizedBox(
height: 62.5.w,
child: Text(
controller.model?.bookList?[0].name??'',
......@@ -139,7 +139,7 @@ class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> {
integralPrice: controller.model.integralPrice.toString(),);
},
).then((value) {
print('点击了应付款后面');
Console.log('点击了应付款后面');
});
},
......
......@@ -25,32 +25,29 @@ class _RefundedDetailsState extends State<RefundedDetailsPage> {
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,
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('金额明细',textAlign:TextAlign.center),
],
),
Positioned(
right: 0.w,
top: 0.w,
child: GestureDetector(
onTap: (){
context.pop();
},
child: SizedBox(
width: 20.w,
height: 20.w,
child: Image.asset('assets/images/close.png'),
),
),
)
Text('金额明细',textAlign:TextAlign.center),
],
),
Positioned(
right: 0.w,
top: 0.w,
child: GestureDetector(
onTap: (){
context.pop();
},
child: SizedBox(
width: 20.w,
height: 20.w,
child: Image.asset('assets/images/close.png'),
),
),
)
],
),
),
SizedBox(height: 30.w,),
......
......@@ -18,29 +18,27 @@ class BuildCell extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Row(
children: [
Container(
width: 27.w,
height: 27.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13.5.w),
color: Colors.cyan,
),
Row(
children: [
Container(
width: 27.w,
height: 27.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13.5.w),
color: Colors.cyan,
),
Gaps.hGaps10,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Gaps.vGaps15,
Text(model.remarks??'',style: TextStyle(color: Colours.c3,fontSize: 14.w,height: 1.6,fontWeight: Fonts.medium),),
Text(model.createTime??'',style: TextStyle(color: Colours.c9,fontSize: 10.w,height: 1.6,)),
Gaps.vGaps15,
],
)
],
),
),
Gaps.hGaps10,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Gaps.vGaps15,
Text(model.remarks??'',style: TextStyle(color: Colours.c3,fontSize: 14.w,height: 1.6,fontWeight: Fonts.medium),),
Text(model.createTime??'',style: TextStyle(color: Colours.c9,fontSize: 10.w,height: 1.6,)),
Gaps.vGaps15,
],
)
],
),
Text(model.options == 1?'+${model.numbers}':'-${model.numbers}',style: TextStyle(fontSize: 17.w,fontWeight: Fonts.medium,color: model.options == 1?AppTheme.primary:Colours.c3),)
],
......
......@@ -366,7 +366,7 @@ class CustomInputSearch extends StatelessWidget {
color: Colours.c3.withOpacity(0.1), // 阴影颜色
spreadRadius: 2, // 阴影扩散程度
blurRadius: 4, // 阴影模糊程度
offset: Offset(0, 2), // 阴影位置
offset: const Offset(0, 2), // 阴影位置
),
],
borderRadius: BorderRadius.circular(360), // 容器圆角
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论