* fix: fix dart formatting for CI * fix: sorted imports, updated deprecated flutter functions * fix: format files * fix: format files * feat: replace syncfusion flutter package with excel flutter package * fix: don't run enable google services patch in CI * fix: update iOS supported platforms for enable ios build script * fix: commented out linux build in integrate CI
38 lines
1.1 KiB
Dart
38 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fluffychat/pangea/enum/activity_type_enum.dart';
|
|
import 'package:fluffychat/pangea/models/pangea_token_model.dart';
|
|
import 'package:fluffychat/pangea/widgets/practice_activity/word_zoom_activity_button.dart';
|
|
|
|
class EmojiPracticeButton extends StatelessWidget {
|
|
final PangeaToken token;
|
|
final VoidCallback onPressed;
|
|
final bool isSelected;
|
|
|
|
const EmojiPracticeButton({
|
|
required this.token,
|
|
required this.onPressed,
|
|
this.isSelected = false,
|
|
super.key,
|
|
});
|
|
|
|
bool get _shouldDoActivity => token.shouldDoActivity(
|
|
a: ActivityTypeEnum.emoji,
|
|
feature: null,
|
|
tag: null,
|
|
);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final emoji = token.getEmoji();
|
|
return _shouldDoActivity || emoji != null
|
|
? WordZoomActivityButton(
|
|
icon: emoji == null
|
|
? const Icon(Icons.add_reaction_outlined)
|
|
: Text(emoji),
|
|
isSelected: isSelected,
|
|
onPressed: onPressed,
|
|
)
|
|
: const SizedBox(width: 40);
|
|
}
|
|
}
|