mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 17:16:29 +08:00
opt: select (#937)
This commit is contained in:
committed by
GitHub
parent
afb09e8a0a
commit
01552801f2
@@ -4,7 +4,7 @@ import 'package:get/get.dart';
|
||||
|
||||
class MultiSelectAppBarWidget extends StatelessWidget
|
||||
implements PreferredSizeWidget {
|
||||
final MultiSelectMixin ctr;
|
||||
final MultiSelectBase ctr;
|
||||
final bool? visible;
|
||||
final AppBar child;
|
||||
final List<Widget>? children;
|
||||
@@ -19,8 +19,7 @@ class MultiSelectAppBarWidget extends StatelessWidget
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final visible = this.visible ?? ctr.enableMultiSelect.value;
|
||||
if (visible) {
|
||||
if (visible ?? ctr.enableMultiSelect.value) {
|
||||
return AppBar(
|
||||
bottom: child.bottom,
|
||||
leading: IconButton(
|
||||
|
||||
34
lib/common/widgets/select_mask.dart
Normal file
34
lib/common/widgets/select_mask.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget selectMask(ThemeData theme, bool checked) {
|
||||
return AnimatedOpacity(
|
||||
opacity: checked ? 1 : 0,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: StyleString.mdRadius,
|
||||
color: Colors.black.withValues(alpha: 0.6),
|
||||
),
|
||||
child: AnimatedScale(
|
||||
scale: checked ? 1 : 0,
|
||||
duration: const Duration(milliseconds: 250),
|
||||
curve: Curves.easeInOut,
|
||||
child: Container(
|
||||
width: 34,
|
||||
height: 34,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface.withValues(alpha: 0.8),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.done_all_outlined,
|
||||
color: theme.colorScheme.primary,
|
||||
semanticLabel: '取消选择',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user