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

图书展示 使用统一自定义组件

上级 33ce5c6e
......@@ -27,27 +27,8 @@ class BuildBook extends StatelessWidget {
margin: const EdgeInsets.only(left: 15,right: 15),
child: Row(
children: [
Container(
decoration: BoxDecoration(
color: Colors.cyan,
borderRadius: BorderRadius.circular(3),
boxShadow: [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
spreadRadius: 0,
blurRadius: 4.5,
offset: const Offset(0, 0), // changes the position of the shadow
),
]
),
// color: Colors.white,
height: 102,
width: 85,
child: Container(
padding: const EdgeInsets.all(1),
child: CustomImage.network(url: model.img??'')
),
CustomCard(
url: model.img??'',
)
],
),
......
......@@ -10,6 +10,7 @@ import 'package:get/get.dart';
import '../../models/index.dart';
import '../../models/shop.dart';
import '../../utils/index.dart';
import '../../widgets/index.dart';
import '../book_shop/index.dart';
import 'dart:io';
......
......@@ -31,29 +31,10 @@ class BuildItem extends StatelessWidget {
margin: const EdgeInsets.only(left: 12,right: 11),
child: Row(
children: [
Container(
decoration: BoxDecoration(
color: Colors.cyan,
borderRadius: BorderRadius.circular(3),
boxShadow: [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(3, 0), // changes the position of the shadow
),
]
),
// color: Colors.white,
height: 86,
CustomCard(
width: 72,
child: Container(
padding: const EdgeInsets.all(2),
child: Container(
color: Colors.cyan,
),
),
height: 86,
url: model.img??'',
)
],
),
......
......@@ -57,29 +57,10 @@ class BookCell extends StatelessWidget {
child: Image.asset(model.selected?'assets/images/pay_check.png':'assets/images/pay_uncheck.png'),
),
const SizedBox(width: 12,),
Container(
decoration: BoxDecoration(
color: Colors.cyan,
borderRadius: BorderRadius.circular(3),
boxShadow: [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(3, 0), // changes the position of the shadow
),
]
),
// color: Colors.white,
height: 86,
CustomCard(
width: 72,
child: Container(
padding: const EdgeInsets.all(2),
child: Container(
color: Colors.cyan,
),
),
height: 86,
url: model.img??'',
)
],
),
......
......@@ -30,22 +30,9 @@ class Book extends StatelessWidget {
Expanded(
child: AspectRatio(
aspectRatio: 0.85,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
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: const EdgeInsets.all(1),
child: CustomImage.network(url: model.img??''),
),
child: CustomCard(
url: model.img??'',
)
),
),
Gaps.vGaps10,
......
......@@ -88,14 +88,10 @@ class LibraryCell extends StatelessWidget {
left: 20,
top: 0,
bottom: 18,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Colors.cyan,
),
child: CustomCard(
width: 100,
child: CustomImage.network(url: model.img??''),
),
url: model.img??'',
)
),
],
)
......
......@@ -67,12 +67,10 @@ class BuildDayItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
CustomCard(
width: 72,
height: 87,
// color: Colors.red,
child: CustomImage.network(url: courseModel.img??'')
// Image.network(courseModel.img??''),
height: 86,
url: courseModel.img??'',
),
Expanded(
child: Container(
......
......@@ -57,10 +57,10 @@ class BuildItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 87,
width: 73,
color: Colors.cyan,
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
Container(
height: 87,
......
......@@ -32,10 +32,10 @@ class BuildItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 87,
width: 73,
color: Colors.cyan,
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
Container(
height: 87,
......
......@@ -32,11 +32,10 @@ class BuildItem extends StatelessWidget {
child: Row(
children: [
/// 左侧
Container(
width: 73,
height: 87,
color: Colors.red,
child: CustomImage.network(url: model.img??''),
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
/// 右侧
Expanded(
......
......@@ -56,10 +56,10 @@ class BuildItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 87,
width: 73,
color: Colors.cyan,
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
Container(
height: 87,
......
......@@ -32,10 +32,10 @@ class BuildItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 87,
width: 73,
color: Colors.cyan,
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
Container(
height: 87,
......
......@@ -13,6 +13,12 @@ class UserWrongController extends GetxController {
int _page = 1;
bool _noMore = false;
@override
void onReady() {
onRefresh();
super.onReady();
}
@override
void onClose() {
refreshController.dispose();
......
......@@ -19,7 +19,7 @@ class _UserWrongPageState extends State<UserWrongPage> {
),
body: CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefresh,
// onRefresh: controller.onRefresh,
onLoading: controller.onLoading,
child:SingleChildScrollView(
child: Container(
......
......@@ -55,10 +55,10 @@ class BuildItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 87,
width: 73,
color: Colors.cyan,
CustomCard(
width: 72,
height: 86,
url: model.img??'',
),
Container(
height: 87,
......
part of widgets;
class CustomCard extends StatelessWidget {
final String url;
final double height;
final double width;
final BorderRadiusGeometry? borderRadius;
final List<BoxShadow>? boxShadow;
const CustomCard({super.key,
required this.url,
this.height = 102,
this.width = 85,
this.borderRadius,
this.boxShadow,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.cyan,
borderRadius: borderRadius ?? BorderRadius.circular(3),
boxShadow: boxShadow ?? [
BoxShadow(
color: const Color(0xFF707070).withOpacity(0.5),
spreadRadius: 0,
blurRadius: 4.5,
offset: const Offset(0, 0),
),
],
),
height: height,
width: width,
child: Container(
padding: const EdgeInsets.all(1),
child: CustomImage.network(url: url),
),
);
}
}
......@@ -24,4 +24,5 @@ part 'input.dart';
part 'button.dart';
part 'pull_scroll_view.dart';
part 'tab_bar.dart';
part 'dialog.dart';
\ No newline at end of file
part 'dialog.dart';
part 'book.dart';
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论