make pressable button more visbile in dark mode, make main menu indicators into pressable buttons (#1315)
This commit is contained in:
parent
78ce090696
commit
7e9dc022eb
5 changed files with 56 additions and 66 deletions
|
|
@ -79,10 +79,7 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
if (transcript.sttTokens.isEmpty) {
|
||||
return TextSpan(
|
||||
text: remainingFullText,
|
||||
style: BotStyle.text(
|
||||
context,
|
||||
setColor: false,
|
||||
),
|
||||
style: BotStyle.text(context),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
|
|
@ -16,23 +17,15 @@ class LearningSettingsButton extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Tooltip(
|
||||
message: L10n.of(context).learningSettings,
|
||||
child: InkWell(
|
||||
customBorder: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
onTap: onTap,
|
||||
child: PressableButton(
|
||||
buttonHeight: 2.5,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
onPressed: onTap,
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
spreadRadius: 1,
|
||||
blurRadius: 1,
|
||||
offset: const Offset(1, 1), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
child: Row(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat_list/analytics_summary/level_bar_popup.dart';
|
||||
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
|
|
@ -11,43 +13,46 @@ class LevelBadge extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
spreadRadius: 1,
|
||||
blurRadius: 1,
|
||||
offset: const Offset(1, 1), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundColor: AppConfig.gold,
|
||||
radius: 8,
|
||||
child: Icon(
|
||||
size: 12,
|
||||
Icons.star,
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
weight: 1000,
|
||||
return PressableButton(
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
buttonHeight: 2.5,
|
||||
onPressed: () {
|
||||
showDialog<LevelBarPopup>(
|
||||
context: context,
|
||||
builder: (c) => const LevelBarPopup(),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundColor: AppConfig.gold,
|
||||
radius: 8,
|
||||
child: Icon(
|
||||
size: 12,
|
||||
Icons.star,
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
weight: 1000,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
L10n.of(context).levelShort(level),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
L10n.of(context).levelShort(level),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:fluffychat/pangea/enum/progress_indicators_enum.dart';
|
||||
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// A badge that represents one learning progress indicator (i.e., construct uses)
|
||||
|
|
@ -20,23 +21,15 @@ class ProgressIndicatorBadge extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Tooltip(
|
||||
message: indicator.tooltip(context),
|
||||
child: InkWell(
|
||||
customBorder: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
onTap: onTap,
|
||||
child: PressableButton(
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
onPressed: onTap,
|
||||
buttonHeight: 2.5,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Theme.of(context).colorScheme.surfaceBright,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
spreadRadius: 1,
|
||||
blurRadius: 1,
|
||||
offset: const Offset(-1, 1), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
child: Row(
|
||||
|
|
|
|||
|
|
@ -138,7 +138,9 @@ class PressableButtonState extends State<PressableButton>
|
|||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color.alphaBlend(
|
||||
Colors.black.withOpacity(0.25),
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? Colors.black.withOpacity(0.25)
|
||||
: Colors.white.withOpacity(0.25),
|
||||
widget.color,
|
||||
),
|
||||
borderRadius: widget.borderRadius,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue