mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-28 09:02:35 +01:00
Merge branch 'krille/null-safe-deps' into 'main'
refactor: Null safe dependencies See merge request famedly/fluffychat!404
This commit is contained in:
commit
4f6b9925d8
@ -32,30 +32,30 @@ build_web:
|
||||
paths:
|
||||
- build/web/
|
||||
|
||||
build_windows:
|
||||
extends:
|
||||
- .shared_windows_runners
|
||||
stage: coverage
|
||||
script:
|
||||
# Install chocolately
|
||||
- Set-ExecutionPolicy Bypass -Scope Process
|
||||
- Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
- choco install git -y
|
||||
- choco install visualstudio2019community -y --package-parameters "--add Microsoft.VisualStudio.Product.BuildTools --includeRecommended --includeOptional --passive --locale en-US"
|
||||
- cd ..; git clone https://github.com/flutter/flutter.git -b dev; $env:path += ";C:\GitLab-Runner\builds\famedly\flutter\bin"; cd fluffychat
|
||||
- flutter doctor
|
||||
- flutter config --enable-windows-desktop
|
||||
- '$package_override = "`r`ndependency_overrides:`r`n intl: 0.17.0-nullsafety.2"'
|
||||
- '[System.IO.File]::AppendAllText("$CI_PROJECT_DIR/pubspec.yaml", $package_override, [System.Text.Encoding]::UTF8)'
|
||||
- flutter clean
|
||||
- flutter pub get
|
||||
- flutter build windows
|
||||
needs: []
|
||||
artifacts:
|
||||
paths:
|
||||
- build/windows/runner/Release/
|
||||
name: "Binaries"
|
||||
allow_failure: true
|
||||
#build_windows:
|
||||
# extends:
|
||||
# - .shared_windows_runners
|
||||
# stage: coverage
|
||||
# script:
|
||||
# # Install chocolately
|
||||
# - Set-ExecutionPolicy Bypass -Scope Process
|
||||
# - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
# - choco install git -y
|
||||
# - choco install visualstudio2019community -y --package-parameters "--add Microsoft.VisualStudio.Product.BuildTools --includeRecommended --includeOptional --passive --locale en-US"
|
||||
# - cd ..; git clone https://github.com/flutter/flutter.git -b dev; $env:path += ";C:\GitLab-Runner\builds\famedly\flutter\bin"; cd fluffychat
|
||||
# - flutter doctor
|
||||
# - flutter config --enable-windows-desktop
|
||||
# - '$package_override = "`r`ndependency_overrides:`r`n intl: 0.17.0-nullsafety.2"'
|
||||
# - '[System.IO.File]::AppendAllText("$CI_PROJECT_DIR/pubspec.yaml", $package_override, [System.Text.Encoding]::UTF8)'
|
||||
# - flutter clean
|
||||
# - flutter pub get
|
||||
# - flutter build windows
|
||||
# needs: []
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - build/windows/runner/Release/
|
||||
# name: "Binaries"
|
||||
# allow_failure: true
|
||||
|
||||
build_android_debug:
|
||||
stage: coverage
|
||||
@ -159,34 +159,32 @@ build_linux:
|
||||
stage: coverage
|
||||
before_script:
|
||||
[
|
||||
sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev -y,
|
||||
sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp1 libsecret-1-dev libsecret-1-0 librhash0 -y,
|
||||
]
|
||||
script: [./scripts/build-linux.sh]
|
||||
artifacts:
|
||||
when: on_success
|
||||
paths:
|
||||
- build/linux/release/bundle/
|
||||
allow_failure: true
|
||||
|
||||
snap:edge:
|
||||
stage: release
|
||||
image: "snapcore/snapcraft"
|
||||
before_script:
|
||||
- apt update && apt install git curl unzip clang cmake build-essential ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev -y
|
||||
- git clone https://github.com/flutter/flutter.git
|
||||
- export PATH="$PATH:`pwd`/flutter/bin"
|
||||
variables:
|
||||
SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
|
||||
only:
|
||||
- main
|
||||
script: [./scripts/publish-snap-edge.sh]
|
||||
needs: ["build_linux"]
|
||||
dependencies: ["build_linux"]
|
||||
artifacts:
|
||||
paths:
|
||||
- "./*.snap"
|
||||
when: on_success
|
||||
allow_failure: true
|
||||
#snap:edge:
|
||||
# stage: release
|
||||
# image: "snapcore/snapcraft"
|
||||
# before_script:
|
||||
# - apt update && apt install git curl unzip clang cmake build-essential ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev -y
|
||||
# - git clone https://github.com/flutter/flutter.git
|
||||
# - export PATH="$PATH:`pwd`/flutter/bin"
|
||||
# variables:
|
||||
# SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
|
||||
# only:
|
||||
# - main
|
||||
# script: [./scripts/publish-snap-edge.sh]
|
||||
# needs: ["build_linux"]
|
||||
# dependencies: ["build_linux"]
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - "./*.snap"
|
||||
# when: on_success
|
||||
|
||||
#snap:publish:
|
||||
# stage: release
|
||||
@ -202,7 +200,6 @@ snap:edge:
|
||||
# - "./*.snap"
|
||||
# when: on_success
|
||||
# expire_in: 1 week
|
||||
# allow_failure: true
|
||||
|
||||
update-dependencies:
|
||||
stage: coverage
|
||||
|
@ -3,29 +3,15 @@ package chat.fluffy.fluffychat
|
||||
import io.flutter.app.FlutterApplication
|
||||
import io.flutter.plugin.common.PluginRegistry
|
||||
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
|
||||
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin
|
||||
import io.flutter.view.FlutterMain
|
||||
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
|
||||
import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin
|
||||
import com.tekartik.sqflite.SqflitePlugin
|
||||
import com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin
|
||||
import io.flutter.plugins.pathprovider.PathProviderPlugin
|
||||
|
||||
class Application : FlutterApplication(), PluginRegistrantCallback {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
FlutterFirebaseMessagingService.setPluginRegistrant(this);
|
||||
FlutterMain.startInitialization(this)
|
||||
}
|
||||
|
||||
override fun registerWith(registry: PluginRegistry?) {
|
||||
if (!registry!!.hasPlugin("io.flutter.plugins.firebasemessaging")) {
|
||||
FirebaseMessagingPlugin.registerWith(registry!!.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
|
||||
FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin"));
|
||||
SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
|
||||
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
|
||||
FlutterSecureStoragePlugin.registerWith(registry.registrarFor("com.it_nomads.fluttersecurestorage"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
android/app/src/main/res/drawable-v21/launch_background.xml
Normal file
12
android/app/src/main/res/drawable-v21/launch_background.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
@ -6,9 +6,9 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.4'
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.2'
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
||||
|
@ -14,7 +14,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
import 'views/widgets/matrix.dart';
|
||||
import 'config/themes.dart';
|
||||
|
@ -34,7 +34,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n_en.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'platform_infos.dart';
|
||||
import '../config/app_config.dart';
|
||||
import '../config/setting_keys.dart';
|
||||
@ -130,12 +129,7 @@ class BackgroundPush {
|
||||
bool useDeviceSpecificAppId = false,
|
||||
}) async {
|
||||
if (PlatformInfos.isIOS) {
|
||||
FirebaseMessaging()
|
||||
.requestNotificationPermissions(IosNotificationSettings(
|
||||
sound: true,
|
||||
alert: true,
|
||||
badge: true,
|
||||
));
|
||||
await _fcmSharedIsolate.requestPermission();
|
||||
}
|
||||
final clientName = PlatformInfos.clientName;
|
||||
oldTokens ??= <String>{};
|
||||
@ -355,7 +349,8 @@ class BackgroundPush {
|
||||
.toString()
|
||||
.split('?')
|
||||
.first;
|
||||
final res = json.decode(utf8.decode((await http.get(url)).bodyBytes));
|
||||
final res =
|
||||
json.decode(utf8.decode((await http.get(Uri.parse(url))).bodyBytes));
|
||||
if (res['gateway'] == 'matrix') {
|
||||
endpoint = url;
|
||||
}
|
||||
@ -699,7 +694,7 @@ class BackgroundPush {
|
||||
final url = thumbnail
|
||||
? content.getThumbnail(client, width: width, height: height)
|
||||
: content.getDownloadLink(client);
|
||||
final request = await HttpClient().getUrl(Uri.parse(url));
|
||||
final request = await HttpClient().getUrl(url);
|
||||
final response = await request.close();
|
||||
if (response.statusCode >= 300) {
|
||||
// we are not in the 2xx range
|
||||
|
@ -8,7 +8,7 @@ Future<Database> constructDb(
|
||||
String password = ''}) async {
|
||||
Logs().v('[Moor] Using moor web');
|
||||
return Database(WebDatabase.withStorage(
|
||||
MoorWebStorage.indexedDbIfSupported(filename),
|
||||
await MoorWebStorage.indexedDbIfSupported(filename),
|
||||
logStatements: logStatements));
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ extension LocalizedBody on Event {
|
||||
}
|
||||
// check if the url is cached
|
||||
final url = Uri.parse(mxcUrl).getDownloadLink(room.client);
|
||||
final file = await DefaultCacheManager().getFileFromCache(url);
|
||||
final file = await DefaultCacheManager().getFileFromCache(url.toString());
|
||||
return file != null;
|
||||
}
|
||||
|
||||
@ -96,8 +96,8 @@ extension LocalizedBody on Event {
|
||||
final mxcUrl = attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail);
|
||||
_downloadAndDecryptFutures[mxcUrl] ??= downloadAndDecryptAttachment(
|
||||
getThumbnail: getThumbnail,
|
||||
downloadCallback: (String url) async {
|
||||
final file = await DefaultCacheManager().getSingleFile(url);
|
||||
downloadCallback: (Uri url) async {
|
||||
final file = await DefaultCacheManager().getSingleFile(url.toString());
|
||||
return await file.readAsBytes();
|
||||
},
|
||||
);
|
||||
|
@ -7,7 +7,7 @@ extension FilteredTimelineExtension on Timeline {
|
||||
final filteredEvents = events
|
||||
.where((e) =>
|
||||
// always filter out edit and reaction relationships
|
||||
!{RelationshipTypes.Edit, RelationshipTypes.Reaction}
|
||||
!{RelationshipTypes.edit, RelationshipTypes.reaction}
|
||||
.contains(e.relationshipType) &&
|
||||
// always filter out m.key.* events
|
||||
!e.type.startsWith('m.key.verification.') &&
|
||||
|
@ -6,7 +6,7 @@ import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:open_file/open_file.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:mime_type/mime_type.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
|
@ -22,13 +22,13 @@ abstract class SentryController {
|
||||
return await storage.getItemBool(SettingKeys.sentry);
|
||||
}
|
||||
|
||||
static final sentry = SentryClient(dsn: AppConfig.sentryDns);
|
||||
static final sentry = SentryClient(SentryOptions(dsn: AppConfig.sentryDns));
|
||||
|
||||
static void captureException(error, stackTrace) async {
|
||||
Logs().e('Capture exception', error, stackTrace);
|
||||
if (!kDebugMode && await getSentryStatus()) {
|
||||
await sentry.captureException(
|
||||
exception: error,
|
||||
error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:adaptive_page_layout/adaptive_page_layout.dart';
|
||||
import 'package:emoji_picker/emoji_picker.dart';
|
||||
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:file_picker_cross/file_picker_cross.dart';
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
@ -395,7 +395,7 @@ class ChatController extends State<Chat> {
|
||||
event.sendAgain();
|
||||
}
|
||||
final allEditEvents = event
|
||||
.aggregatedEvents(timeline, RelationshipTypes.Edit)
|
||||
.aggregatedEvents(timeline, RelationshipTypes.edit)
|
||||
.where((e) => e.status == -1);
|
||||
for (final e in allEditEvents) {
|
||||
e.sendAgain();
|
||||
@ -473,7 +473,7 @@ class ChatController extends State<Chat> {
|
||||
children: [
|
||||
Spacer(),
|
||||
EmojiPicker(
|
||||
onEmojiSelected: (emoji, category) {
|
||||
onEmojiSelected: (category, emoji) {
|
||||
// recent emojis don't work, so we sadly have to re-implement them
|
||||
// https://github.com/JeffG05/emoji_picker/issues/31
|
||||
SharedPreferences.getInstance().then((prefs) {
|
||||
@ -482,7 +482,7 @@ class ChatController extends State<Chat> {
|
||||
// make sure we remove duplicates
|
||||
prefs.setStringList('recents', recents.toSet().toList());
|
||||
});
|
||||
Navigator.of(context, rootNavigator: false).pop<Emoji>(emoji);
|
||||
Navigator.of(context, rootNavigator: false).pop(emoji);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -125,7 +125,7 @@ class ChatListController extends State<ChatList> {
|
||||
context: context,
|
||||
future: () => room.setPushRuleState(
|
||||
room.pushRuleState == PushRuleState.notify
|
||||
? PushRuleState.mentions_only
|
||||
? PushRuleState.mentionsOnly
|
||||
: PushRuleState.notify),
|
||||
);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../utils/localized_exception_extension.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
class HomeserverPicker extends StatefulWidget {
|
||||
@override
|
||||
|
@ -241,8 +241,8 @@ class ChatDetailsUI extends StatelessWidget {
|
||||
),
|
||||
if (room.canChangeHistoryVisibility)
|
||||
PopupMenuItem<HistoryVisibility>(
|
||||
value: HistoryVisibility.world_readable,
|
||||
child: Text(HistoryVisibility.world_readable
|
||||
value: HistoryVisibility.worldReadable,
|
||||
child: Text(HistoryVisibility.worldReadable
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
@ -269,9 +269,9 @@ class ChatDetailsUI extends StatelessWidget {
|
||||
<PopupMenuEntry<GuestAccess>>[
|
||||
if (room.canChangeGuestAccess)
|
||||
PopupMenuItem<GuestAccess>(
|
||||
value: GuestAccess.can_join,
|
||||
value: GuestAccess.canJoin,
|
||||
child: Text(
|
||||
GuestAccess.can_join.getLocalizedString(
|
||||
GuestAccess.canJoin.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
|
@ -431,7 +431,7 @@ class ChatUI extends StatelessWidget {
|
||||
final emojis = List<String>.from(AppEmojis.emojis);
|
||||
final allReactionEvents = controller.selectedEvents.first
|
||||
.aggregatedEvents(
|
||||
controller.timeline, RelationshipTypes.Reaction)
|
||||
controller.timeline, RelationshipTypes.reaction)
|
||||
?.where((event) =>
|
||||
event.senderId == event.room.client.userID &&
|
||||
event.type == 'm.reaction');
|
||||
|
@ -425,7 +425,7 @@ class _EmoteImage extends StatelessWidget {
|
||||
method: ThumbnailMethod.scale,
|
||||
);
|
||||
return CachedNetworkImage(
|
||||
imageUrl: url,
|
||||
imageUrl: url.toString(),
|
||||
fit: BoxFit.contain,
|
||||
width: size,
|
||||
height: size,
|
||||
|
@ -16,7 +16,7 @@ import 'package:fluffychat/utils/sentry_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_screen_lock/lock_screen.dart';
|
||||
import 'package:flutter_screen_lock/functions.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@ -296,11 +296,10 @@ class _SettingsState extends State<Settings> {
|
||||
await FlutterSecureStorage().read(key: SettingKeys.appLockKey);
|
||||
if (currentLock?.isNotEmpty ?? false) {
|
||||
var unlocked = false;
|
||||
await showLockScreen(
|
||||
await screenLock(
|
||||
context: context,
|
||||
correctString: currentLock,
|
||||
onUnlocked: () => unlocked = true,
|
||||
canBiometric: true,
|
||||
didConfirmed: (_) => unlocked = true,
|
||||
);
|
||||
if (unlocked != true) return;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:fluffychat/views/widgets/message_download_content.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_sound_lite/flutter_sound.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import '../../utils/ui_fake.dart' if (dart.library.html) 'dart:ui' as ui;
|
||||
import 'matrix.dart';
|
||||
@ -144,7 +144,8 @@ class _AudioPlayerState extends State<AudioPlayer> {
|
||||
if (kIsWeb) {
|
||||
if (widget.event.content['url'] is String) {
|
||||
webSrcUrl = Uri.parse(widget.event.content['url'])
|
||||
.getDownloadLink(Matrix.of(context).client);
|
||||
.getDownloadLink(Matrix.of(context).client)
|
||||
.toString();
|
||||
return Container(
|
||||
height: 50,
|
||||
width: 300,
|
||||
|
@ -66,7 +66,7 @@ class Avatar extends StatelessWidget {
|
||||
child: noPic
|
||||
? textWidget
|
||||
: CachedNetworkImage(
|
||||
imageUrl: src,
|
||||
imageUrl: src.toString(),
|
||||
fit: BoxFit.cover,
|
||||
width: size,
|
||||
height: size,
|
||||
|
@ -86,7 +86,7 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () =>
|
||||
widget.room.setPushRuleState(PushRuleState.mentions_only));
|
||||
widget.room.setPushRuleState(PushRuleState.mentionsOnly));
|
||||
break;
|
||||
case 'unmute':
|
||||
await showFutureLoadingDialog(
|
||||
|
@ -53,7 +53,7 @@ class ContentBanner extends StatelessWidget {
|
||||
opacity: opacity,
|
||||
child: (!loading && mxContent != null)
|
||||
? CachedNetworkImage(
|
||||
imageUrl: src,
|
||||
imageUrl: src.toString(),
|
||||
height: 300,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
|
@ -56,13 +56,15 @@ class HtmlMessage extends StatelessWidget {
|
||||
getMxcUrl: (String mxc, double width, double height,
|
||||
{bool animated = false}) {
|
||||
final ratio = MediaQuery.of(context).devicePixelRatio;
|
||||
return Uri.parse(mxc)?.getThumbnail(
|
||||
matrix.client,
|
||||
width: (width ?? 800) * ratio,
|
||||
height: (height ?? 800) * ratio,
|
||||
method: ThumbnailMethod.scale,
|
||||
animated: animated,
|
||||
);
|
||||
return Uri.parse(mxc)
|
||||
?.getThumbnail(
|
||||
matrix.client,
|
||||
width: (width ?? 800) * ratio,
|
||||
height: (height ?? 800) * ratio,
|
||||
method: ThumbnailMethod.scale,
|
||||
animated: animated,
|
||||
)
|
||||
.toString();
|
||||
},
|
||||
setCodeLanguage: (String key, String value) async {
|
||||
await matrix.store.setItem('${SettingKeys.codeLanguage}.$key', value);
|
||||
|
@ -80,9 +80,10 @@ class _ImageBubbleState extends State<ImageBubble> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
thumbnailUrl =
|
||||
widget.event.getAttachmentUrl(getThumbnail: true, animated: true);
|
||||
attachmentUrl = widget.event.getAttachmentUrl(animated: true);
|
||||
thumbnailUrl = widget.event
|
||||
.getAttachmentUrl(getThumbnail: true, animated: true)
|
||||
.toString();
|
||||
attachmentUrl = widget.event.getAttachmentUrl(animated: true).toString();
|
||||
if (thumbnailUrl == null) {
|
||||
_requestFile(getThumbnail: true);
|
||||
}
|
||||
@ -195,12 +196,15 @@ class _ImageBubbleState extends State<ImageBubble> {
|
||||
_requestedThumbnailOnFailure = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
thumbnailUrl = widget.event.getAttachmentUrl(
|
||||
getThumbnail: true,
|
||||
useThumbnailMxcUrl: true,
|
||||
animated: true);
|
||||
thumbnailUrl = widget.event
|
||||
.getAttachmentUrl(
|
||||
getThumbnail: true,
|
||||
useThumbnailMxcUrl: true,
|
||||
animated: true)
|
||||
.toString();
|
||||
attachmentUrl = widget.event
|
||||
.getAttachmentUrl(useThumbnailMxcUrl: true, animated: true);
|
||||
.getAttachmentUrl(useThumbnailMxcUrl: true, animated: true)
|
||||
.toString();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ class InputBar extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
CachedNetworkImage(
|
||||
imageUrl: url,
|
||||
imageUrl: url.toString(),
|
||||
width: size,
|
||||
height: size,
|
||||
),
|
||||
|
@ -92,7 +92,7 @@ class Message extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
if (event.relationshipType == RelationshipTypes.Reply)
|
||||
if (event.relationshipType == RelationshipTypes.reply)
|
||||
FutureBuilder<Event>(
|
||||
future: event.getReplyEvent(timeline),
|
||||
builder: (BuildContext context, snapshot) {
|
||||
@ -177,7 +177,7 @@ class Message extends StatelessWidget {
|
||||
children: rowChildren,
|
||||
);
|
||||
Widget container;
|
||||
if (event.hasAggregatedEvents(timeline, RelationshipTypes.Reaction)) {
|
||||
if (event.hasAggregatedEvents(timeline, RelationshipTypes.reaction)) {
|
||||
container = Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
@ -253,7 +253,7 @@ class _MetaRow extends StatelessWidget {
|
||||
fontSize: 11 * AppConfig.fontSizeFactor,
|
||||
),
|
||||
),
|
||||
if (event.hasAggregatedEvents(timeline, RelationshipTypes.Edit))
|
||||
if (event.hasAggregatedEvents(timeline, RelationshipTypes.edit))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 2.0),
|
||||
child: Icon(
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
||||
import 'package:flutter_screen_lock/lock_screen.dart';
|
||||
import 'package:flutter_screen_lock/functions.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
||||
class LockScreen extends StatelessWidget {
|
||||
@ -17,11 +17,10 @@ class LockScreen extends StatelessWidget {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (snapshot.data?.isNotEmpty ?? false) {
|
||||
showLockScreen(
|
||||
screenLock(
|
||||
context: context,
|
||||
correctString: snapshot.data,
|
||||
onUnlocked: () => AppLock.of(context).didUnlock(),
|
||||
canBiometric: true,
|
||||
didConfirmed: (_) => AppLock.of(context).didUnlock(),
|
||||
canCancel: false,
|
||||
);
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
/*import 'package:fluffychat/views/chat_ui.dart';
|
||||
@ -201,7 +201,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
html.Notification(
|
||||
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
|
||||
body: body,
|
||||
icon: icon,
|
||||
icon: icon.toString(),
|
||||
);
|
||||
} else if (Platform.isLinux) {
|
||||
/*var sessionBus = DBusClient.session();
|
||||
@ -239,7 +239,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
Future<void> initConfig() async {
|
||||
try {
|
||||
final configJsonString =
|
||||
utf8.decode((await http.get('config.json')).bodyBytes);
|
||||
utf8.decode((await http.get(Uri.parse('config.json'))).bodyBytes);
|
||||
final configJson = json.decode(configJsonString);
|
||||
AppConfig.loadFromJson(configJson);
|
||||
} catch (e, s) {
|
||||
|
@ -14,7 +14,7 @@ class MessageReactions extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final allReactionEvents =
|
||||
event.aggregatedEvents(timeline, RelationshipTypes.Reaction);
|
||||
event.aggregatedEvents(timeline, RelationshipTypes.reaction);
|
||||
final reactionMap = <String, _ReactionEntry>{};
|
||||
for (final e in allReactionEvents) {
|
||||
if (e.content['m.relates_to'].containsKey('key')) {
|
||||
@ -97,7 +97,7 @@ class _Reaction extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
CachedNetworkImage(
|
||||
imageUrl: src,
|
||||
imageUrl: src.toString(),
|
||||
height: fontSize,
|
||||
),
|
||||
Container(width: 4),
|
||||
|
@ -5,12 +5,16 @@
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <file_chooser/file_chooser_plugin.h>
|
||||
#include <flutter_secure_storage/flutter_secure_storage_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) file_chooser_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileChooserPlugin");
|
||||
file_chooser_plugin_register_with_registrar(file_chooser_registrar);
|
||||
g_autoptr(FlPluginRegistrar) flutter_secure_storage_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStoragePlugin");
|
||||
flutter_secure_storage_plugin_register_with_registrar(flutter_secure_storage_registrar);
|
||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
file_chooser
|
||||
flutter_secure_storage
|
||||
url_launcher_linux
|
||||
)
|
||||
|
||||
|
344
pubspec.lock
344
pubspec.lock
File diff suppressed because it is too large
Load Diff
97
pubspec.yaml
97
pubspec.yaml
@ -14,51 +14,44 @@ dependencies:
|
||||
git:
|
||||
url: https://gitlab.com/famedly/famedlysdk.git
|
||||
ref: main
|
||||
|
||||
unifiedpush:
|
||||
git:
|
||||
url: https://github.com/UnifiedPush/flutter-connector.git
|
||||
ref: 8edc09a87d726d912926ac612e209573452c1273
|
||||
|
||||
# Firebase Notifications
|
||||
ref: main
|
||||
fcm_shared_isolate:
|
||||
git:
|
||||
url: https://gitlab.com/famedly/libraries/fcm_shared_isolate.git
|
||||
ref: ios
|
||||
firebase_messaging: any
|
||||
ref: main
|
||||
cupertino_icons: any
|
||||
localstorage: ^3.0.6+9
|
||||
file_picker_cross: ^4.2.8
|
||||
image_picker: ^0.6.7+21
|
||||
url_launcher: ^5.7.10
|
||||
cached_network_image: ^2.5.0
|
||||
flutter_local_notifications: ^3.0.3
|
||||
localstorage: ^4.0.0+1
|
||||
file_picker_cross: ^4.3.2
|
||||
image_picker: ^0.7.4
|
||||
url_launcher: ^6.0.3
|
||||
cached_network_image: ^3.0.0
|
||||
flutter_local_notifications: ^5.0.0+1
|
||||
adaptive_page_layout: ^0.2.3
|
||||
provider: ^4.3.3
|
||||
adaptive_theme: ^1.1.0
|
||||
provider: ^5.0.0
|
||||
adaptive_theme: ^2.2.0
|
||||
# desktop_notifications: ^0.0.0-dev.4 // Currently blocked by: https://github.com/canonical/desktop_notifications.dart/issues/5
|
||||
matrix_link_text: ^0.3.2
|
||||
path_provider: ^1.6.27
|
||||
android_path_provider: ^0.1.1
|
||||
permission_handler: ^5.0.1+1
|
||||
share: ^0.6.5+4
|
||||
flutter_secure_storage: ^3.3.5
|
||||
universal_html: ^1.2.4
|
||||
receive_sharing_intent: ^1.4.3
|
||||
flutter_slidable: ^0.5.7
|
||||
flutter_sound_lite: ^7.5.3+1
|
||||
open_file: ^3.0.3
|
||||
mime_type: ^0.3.2
|
||||
adaptive_dialog: ^0.9.3
|
||||
flutter_matrix_html:
|
||||
git:
|
||||
url: https://github.com/Sorunome/flutter_matrix_html.git
|
||||
ref: 6b6a850fcfc3b0a3e88a3dd6beb79eda3acac853
|
||||
moor: ^3.4.0
|
||||
sqlite3: ^0.1.8
|
||||
sqflite: ^1.3.2+2 # Still used to obtain the database location
|
||||
flutter_typeahead: ^2.0.0
|
||||
path_provider: ^2.0.1
|
||||
android_path_provider: ^0.2.1
|
||||
permission_handler: ^6.1.3
|
||||
share: ^2.0.1
|
||||
flutter_secure_storage: ^4.1.0
|
||||
universal_html: ^2.0.8
|
||||
receive_sharing_intent: ^1.4.5
|
||||
flutter_slidable: ^0.6.0
|
||||
flutter_sound_lite: ^8.1.1
|
||||
open_file: ^3.2.0
|
||||
mime_type: ^1.0.0
|
||||
adaptive_dialog: ^0.10.0+5
|
||||
flutter_matrix_html: ^0.3.0
|
||||
moor: ^4.2.1
|
||||
sqlite3: ^1.0.0
|
||||
sqflite: ^2.0.0+3 # Still used to obtain the database location
|
||||
flutter_typeahead: ^3.1.1
|
||||
flutter_olm: ^1.1.1
|
||||
flutter_openssl_crypto: ^0.0.1
|
||||
intl: any
|
||||
circular_check_box: ^1.0.4
|
||||
flutter_localizations:
|
||||
@ -67,34 +60,26 @@ dependencies:
|
||||
git:
|
||||
url: https://gitlab.com/famedly/libraries/native_imaging.git
|
||||
ref: master
|
||||
flutter_blurhash: ^0.5.0
|
||||
sentry: ">=3.0.0 <4.0.0"
|
||||
scroll_to_index: ^1.0.6
|
||||
flutter_blurhash: ^0.6.0
|
||||
sentry: ^5.0.0
|
||||
scroll_to_index: ^2.0.0
|
||||
swipe_to_action: ^0.1.0
|
||||
flutter_svg: ^0.19.3
|
||||
flutter_cache_manager: ^2.1.1
|
||||
open_noti_settings: ^0.0.4
|
||||
emoji_picker: ^0.1.0
|
||||
flutter_svg: ^0.21.0+1
|
||||
flutter_cache_manager: ^3.0.1
|
||||
open_noti_settings: ^0.1.0
|
||||
emoji_picker_flutter: ^1.0.3
|
||||
future_loading_dialog: ^0.1.2
|
||||
package_info: ^0.4.3+2
|
||||
flutter_app_lock: ^1.4.0+1
|
||||
flutter_screen_lock: ^1.2.6
|
||||
email_validator: ^1.0.6
|
||||
package_info: ^2.0.0
|
||||
flutter_app_lock: ^1.5.0
|
||||
flutter_screen_lock: ^4.0.3
|
||||
email_validator: ^2.0.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
pedantic: ^1.9.2
|
||||
dapackages: ^1.4.0
|
||||
|
||||
# The flutter_maths version of flutter_matrix_html is weird and conflicts with a few of our packages.
|
||||
# So, we have to force-override the dependencies to work out.
|
||||
dependency_overrides:
|
||||
provider: ^4.3.3
|
||||
flutter_svg: ^0.19.3
|
||||
# Was actually brought in via fcm packages and flutter_matrix_html
|
||||
quiver: ^2.0.0
|
||||
pedantic: ^1.11.0
|
||||
dapackages: ^1.6.0
|
||||
|
||||
flutter:
|
||||
generate: true
|
||||
|
Loading…
Reference in New Issue
Block a user