fluffychat merge

This commit is contained in:
ggurdin 2026-02-05 13:00:27 -05:00
commit 0adb9e1f73
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
15 changed files with 45 additions and 85 deletions

View file

@ -13,42 +13,5 @@ analyzer:
errors:
todo: ignore
use_build_context_synchronously: ignore
deprecated_member_use: ignore
exclude:
- lib/generated_plugin_registrant.dart
- lib/l10n/*.dart
- assets/l10n/*.arb
dart_code_metrics:
metrics:
cyclomatic-complexity: 20
number-of-arguments: 4
maximum-nesting-level: 5
source-lines-of-code: 50
maintainability-index: 40
rules:
- no-boolean-literal-compare
- no-empty-block
- prefer-conditional-expressions
- no-equal-then-else
- no-magic-number:
severity: style
- avoid-late-keyword:
severity: style
- avoid-non-null-assertion:
severity: style
- avoid-unused-parameters
- binary-expression-operand-order
- avoid-unnecessary-setstate
- avoid-wrapping-in-padding
- prefer-const-border-radius
- prefer-single-widget-per-file:
ignore-private-widgets: true
- prefer-extracting-callbacks
metrics-exclude:
- test/**
rules-exclude:
- test/**
anti-patterns:
- long-method
- long-parameter-list

View file

@ -86,7 +86,7 @@ enum AppSettings<T> {
static SharedPreferences get store => _store!;
static SharedPreferences? _store;
static Future<SharedPreferences> init({loadWebConfigFile = true}) async {
static Future<SharedPreferences> init({bool loadWebConfigFile = true}) async {
if (AppSettings._store != null) return AppSettings.store;
final store = AppSettings._store = await SharedPreferences.getInstance();

View file

@ -219,9 +219,9 @@ class ChatController extends State<ChatPageWithRoom>
// #Pangea
// bool dragging = false;
// void onDragEntered(_) => setState(() => dragging = true);
// void onDragEntered(dynamic _) => setState(() => dragging = true);
// void onDragExited(_) => setState(() => dragging = false);
// void onDragExited(dynamic _) => setState(() => dragging = false);
// void onDragDone(DropDoneDetails details) async {
// setState(() => dragging = false);
@ -250,7 +250,8 @@ class ChatController extends State<ChatPageWithRoom>
MessageTypes.File,
}.contains(selectedEvents.single.messageType);
void saveSelectedEvent(context) => selectedEvents.single.saveFile(context);
void saveSelectedEvent(BuildContext context) =>
selectedEvents.single.saveFile(context);
List<Event> selectedEvents = [];
@ -324,7 +325,7 @@ class ChatController extends State<ChatPageWithRoom>
}
// #Pangea
// void requestHistory([_]) async {
// void requestHistory([dynamic _]) async {
Future<void> requestHistory() async {
if (timeline == null) return;
if (!timeline!.canRequestHistory) return;
@ -374,7 +375,7 @@ class ChatController extends State<ChatPageWithRoom>
}
}
void _shareItems([_]) {
void _shareItems([dynamic _]) {
final shareItems = widget.shareItems;
if (shareItems == null || shareItems.isEmpty) return;
if (!room.otherPartyCanReceiveMessages) {
@ -1671,7 +1672,7 @@ class ChatController extends State<ChatPageWithRoom>
scrollController.jumpTo(0);
}
void onEmojiSelected(_, Emoji? emoji) {
void onEmojiSelected(dynamic _, Emoji? emoji) {
typeEmoji(emoji);
onInputBarChanged(sendController.text);
}
@ -1839,14 +1840,14 @@ class ChatController extends State<ChatPageWithRoom>
// #Pangea
// void onInputBarSubmitted(String _) {
// send();
// FocusScope.of(context).requestFocus(inputFocus);
Future<void> onInputBarSubmitted() async {
// send();
if (MatrixState.pangeaController.subscriptionController.shouldShowPaywall) {
PaywallCard.show(context, ChoreoConstants.inputTransformTargetKey);
return;
}
await onRequestWritingAssistance(manual: false, autosend: true);
// FocusScope.of(context).requestFocus(inputFocus);
// Pangea#
}
@ -1881,7 +1882,7 @@ class ChatController extends State<ChatPageWithRoom>
}
}
unpinEvent(String eventId) async {
void unpinEvent(String eventId) async {
final response = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).unpin,

View file

@ -69,7 +69,7 @@ class _CuteContentState extends State<CuteContent> {
Overlay.of(context).insert(overlay);
}
generateLabel(User? user) {
String? generateLabel(User? user) {
switch (widget.event.content['cute_type']) {
case 'googly_eyes':
return L10n.of(context).googlyEyesContent(
@ -90,6 +90,7 @@ class _CuteContentState extends State<CuteContent> {
'',
);
}
return null;
}
}

View file

@ -56,7 +56,7 @@ class _StartPollBottomSheetState extends State<StartPollBottomSheet> {
}
}
void _updateCanCreate([_]) {
void _updateCanCreate([dynamic _]) {
final newCanCreate = _bodyController.text.trim().isNotEmpty &&
!_answers.any((controller) => controller.text.trim().isEmpty);
if (_canCreate != newCanCreate) {

View file

@ -36,7 +36,7 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
}
}
void enableEncryption(_) async {
void enableEncryption(dynamic _) async {
if (room.encrypted) {
showOkAlertDialog(
context: context,

View file

@ -55,7 +55,7 @@ class ChatMembersController extends State<ChatMembersPage> {
setFilter();
}
void setFilter([_]) async {
void setFilter([dynamic _]) async {
final filter = filterController.text.toLowerCase().trim();
final members = this
@ -82,7 +82,7 @@ class ChatMembersController extends State<ChatMembersPage> {
});
}
void refreshMembers([_]) async {
void refreshMembers([dynamic _]) async {
Logs().d('Load room members from', widget.roomId);
try {
setState(() {

View file

@ -111,7 +111,7 @@ class PIPViewState extends State<PIPView> with TickerProviderStateMixin {
});
}
void _onPanEnd(_) {
void _onPanEnd(dynamic _) {
if (!_isDragging) return;
final nearestCorner = _calculateNearestCorner(
@ -128,7 +128,7 @@ class PIPViewState extends State<PIPView> with TickerProviderStateMixin {
});
}
void _onPanStart(_) {
void _onPanStart(dynamic _) {
if (_isAnimating()) return;
setState(() {
_dragOffset = _offsets[_corner]!;

View file

@ -215,7 +215,7 @@ class NewGroupController extends State<NewGroup> {
// Pangea#
}
void submitAction([_]) async {
void submitAction([dynamic _]) async {
final client = Matrix.of(context).client;
try {

View file

@ -193,7 +193,7 @@ class SettingsController extends State<Settings> {
bool? crossSigningCached;
bool? showChatBackupBanner;
void firstRunBootstrapAction([_]) async {
void firstRunBootstrapAction([dynamic _]) async {
// #Pangea
// if (showChatBackupBanner != true) {
// showOkAlertDialog(

View file

@ -303,7 +303,7 @@ class _EmojiImportPreviewState extends State<_EmojiImportPreview> {
);
}
_setRenderError() {
void _setRenderError() {
hasErrorNotifier.value = true;
widget.onRemove.call();
}

View file

@ -41,7 +41,7 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback(_checkLoggedIn);
}
void _checkLoggedIn(_) async {
void _checkLoggedIn(dynamic _) async {
if (widget.clients.any((client) => client.isLogged())) return;
await changePincode(null);

View file

@ -43,7 +43,7 @@ class ThemeController extends State<ThemeBuilder> {
listen: false,
);
void _loadData(_) async {
void _loadData(dynamic _) async {
final preferences =
_sharedPreferences ??= await SharedPreferences.getInstance();

View file

@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d
url: "https://pub.dev"
source: hosted
version: "67.0.0"
version: "91.0.0"
_flutterfire_internals:
dependency: transitive
description:
@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: analyzer
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08
url: "https://pub.dev"
source: hosted
version: "6.4.1"
version: "8.4.1"
android_intent_plus:
dependency: "direct main"
description:
@ -512,7 +512,7 @@ packages:
sha256: "984d3e9b9cf3175df9a868ce4a2d9611491e80e5d3b8e2b1e8991a4998972885"
url: "https://pub.dev"
source: hosted
version: "4.3.0"
version: "4.4.0"
equatable:
dependency: transitive
description:
@ -760,10 +760,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "6.0.0"
flutter_local_notifications:
dependency: "direct main"
description:
@ -1384,10 +1384,11 @@ packages:
license_checker:
dependency: "direct dev"
description:
name: license_checker
sha256: eea27638e42bc98fd91a6a8187eb57e5617e2c3c8b313a5d51b14bec7a8685e1
url: "https://pub.dev"
source: hosted
path: "."
ref: HEAD
resolved-ref: "38a65ff5b4b65db092b11dad999081388f75ece8"
url: "https://github.com/krille-chan/license_checker.git"
source: git
version: "1.6.0"
linkify:
dependency: "direct main"
@ -1401,10 +1402,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "6.1.0"
list_counter:
dependency: transitive
description:
@ -1632,10 +1633,10 @@ packages:
dependency: transitive
description:
name: pana
sha256: "3fc3fe8e7a9fd4827fa4d625a423eec95d305b2bc3538a3adf7fd6c49217af97"
sha256: eb816d35b80d3880335c3f2d139b376e81fd98a9ea273faf39f2c8914c4afba5
url: "https://pub.dev"
source: hosted
version: "0.21.45"
version: "0.23.3"
path:
dependency: "direct main"
description:
@ -2377,14 +2378,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.0"
tar:
dependency: transitive
description:
name: tar
sha256: "22f67e2d77b51050436620b2a5de521c58ca6f0b75af1d9ab3c8cae2eae58fcd"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
term_glyph:
dependency: transitive
description:

View file

@ -127,14 +127,16 @@ dependencies:
# Pangea#
dev_dependencies:
flutter_lints: ^3.0.0
flutter_lints: ^6.0.0
flutter_native_splash: ^2.4.7
flutter_test:
sdk: flutter
import_sorter: ^4.6.0
integration_test:
sdk: flutter
license_checker: ^1.6.0
# Waiting for https://github.com/rufman/license_checker/pull/47
license_checker:
git: https://github.com/krille-chan/license_checker.git
pedantic: ^1.11.0
sentry_dart_plugin: ^1.0.0
translations_cleaner: ^0.0.5
@ -168,4 +170,4 @@ flutter:
# 1. Don't do it if you can avoid it or fix it upstream in a manageable time
# 2. Always link an (upstream?) issue
# 3. Explain how and when this can be removed (overrides must be temporarily)
dependency_overrides:
dependency_overrides: