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) { if (transcript.sttTokens.isEmpty) {
return TextSpan( return TextSpan(
text: remainingFullText, text: remainingFullText,
style: BotStyle.text( style: BotStyle.text(context),
context,
setColor: false,
),
); );
} }

@ -1,3 +1,4 @@
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -16,23 +17,15 @@ class LearningSettingsButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Tooltip( return Tooltip(
message: L10n.of(context).learningSettings, message: L10n.of(context).learningSettings,
child: InkWell( child: PressableButton(
customBorder: RoundedRectangleBorder( buttonHeight: 2.5,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), onPressed: onTap,
onTap: onTap, color: Theme.of(context).colorScheme.surfaceBright,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.surfaceBright, 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), padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
child: Row( child: Row(

@ -1,4 +1,6 @@
import 'package:fluffychat/config/app_config.dart'; 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/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -11,18 +13,20 @@ class LevelBadge extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.surfaceBright, 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), padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
child: Row( 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/enum/progress_indicators_enum.dart';
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// A badge that represents one learning progress indicator (i.e., construct uses) /// A badge that represents one learning progress indicator (i.e., construct uses)
@ -20,23 +21,15 @@ class ProgressIndicatorBadge extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Tooltip( return Tooltip(
message: indicator.tooltip(context), message: indicator.tooltip(context),
child: InkWell( child: PressableButton(
customBorder: RoundedRectangleBorder( color: Theme.of(context).colorScheme.surfaceBright,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), onPressed: onTap,
onTap: onTap, buttonHeight: 2.5,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Theme.of(context).colorScheme.surfaceBright, 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), padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
child: Row( child: Row(

@ -138,7 +138,9 @@ class PressableButtonState extends State<PressableButton>
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.alphaBlend( 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, widget.color,
), ),
borderRadius: widget.borderRadius, borderRadius: widget.borderRadius,

Loading…
Cancel
Save