2484-simplify-igc-popup (#2592)

* feat(span_card): simplifying popup

* generated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
This commit is contained in:
wcjord 2025-05-01 13:48:16 -04:00 committed by GitHub
parent 08946d5c38
commit 31b2d49bcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 53 deletions

View file

@ -43,7 +43,6 @@ import '../../widgets/matrix.dart';
import 'package:fluffychat/utils/tor_stub.dart'
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
enum PopupMenuAction {
settings,
invite,

View file

@ -19,7 +19,6 @@ import '../../../common/controllers/pangea_controller.dart';
import '../../enums/span_choice_type.dart';
import '../../models/span_card_model.dart';
import '../choice_array.dart';
import 'card_header.dart';
import 'why_button.dart';
//switch for definition vs correction vs practice
@ -227,13 +226,13 @@ class WordMatchContent extends StatelessWidget {
return Column(
children: [
// if (!controller.widget.scm.pangeaMatch!.isITStart)
CardHeader(
text: controller.error?.toString() ?? matchCopy.title,
botExpression: controller.error == null
? controller.currentExpression
: BotExpression.addled,
onClose: () => controller.widget.scm.choreographer.setState(),
),
// CardHeader(
// text: controller.error?.toString(),
// botExpression: controller.error == null
// ? controller.currentExpression
// : BotExpression.addled,
// onClose: () => controller.widget.scm.choreographer.setState(),
// ),
Scrollbar(
controller: scrollController,
thumbVisibility: true,
@ -409,10 +408,11 @@ class PromptAndFeedback extends StatelessWidget {
),
),
if (controller.selectedChoice != null) ...[
Text(
controller.selectedChoice!.feedbackToDisplay(context),
style: BotStyle.text(context),
),
if (controller.selectedChoice?.feedback != null)
Text(
controller.selectedChoice!.feedbackToDisplay(context),
style: BotStyle.text(context),
),
const SizedBox(height: 8),
if (controller.selectedChoice?.feedback == null)
WhyButton(
@ -429,7 +429,9 @@ class PromptAndFeedback extends StatelessWidget {
Text(
controller.widget.scm.pangeaMatch!.match.type.typeName
.defaultPrompt(context),
style: BotStyle.text(context),
style: BotStyle.text(context).copyWith(
fontStyle: FontStyle.italic,
),
),
],
),

View file

@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
class WhyButton extends StatelessWidget {
const WhyButton({
super.key,
@ -14,44 +12,15 @@ class WhyButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextButton(
return IconButton(
onPressed: loading ? null : onPress,
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all<Color>(
Theme.of(context).colorScheme.primary.withAlpha(25),
),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), // Border radius
side: BorderSide(
color: Theme.of(context)
.colorScheme
.primary, // Replace with your color
style: BorderStyle.solid,
width: 2.0,
),
),
),
),
child: SizedBox(
width: 150,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (!loading) const Icon(Icons.lightbulb_outline),
if (loading)
const Center(
child: SizedBox(
width: 24.0,
height: 24.0,
child: CircularProgressIndicator(),
),
),
const SizedBox(width: 8),
Text(L10n.of(context).why),
],
),
),
icon: loading
? const SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(),
)
: const Icon(Icons.lightbulb_outline, size: 24),
);
}
}