refactor: Migrate to Flutter 3.7.0
This commit is contained in:
parent
23438b7a42
commit
35174cb859
54 changed files with 876 additions and 2124 deletions
|
|
@ -23,19 +23,19 @@ abstract class FluffyThemes {
|
|||
);
|
||||
|
||||
static var fallbackTextTheme = const TextTheme(
|
||||
bodyText1: fallbackTextStyle,
|
||||
bodyText2: fallbackTextStyle,
|
||||
button: fallbackTextStyle,
|
||||
caption: fallbackTextStyle,
|
||||
overline: fallbackTextStyle,
|
||||
headline1: fallbackTextStyle,
|
||||
headline2: fallbackTextStyle,
|
||||
headline3: fallbackTextStyle,
|
||||
headline4: fallbackTextStyle,
|
||||
headline5: fallbackTextStyle,
|
||||
headline6: fallbackTextStyle,
|
||||
subtitle1: fallbackTextStyle,
|
||||
subtitle2: fallbackTextStyle,
|
||||
bodyLarge: fallbackTextStyle,
|
||||
bodyMedium: fallbackTextStyle,
|
||||
labelLarge: fallbackTextStyle,
|
||||
bodySmall: fallbackTextStyle,
|
||||
labelSmall: fallbackTextStyle,
|
||||
displayLarge: fallbackTextStyle,
|
||||
displayMedium: fallbackTextStyle,
|
||||
displaySmall: fallbackTextStyle,
|
||||
headlineMedium: fallbackTextStyle,
|
||||
headlineSmall: fallbackTextStyle,
|
||||
titleLarge: fallbackTextStyle,
|
||||
titleMedium: fallbackTextStyle,
|
||||
titleSmall: fallbackTextStyle,
|
||||
);
|
||||
|
||||
static const Duration animationDuration = Duration(milliseconds: 250);
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
labelStyle: TextStyle(
|
||||
fontFamily: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.bodyLarge
|
||||
?.fontFamily),
|
||||
labelText: L10n.of(context)!.recoveryKey,
|
||||
errorText: _recoveryKeyInputError,
|
||||
|
|
|
|||
|
|
@ -1072,11 +1072,13 @@ class ChatController extends State<Chat> {
|
|||
Matrix.of(context).voipPlugin!.voip.requestTurnServerCredentials());
|
||||
if (success.result != null) {
|
||||
final voipPlugin = Matrix.of(context).voipPlugin;
|
||||
await voipPlugin!.voip.inviteToCall(room!.id, callType).catchError((e) {
|
||||
try {
|
||||
await voipPlugin!.voip.inviteToCall(room!.id, callType);
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text((e as Object).toLocalizedString(context))),
|
||||
SnackBar(content: Text(e.toLocalizedString(context))),
|
||||
);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
await showOkAlertDialog(
|
||||
context: context,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class _CuteContentState extends State<CuteContent> {
|
|||
},
|
||||
),
|
||||
);
|
||||
Overlay.of(context)?.insert(overlay);
|
||||
Overlay.of(context).insert(overlay);
|
||||
}
|
||||
|
||||
generateLabel(User? user) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class HtmlMessage extends StatelessWidget {
|
|||
defaultTextStyle: defaultTextStyle,
|
||||
emoteSize: emoteSize,
|
||||
linkStyle: linkStyle ??
|
||||
themeData.textTheme.bodyText2!.copyWith(
|
||||
themeData.textTheme.bodyMedium!.copyWith(
|
||||
color: themeData.colorScheme.secondary,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -303,8 +303,11 @@ class Message extends StatelessWidget {
|
|||
child: Center(
|
||||
child: Material(
|
||||
color: displayTime
|
||||
? Theme.of(context).backgroundColor
|
||||
: Theme.of(context).backgroundColor.withOpacity(0.33),
|
||||
? Theme.of(context).colorScheme.background
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.withOpacity(0.33),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Padding(
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class VerificationRequestContent extends StatelessWidget {
|
|||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ class InputBar extends StatelessWidget {
|
|||
hint,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText2
|
||||
.bodyMedium
|
||||
?.color
|
||||
?.withAlpha(150),
|
||||
),
|
||||
|
|
@ -183,7 +183,7 @@ class RecordingDialogState extends State<RecordingDialog> {
|
|||
L10n.of(context)!.cancel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).textTheme.bodyText2?.color?.withAlpha(150),
|
||||
Theme.of(context).textTheme.bodyMedium?.color?.withAlpha(150),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class _EditContent extends StatelessWidget {
|
|||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
color: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class SeenByRow extends StatelessWidget {
|
|||
width: 16,
|
||||
height: 16,
|
||||
child: Material(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
child: Center(
|
||||
child: Text(
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|||
scaffoldMessenger.showSnackBar(
|
||||
SnackBar(content: Text(e.toLocalizedString())),
|
||||
);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
(room.summary.mJoinedMemberCount ?? 0);
|
||||
final canRequestMoreMembers =
|
||||
controller.members!.length < actualMembersCount;
|
||||
final iconColor = Theme.of(context).textTheme.bodyText1!.color;
|
||||
final iconColor = Theme.of(context).textTheme.bodyLarge!.color;
|
||||
return StreamBuilder(
|
||||
stream: room.onUpdate.stream,
|
||||
builder: (context, snapshot) {
|
||||
|
|
@ -127,7 +127,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
fontSize: 14,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText2!
|
||||
.bodyMedium!
|
||||
.color,
|
||||
),
|
||||
onLinkTap: (url) =>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
|
|
@ -30,7 +30,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.endToEndEncryption),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => launch(AppConfig.encryptionTutorial),
|
||||
onPressed: () =>
|
||||
launchUrlString(AppConfig.encryptionTutorial),
|
||||
child: Text(L10n.of(context)!.help),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -228,9 +228,9 @@ class ChatListViewBody extends StatelessWidget {
|
|||
}
|
||||
const dummyChatCount = 5;
|
||||
final titleColor =
|
||||
Theme.of(context).textTheme.bodyText1!.color!.withAlpha(100);
|
||||
Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(100);
|
||||
final subtitleColor =
|
||||
Theme.of(context).textTheme.bodyText1!.color!.withAlpha(50);
|
||||
Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(50);
|
||||
return ListView.builder(
|
||||
key: const Key('dummychats'),
|
||||
itemCount: dummyChatCount,
|
||||
|
|
@ -241,7 +241,7 @@ class ChatListViewBody extends StatelessWidget {
|
|||
backgroundColor: titleColor,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 1,
|
||||
color: Theme.of(context).textTheme.bodyText1!.color,
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
),
|
||||
),
|
||||
title: Row(
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ class ChatListItem extends StatelessWidget {
|
|||
fontSize: 13,
|
||||
color: unread
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Theme.of(context).textTheme.bodyText2!.color,
|
||||
: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
Text(
|
||||
bundle!,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).textTheme.subtitle1!.color,
|
||||
color: Theme.of(context).textTheme.titleMedium!.color,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
MatrixLocals(L10n.of(context)!),
|
||||
);
|
||||
return Material(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: ListTile(
|
||||
leading: Avatar(
|
||||
mxContent: rootSpace.avatar,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class StoriesHeader extends StatelessWidget {
|
|||
leading: CircleAvatar(
|
||||
radius: Avatar.defaultSize / 2,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
child: const Icon(Icons.camera_alt_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context)!.addToStory),
|
||||
|
|
@ -226,7 +226,7 @@ class _StoryButton extends StatelessWidget {
|
|||
backgroundColor:
|
||||
Theme.of(context).colorScheme.surface,
|
||||
foregroundColor:
|
||||
Theme.of(context).textTheme.bodyText1?.color,
|
||||
Theme.of(context).textTheme.bodyLarge?.color,
|
||||
child: Hero(
|
||||
tag: heroTag,
|
||||
child: Avatar(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:matrix_homeserver_recommendations/matrix_homeserver_recommendations.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class HomeserverBottomSheet extends StatelessWidget {
|
||||
final HomeserverBenchmarkResult homeserver;
|
||||
|
|
@ -38,25 +38,26 @@ class HomeserverBottomSheet extends StatelessWidget {
|
|||
title: Text(homeserverSoftware),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () => launch(homeserver.homeserver.baseUrl.toString()),
|
||||
onTap: () =>
|
||||
launchUrlString(homeserver.homeserver.baseUrl.toString()),
|
||||
leading: const Icon(Icons.link_outlined),
|
||||
title: Text(homeserver.homeserver.baseUrl.toString()),
|
||||
),
|
||||
if (registration != null)
|
||||
ListTile(
|
||||
onTap: () => launch(registration.toString()),
|
||||
onTap: () => launchUrlString(registration.toString()),
|
||||
leading: const Icon(Icons.person_add_outlined),
|
||||
title: Text(registration.toString()),
|
||||
),
|
||||
if (rules != null)
|
||||
ListTile(
|
||||
onTap: () => launch(rules.toString()),
|
||||
onTap: () => launchUrlString(rules.toString()),
|
||||
leading: const Icon(Icons.visibility_outlined),
|
||||
title: Text(rules.toString()),
|
||||
),
|
||||
if (privacy != null)
|
||||
ListTile(
|
||||
onTap: () => launch(privacy.toString()),
|
||||
onTap: () => launchUrlString(privacy.toString()),
|
||||
leading: const Icon(Icons.shield_outlined),
|
||||
title: Text(privacy.toString()),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
||||
|
|
@ -121,7 +121,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => launch(AppConfig.privacyUrl),
|
||||
onPressed: () => launchUrlString(AppConfig.privacyUrl),
|
||||
child: Text(L10n.of(context)!.privacy),
|
||||
),
|
||||
TextButton(
|
||||
|
|
|
|||
|
|
@ -115,10 +115,7 @@ class LoginController extends State<Login> {
|
|||
// do nothing, newDomain is already set to a reasonable fallback
|
||||
}
|
||||
if (newDomain != oldHomeserver) {
|
||||
Matrix.of(context)
|
||||
.getLoginClient()
|
||||
.checkHomeserver(newDomain)
|
||||
.catchError((e) {});
|
||||
await Matrix.of(context).getLoginClient().checkHomeserver(newDomain);
|
||||
|
||||
if (Matrix.of(context).getLoginClient().homeserver == null) {
|
||||
Matrix.of(context).getLoginClient().homeserver = oldHomeserver;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
|
|
@ -93,12 +93,12 @@ class SettingsView extends StatelessWidget {
|
|||
ListTile(
|
||||
leading: const Icon(Icons.help_outline_outlined),
|
||||
title: Text(L10n.of(context)!.help),
|
||||
onTap: () => launch(AppConfig.supportUrl),
|
||||
onTap: () => launchUrlString(AppConfig.supportUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.shield_sharp),
|
||||
title: Text(L10n.of(context)!.privacy),
|
||||
onTap: () => launch(AppConfig.privacyUrl),
|
||||
onTap: () => launchUrlString(AppConfig.privacyUrl),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.info_outline_rounded),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class SettingsAccountView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(title: Text(L10n.of(context)!.account)),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).textTheme.bodyText1!.color,
|
||||
iconColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: MaxWidthBody(
|
||||
withScrolling: true,
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class SettingsChatView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(title: Text(L10n.of(context)!.chat)),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).textTheme.bodyText1!.color,
|
||||
iconColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: MaxWidthBody(
|
||||
withScrolling: true,
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(title: Text(L10n.of(context)!.security)),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).textTheme.bodyText1!.color,
|
||||
iconColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
child: MaxWidthBody(
|
||||
withScrolling: true,
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.changeWallpaper),
|
||||
trailing: Icon(
|
||||
Icons.photo_outlined,
|
||||
color: Theme.of(context).textTheme.bodyText1?.color,
|
||||
color: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
),
|
||||
onTap: controller.setWallpaperAction,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,12 @@ extension LocalizedExceptionExtension on Object {
|
|||
.toString()
|
||||
.replaceAll('{', '"')
|
||||
.replaceAll('}', '"');
|
||||
return L10n.of(context)!
|
||||
.badServerVersionsException(serverVersions, supportedVersions);
|
||||
return L10n.of(context)!.badServerVersionsException(
|
||||
serverVersions,
|
||||
supportedVersions,
|
||||
serverVersions,
|
||||
supportedVersions,
|
||||
);
|
||||
}
|
||||
if (this is BadServerLoginTypesException) {
|
||||
final serverVersions = (this as BadServerLoginTypesException)
|
||||
|
|
@ -44,8 +48,11 @@ extension LocalizedExceptionExtension on Object {
|
|||
.toString()
|
||||
.replaceAll('{', '"')
|
||||
.replaceAll('}', '"');
|
||||
return L10n.of(context)!
|
||||
.badServerLoginTypesException(serverVersions, supportedVersions);
|
||||
return L10n.of(context)!.badServerLoginTypesException(
|
||||
serverVersions,
|
||||
supportedVersions,
|
||||
supportedVersions,
|
||||
);
|
||||
}
|
||||
if (this is MatrixConnectionException || this is SocketException) {
|
||||
return L10n.of(context)!.noConnectionToTheServer;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:file_picker_cross/file_picker_cross.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
|
|
@ -22,17 +20,12 @@ extension MatrixFileExtension on MatrixFile {
|
|||
}
|
||||
|
||||
void share(BuildContext context) async {
|
||||
final fileName = name.split('/').last;
|
||||
final tmpDirectory = await getTemporaryDirectory();
|
||||
final path = '${tmpDirectory.path}$fileName';
|
||||
await File(path).writeAsBytes(bytes);
|
||||
|
||||
// Workaround for iPad from
|
||||
// https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus/share_plus#ipad
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
|
||||
await Share.shareFiles(
|
||||
[path],
|
||||
await Share.shareXFiles(
|
||||
[XFile.fromData(bytes)],
|
||||
sharePositionOrigin:
|
||||
box == null ? null : box.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class MatrixLocals extends MatrixLocalizations {
|
|||
|
||||
@override
|
||||
String answeredTheCall(String senderName) {
|
||||
return l10n.answeredTheCall(senderName);
|
||||
return l10n.answeredTheCall(senderName, senderName);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -245,7 +245,7 @@ class MatrixLocals extends MatrixLocalizations {
|
|||
|
||||
@override
|
||||
String unknownEvent(String typeKey) {
|
||||
return l10n.unknownEvent(typeKey);
|
||||
return l10n.unknownEvent(typeKey, typeKey);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import '../config/app_config.dart';
|
||||
|
|
@ -50,11 +50,11 @@ abstract class PlatformInfos {
|
|||
children: [
|
||||
Text('Version: $version'),
|
||||
OutlinedButton(
|
||||
onPressed: () => launch(AppConfig.sourceCodeUrl),
|
||||
onPressed: () => launchUrlString(AppConfig.sourceCodeUrl),
|
||||
child: Text(L10n.of(context)!.sourceCode),
|
||||
),
|
||||
OutlinedButton(
|
||||
onPressed: () => launch(AppConfig.emojiFontUrl),
|
||||
onPressed: () => launchUrlString(AppConfig.emojiFontUrl),
|
||||
child: const Text(AppConfig.emojiFontName),
|
||||
),
|
||||
OutlinedButton(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'dart:async';
|
|||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
|
|
@ -83,11 +83,7 @@ extension UiaRequestManager on MatrixState {
|
|||
default:
|
||||
final url = Uri.parse(
|
||||
'${client.homeserver}/_matrix/client/r0/auth/$stage/fallback/web?session=${uiaRequest.session}');
|
||||
launch(
|
||||
url.toString(),
|
||||
forceSafariVC: true,
|
||||
forceWebView: false,
|
||||
);
|
||||
launchUrlString(url.toString());
|
||||
if (OkCancelResult.ok ==
|
||||
await showOkCancelAlertDialog(
|
||||
useRootNavigator: false,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:punycode/punycode.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
|
|
@ -56,17 +56,17 @@ class UrlLauncher {
|
|||
// to an apple maps thingy
|
||||
// https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html
|
||||
final ll = '${latlong.first},${latlong.last}';
|
||||
launch('https://maps.apple.com/?q=$ll&sll=$ll');
|
||||
launchUrlString('https://maps.apple.com/?q=$ll&sll=$ll');
|
||||
} else {
|
||||
// transmute geo URIs on desktop to openstreetmap links, as those usually can't handle
|
||||
// geo URIs
|
||||
launch(
|
||||
launchUrlString(
|
||||
'https://www.openstreetmap.org/?mlat=${latlong.first}&mlon=${latlong.last}#map=16/${latlong.first}/${latlong.last}');
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
launch(url!);
|
||||
launchUrlString(url!);
|
||||
return;
|
||||
}
|
||||
if (uri.host.isEmpty) {
|
||||
|
|
@ -84,7 +84,7 @@ class UrlLauncher {
|
|||
? 'xn--$hostPartPunycode'
|
||||
: hostPart;
|
||||
}).join('.');
|
||||
launch(uri.replace(host: newHost).toString());
|
||||
launchUrlString(uri.replace(host: newHost).toString());
|
||||
}
|
||||
|
||||
void openMatrixToUrl() async {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate {
|
|||
overlayEntry = null;
|
||||
}),
|
||||
);
|
||||
Overlay.of(context)!.insert(overlayEntry!);
|
||||
Overlay.of(context).insert(overlayEntry!);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class ContentBanner extends StatelessWidget {
|
|||
mini: true,
|
||||
heroTag: null,
|
||||
onPressed: onEdit,
|
||||
backgroundColor: Theme.of(context).backgroundColor,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
child: const Icon(Icons.camera_alt_outlined),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class LockScreenState extends State<LockScreen> {
|
|||
),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topRight,
|
||||
end: Alignment.bottomLeft,
|
||||
|
|
@ -54,7 +54,7 @@ class LockScreenState extends State<LockScreen> {
|
|||
Theme.of(context).secondaryHeaderColor.withAlpha(16),
|
||||
Theme.of(context).primaryColor.withAlpha(16),
|
||||
Theme.of(context).colorScheme.secondary.withAlpha(16),
|
||||
Theme.of(context).backgroundColor.withAlpha(16),
|
||||
Theme.of(context).colorScheme.background.withAlpha(16),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class M2PopupMenuButton<T> extends StatelessWidget {
|
|||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
elevation: theme.appBarTheme.scrolledUnderElevation,
|
||||
textStyle: theme.textTheme.bodyText1,
|
||||
textStyle: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
child: PopupMenuButton<T>(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/utils/client_manager.dart';
|
||||
|
|
@ -410,7 +410,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
cancelLabel: L10n.of(context)!.doNotShowAgain,
|
||||
);
|
||||
if (result == OkCancelResult.ok && link != null) {
|
||||
launch(link.toString());
|
||||
launchUrlString(link.toString());
|
||||
}
|
||||
if (result == OkCancelResult.cancel) {
|
||||
await store.setItemBool(SettingKeys.showNoGoogle, true);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
|||
linkStyle: const TextStyle(color: Colors.blueAccent),
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
color: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
),
|
||||
onLinkTap: (url) =>
|
||||
UrlLauncher(context, url).launchUrl(),
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ class ThemeController extends State<ThemeBuilder> {
|
|||
// https://github.com/bdlukaa/system_theme/issues/10
|
||||
final accentColor = SystemTheme.accentColor;
|
||||
final color = accentColor.accent;
|
||||
if (color == kDefaultSystemAccentColor) return AppConfig.chatColor;
|
||||
return color;
|
||||
} catch (_) {
|
||||
return AppConfig.chatColor;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:badges/badges.dart' as b;
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'matrix.dart';
|
||||
|
||||
class UnreadRoomsBadge extends StatelessWidget {
|
||||
final bool Function(Room) filter;
|
||||
final BadgePosition? badgePosition;
|
||||
final b.BadgePosition? badgePosition;
|
||||
final Widget? child;
|
||||
|
||||
const UnreadRoomsBadge({
|
||||
|
|
@ -32,7 +32,7 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
.where(filter)
|
||||
.where((r) => (r.isUnread || r.membership == Membership.invite))
|
||||
.length;
|
||||
return Badge(
|
||||
return b.Badge(
|
||||
alignment: Alignment.bottomRight,
|
||||
badgeContent: Text(
|
||||
unreadCount.toString(),
|
||||
|
|
@ -42,14 +42,13 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
showBadge: unreadCount != 0,
|
||||
animationType: BadgeAnimationType.scale,
|
||||
animationType: b.BadgeAnimationType.scale,
|
||||
badgeColor: Theme.of(context).colorScheme.primary,
|
||||
position: badgePosition,
|
||||
elevation: 4,
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
width: 2,
|
||||
strokeAlign: StrokeAlign.outside,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue