Merge branch 'main' into grammar-copy
This commit is contained in:
commit
6a0dfff657
6 changed files with 43 additions and 35 deletions
|
|
@ -4,6 +4,7 @@ import 'package:fluffychat/utils/fluffy_share.dart';
|
|||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
|
@ -18,14 +19,6 @@ class SettingsView extends StatelessWidget {
|
|||
|
||||
const SettingsView(this.controller, {super.key});
|
||||
|
||||
// #Pangea
|
||||
Future<String> getAppVersion(BuildContext context) async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
return L10n.of(context)!
|
||||
.versionText(packageInfo.version, packageInfo.buildNumber);
|
||||
}
|
||||
// Pangea#
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
|
@ -218,14 +211,34 @@ class SettingsView extends StatelessWidget {
|
|||
onTap: () => launchUrlString(AppConfig.termsOfServiceUrl),
|
||||
trailing: const Icon(Icons.open_in_new_outlined),
|
||||
),
|
||||
FutureBuilder<String>(
|
||||
future: getAppVersion(context),
|
||||
FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
trailing: const Icon(Icons.copy_outlined),
|
||||
onTap: () async {
|
||||
if (snapshot.data == null) return;
|
||||
await Clipboard.setData(
|
||||
ClipboardData(
|
||||
text:
|
||||
"${snapshot.data!.version}+${snapshot.data!.buildNumber}",
|
||||
),
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(L10n.of(context)!.copiedToClipboard),
|
||||
),
|
||||
);
|
||||
},
|
||||
title: Text(
|
||||
snapshot.data ?? L10n.of(context)!.versionNotFound,
|
||||
snapshot.data != null
|
||||
? L10n.of(context)!.versionText(
|
||||
snapshot.data!.version,
|
||||
snapshot.data!.buildNumber,
|
||||
)
|
||||
: L10n.of(context)!.versionNotFound,
|
||||
),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class BotMode {
|
||||
static const direct = "direct";
|
||||
static const directChat = "direct_chat";
|
||||
static const discussion = "discussion";
|
||||
static const custom = "custom";
|
||||
static const storyGame = "story_game";
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ extension RoomInformationRoomExtension on Room {
|
|||
);
|
||||
}
|
||||
|
||||
Future<bool> get _isBotDM async => botOptions?.mode == BotMode.direct;
|
||||
Future<bool> get _isBotDM async => botOptions?.mode == BotMode.directChat;
|
||||
|
||||
bool get _isLocked {
|
||||
if (isDirectChat) return false;
|
||||
|
|
|
|||
|
|
@ -36,21 +36,20 @@ class ContentIssueButton extends StatelessWidget {
|
|||
L10n.of(context)!.reportContentIssueTitle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 300),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const BotFace(
|
||||
width: 60,
|
||||
expression: BotExpression.addled,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(L10n.of(context)!.reportContentIssueDescription),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextField(
|
||||
content: SingleChildScrollView(
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 300),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const BotFace(
|
||||
width: 60,
|
||||
expression: BotExpression.addled,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(L10n.of(context)!.reportContentIssueDescription),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: feedbackController,
|
||||
decoration: InputDecoration(
|
||||
labelText: L10n.of(context)!.feedback,
|
||||
|
|
@ -58,8 +57,8 @@ class ContentIssueButton extends StatelessWidget {
|
|||
),
|
||||
maxLines: 4,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
|
|
|
|||
|
|
@ -231,10 +231,6 @@ class MessagePracticeActivityCardState extends State<PracticeActivityCard> {
|
|||
return;
|
||||
}
|
||||
|
||||
// clear the current activity and record
|
||||
currentActivity = null;
|
||||
currentCompletionRecord = null;
|
||||
|
||||
_fetchNewActivity(
|
||||
ActivityQualityFeedback(
|
||||
feedbackText: feedback,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ dependencies:
|
|||
flutter_olm: 1.3.2 # Keep in sync with scripts/prepare-web.sh ! 1.4.0 does currently not build on Android
|
||||
flutter_openssl_crypto: ^0.3.0
|
||||
flutter_ringtone_player: ^4.0.0+2
|
||||
flutter_secure_storage: ^9.0.0
|
||||
flutter_secure_storage: ^9.2.2
|
||||
flutter_shortcuts:
|
||||
git: https://github.com/krille-chan/flutter_shortcuts.git
|
||||
flutter_typeahead: ^5.2.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue