60e47f7c
liangchengyou
feat:课程选择功能
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class LessonItemWidget extends StatelessWidget {
const LessonItemWidget({super.key, required this.isSelected});
///是否被选中
final bool isSelected;
@override
Widget build(BuildContext context) {
return isSelected?_selectWidget():_unSelectWidget();
}
Widget _unSelectWidget() {
return Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: NetworkImage('https://img.liblibai.com/web/648331d033b41.png?image_process=format,webp&x-oss-process=image/resize,w_2980,m_lfit/format,webp'),
)
),
);
}
Widget _selectWidget() {
return Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 2.0,
color: Colors.red,
style: BorderStyle.solid
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Image.network(
'https://img.liblibai.com/web/648331d5a2cb5.png?image_process=format,webp&x-oss-process=image/resize,w_2980,m_lfit/format,webp',
),
),
10.verticalSpace,
Container(
color: Colors.red,
width: double.infinity,
child: const Column(
children: [
Text('red'),
Text('第三段')
],
),
)
],
),
);
}
}
|