make pressable button more visbile in dark mode, make main menu indicators into pressable buttons (#1315)

pull/1544/head
ggurdin 11 months ago committed by GitHub
parent 78ce090696
commit 7e9dc022eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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(
child: PressableButton(
buttonHeight: 2.5,
borderRadius: BorderRadius.circular(15),
),
onTap: onTap,
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,18 +13,20 @@ class LevelBadge extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
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,
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(
@ -49,6 +53,7 @@ class LevelBadge extends StatelessWidget {
),
],
),
),
);
}
}

@ -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(
child: PressableButton(
color: Theme.of(context).colorScheme.surfaceBright,
borderRadius: BorderRadius.circular(15),
),
onTap: onTap,
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…
Cancel
Save