mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: add hover color to question bubble like mockup (#3222)
This commit is contained in:
parent
507554a596
commit
4e863bc87f
@ -29,9 +29,30 @@ class QuestionBubble extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class BubbleActionList extends StatelessWidget {
|
||||
class BubbleActionList extends StatefulWidget {
|
||||
const BubbleActionList({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<BubbleActionList> createState() => _BubbleActionListState();
|
||||
}
|
||||
|
||||
class _BubbleActionListState extends State<BubbleActionList> {
|
||||
bool isOpen = false;
|
||||
|
||||
Color get fontColor => isOpen
|
||||
? Theme.of(context).colorScheme.onPrimary
|
||||
: Theme.of(context).colorScheme.tertiary;
|
||||
|
||||
Color get fillColor => isOpen
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.tertiaryContainer;
|
||||
|
||||
void toggle() {
|
||||
setState(() {
|
||||
isOpen = !isOpen;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final List<PopoverAction> actions = [];
|
||||
@ -49,14 +70,18 @@ class BubbleActionList extends StatelessWidget {
|
||||
'?',
|
||||
tooltip: LocaleKeys.questionBubble_help.tr(),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontColor: Theme.of(context).colorScheme.tertiary,
|
||||
fillColor: Theme.of(context).colorScheme.tertiaryContainer,
|
||||
hoverColor: Theme.of(context).colorScheme.tertiaryContainer,
|
||||
fontColor: fontColor,
|
||||
fillColor: fillColor,
|
||||
hoverColor: Theme.of(context).colorScheme.primary,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
radius: Corners.s10Border,
|
||||
onPressed: () => controller.show(),
|
||||
onPressed: () {
|
||||
toggle();
|
||||
controller.show();
|
||||
},
|
||||
);
|
||||
},
|
||||
onClosed: toggle,
|
||||
onSelected: (action, controller) {
|
||||
if (action is BubbleActionWrapper) {
|
||||
switch (action.inner) {
|
||||
|
Loading…
Reference in New Issue
Block a user