mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 16:46:22 +08:00
remove appbar anim
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -2,37 +2,6 @@ import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
|
|
||||||
const AppBarWidget({
|
|
||||||
required this.child1,
|
|
||||||
required this.child2,
|
|
||||||
required this.visible,
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final PreferredSizeWidget child1;
|
|
||||||
final PreferredSizeWidget child2;
|
|
||||||
final bool visible;
|
|
||||||
@override
|
|
||||||
Size get preferredSize => child1.preferredSize;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AnimatedSwitcher(
|
|
||||||
duration: const Duration(milliseconds: 500),
|
|
||||||
transitionBuilder: (Widget child, Animation<double> animation) {
|
|
||||||
return ScaleTransition(
|
|
||||||
scale: animation,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: !visible
|
|
||||||
? KeyedSubtree.wrap(child1, 0)
|
|
||||||
: KeyedSubtree.wrap(child2, 1),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MultiSelectAppBarWidget extends StatelessWidget
|
class MultiSelectAppBarWidget extends StatelessWidget
|
||||||
implements PreferredSizeWidget {
|
implements PreferredSizeWidget {
|
||||||
final MultiSelectMixin ctr;
|
final MultiSelectMixin ctr;
|
||||||
@@ -50,10 +19,9 @@ class MultiSelectAppBarWidget extends StatelessWidget
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AppBarWidget(
|
final visible = this.visible ?? ctr.enableMultiSelect.value;
|
||||||
visible: visible ?? ctr.enableMultiSelect.value,
|
if (visible) {
|
||||||
child1: child,
|
return AppBar(
|
||||||
child2: AppBar(
|
|
||||||
bottom: child.bottom,
|
bottom: child.bottom,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
tooltip: '取消',
|
tooltip: '取消',
|
||||||
@@ -82,8 +50,9 @@ class MultiSelectAppBarWidget extends StatelessWidget
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user