feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -7,6 +7,11 @@ import '../../core/theme/app_dimens.dart';
|
||||
import '../../core/widgets/cover_play_count.dart';
|
||||
import '../../core/widgets/remote_image.dart';
|
||||
|
||||
const double _selectMarkSize = 22;
|
||||
const double _selectMarkInset = 6;
|
||||
const double _selectMarkIconSize = 16;
|
||||
const double _selectBorderWidth = 1.5;
|
||||
|
||||
class FollowingGridCard extends StatelessWidget {
|
||||
const FollowingGridCard({
|
||||
super.key,
|
||||
@@ -18,6 +23,7 @@ class FollowingGridCard extends StatelessWidget {
|
||||
required this.onTap,
|
||||
this.progress,
|
||||
this.editing = false,
|
||||
this.selected,
|
||||
this.onRemove,
|
||||
});
|
||||
|
||||
@@ -29,6 +35,7 @@ class FollowingGridCard extends StatelessWidget {
|
||||
final VoidCallback onTap;
|
||||
final double? progress;
|
||||
final bool editing;
|
||||
final bool? selected;
|
||||
final VoidCallback? onRemove;
|
||||
|
||||
@override
|
||||
@@ -59,7 +66,16 @@ class FollowingGridCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (editing)
|
||||
if (selected != null)
|
||||
Positioned(
|
||||
top: _selectMarkInset,
|
||||
right: _selectMarkInset,
|
||||
child: _SelectMark(
|
||||
key: Key('following-select-$dramaId'),
|
||||
selected: selected!,
|
||||
),
|
||||
)
|
||||
else if (editing)
|
||||
Positioned(
|
||||
top: -2,
|
||||
right: -2,
|
||||
@@ -141,6 +157,35 @@ class FollowingGridCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _SelectMark extends StatelessWidget {
|
||||
const _SelectMark({super.key, required this.selected});
|
||||
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: _selectMarkSize,
|
||||
height: _selectMarkSize,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: selected ? AppColors.blue : AppColors.transparent,
|
||||
border: Border.all(
|
||||
color: selected ? AppColors.blue : AppColors.textPrimary,
|
||||
width: _selectBorderWidth,
|
||||
),
|
||||
),
|
||||
child: selected
|
||||
? const Icon(
|
||||
Icons.check_rounded,
|
||||
size: _selectMarkIconSize,
|
||||
color: AppColors.onPrimary,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FollowingAddCard extends StatelessWidget {
|
||||
const FollowingAddCard({super.key, required this.onTap});
|
||||
|
||||
|
||||
Reference in new issue
Block a user