Skip to content

Commit

Permalink
Fix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 16, 2024
1 parent ee02e91 commit d7b7d5a
Show file tree
Hide file tree
Showing 47 changed files with 360 additions and 231 deletions.
58 changes: 25 additions & 33 deletions api/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ packages:
dependency: "direct main"
description:
name: archive
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d"
sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
url: "https://pub.dev"
source: hosted
version: "3.4.10"
version: "3.5.1"
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "2.5.0"
async:
dependency: transitive
description:
Expand All @@ -50,10 +50,10 @@ packages:
dependency: transitive
description:
name: bloc
sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e
sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
url: "https://pub.dev"
source: hosted
version: "8.1.3"
version: "8.1.4"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -122,10 +122,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e
sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb
url: "https://pub.dev"
source: hosted
version: "8.9.1"
version: "8.9.2"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -162,10 +162,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76"
sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e"
url: "https://pub.dev"
source: hosted
version: "1.7.2"
version: "1.8.0"
crypto:
dependency: transitive
description:
Expand All @@ -178,10 +178,10 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368"
sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.3.6"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -218,10 +218,10 @@ packages:
dependency: transitive
description:
name: frontend_server_client
sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612"
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "4.0.0"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -290,10 +290,10 @@ packages:
dependency: "direct dev"
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -322,10 +322,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "25dfcaf170a0190f47ca6355bdd4552cb8924b430512ff0cafb8db9bd41fe33b"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.14.0"
version: "1.15.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -366,14 +366,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.0.2"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29"
url: "https://pub.dev"
source: hosted
version: "3.7.4"
pool:
dependency: transitive
description:
Expand Down Expand Up @@ -538,10 +530,10 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: d87214d19fb311997d8128ec501a980f77cb240ac4e7e219accf452813ff473c
sha256: d11b55850c68c1f6c0cf00eabded4e66c4043feaf6c0d7ce4a36785137df6331
url: "https://pub.dev"
source: hosted
version: "1.25.3"
version: "1.25.5"
test_api:
dependency: transitive
description:
Expand All @@ -554,10 +546,10 @@ packages:
dependency: transitive
description:
name: test_core
sha256: "2236f70be1e5ab405c675e88c36935a87dad9e05a506b57dd5c0f617f5aebcb2"
sha256: "4d070a6bc36c1c4e89f20d353bfd71dc30cdf2bd0e14349090af360a029ab292"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.2"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -586,10 +578,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246
sha256: "7475cb4dd713d57b6f7464c0e13f06da0d535d8b2067e188962a59bac2cf280b"
url: "https://pub.dev"
source: hosted
version: "14.0.0"
version: "14.2.2"
watcher:
dependency: transitive
description:
Expand All @@ -602,7 +594,7 @@ packages:
dependency: transitive
description:
name: web
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
Expand Down
2 changes: 1 addition & 1 deletion api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ dev_dependencies:
json_serializable: ^6.7.1
build_runner: ^2.4.9
freezed: ^2.5.2
lints: ^3.0.0
lints: ^4.0.0
analyzer: ^6.3.0
10 changes: 5 additions & 5 deletions app/lib/api/file_system/file_system_remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ mixin RemoteSystem {
}

Future<Uint8List> getBodyBytes(HttpClientResponse response) async {
return response.fold<Uint8List>(
Uint8List(0),
(Uint8List accumulator, List<int> chunk) =>
Uint8List.fromList(accumulator + chunk),
);
final BytesBuilder builder = BytesBuilder(copy: false);
await for (var chunk in response) {
builder.add(chunk);
}
return builder.takeBytes();
}

Future<String> getBodyString(HttpClientResponse response) async {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/bloc/document_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ class DocumentBloc extends ReplayBloc<DocumentEvent, DocumentState> {
final tool = UtilitiesRenderer(const UtilitiesState());
await tool.setup(document, assetService, page);
currentIndexCubit.unbake(tool: tool);
currentIndexCubit.loadElements(document, assetService, page);
currentIndexCubit.loadElements(current);
currentIndexCubit.init(this);
}

Expand Down
14 changes: 7 additions & 7 deletions app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -629,18 +629,19 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
backgrounds: backgrounds)));
}

Future<void> loadElements(
NoteData document, AssetService assetService, DocumentPage page,
[String currentLayer = '']) async {
Future<void> loadElements(DocumentState docState) async {
if (docState is! DocumentLoaded) return;
final document = docState.data;
final assetService = docState.assetService;
final page = docState.page;
for (var e in state.cameraViewport.unbakedElements) {
e.dispose();
}
for (var e in state.cameraViewport.bakedElements) {
e.dispose();
}
final renderers = page.content
.where(
(element) => currentLayer.isEmpty || element.layer == currentLayer)
.where((element) => !docState.invisibleLayers.contains(element.layer))
.map((e) => Renderer.fromInstance(e))
.toList();
await Future.wait(renderers
Expand Down Expand Up @@ -941,8 +942,7 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
path = await current.save(path);
}
if (reset) {
loadElements(current.data, current.assetService, current.page,
current.currentLayer);
loadElements(current);
}
if (reset || refresh) {
this.refresh(
Expand Down
3 changes: 2 additions & 1 deletion app/lib/dialogs/elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ ContextMenuBuilder buildElementsContextMenu(
child: Text(e.getLocalizedName(context)),
onPressed: () {
operations.values
.expand((e) => e.values)
.map((v) => v[e])
.whereNotNull()
.forEach((e) => e(bloc, context));
if (context.mounted) Navigator.of(context).pop(true);
},
Expand Down
4 changes: 2 additions & 2 deletions app/lib/dialogs/packs/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:material_leap/material_leap.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';

import '../../api/save.dart';
import '../../widgets/remote_button.dart';
import '../../widgets/connection_button.dart';
import 'pack.dart';

class PacksDialog extends StatefulWidget {
Expand Down Expand Up @@ -56,7 +56,7 @@ class _PacksDialogState extends State<PacksDialog>
Header(
title: Text(AppLocalizations.of(context).packs),
actions: [
RemoteButton(
ConnectionButton(
currentRemote: _fileSystem.remote?.identifier ?? '',
onChanged: (value) {
setState(() {
Expand Down
4 changes: 2 additions & 2 deletions app/lib/dialogs/template.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:butterfly/actions/new.dart';
import 'package:butterfly/cubits/settings.dart';
import 'package:butterfly/widgets/remote_button.dart';
import 'package:butterfly/widgets/connection_button.dart';
import 'package:butterfly/widgets/responsive_dialog.dart';
import 'package:butterfly_api/butterfly_api.dart';
import 'package:collection/collection.dart';
Expand Down Expand Up @@ -68,7 +68,7 @@ class _TemplateDialogState extends State<TemplateDialog> {
tooltip: AppLocalizations.of(context).close,
),
actions: [
RemoteButton(
ConnectionButton(
currentRemote: _fileSystem.remote?.identifier ?? '',
onChanged: (value) {
_fileSystem =
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_af.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stable",
"nightly": "Nightly",
"checkForUpdates": "Check for updates",
"checkForUpdatesWarning": "Performing a check for updates will connect to the Butterfly website to get the information.",
"usingLatestStable": "You are using the latest stable version",
"usingLatestNightly": "You are using the latest nightly version",
"currentVersion": "Current version",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "اسطبل",
"nightly": "ليلي",
"checkForUpdates": "التحقق من وجود تحديثات",
"checkForUpdatesWarning": "سيؤدي إجراء التحقق من التحديثات إلى الاتصال بموقع الفراشة للحصول على المعلومات.",
"usingLatestStable": "أنت تستخدم أحدث إصدار مستقر",
"usingLatestNightly": "أنت تستخدم أحدث إصدار ليلي",
"currentVersion": "الإصدار الحالي",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_ca.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stable",
"nightly": "Nightly",
"checkForUpdates": "Check for updates",
"checkForUpdatesWarning": "Performing a check for updates will connect to the Butterfly website to get the information.",
"usingLatestStable": "You are using the latest stable version",
"usingLatestNightly": "You are using the latest nightly version",
"currentVersion": "Current version",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_cs.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stabilní",
"nightly": "Noční",
"checkForUpdates": "Zkontrolovat aktualizace",
"checkForUpdatesWarning": "Kontrola aktualizací se připojí k webové stránce Butterfly pro získání informací.",
"usingLatestStable": "Používáte nejnovější stabilní verzi",
"usingLatestNightly": "Používáte nejnovější noční verzi",
"currentVersion": "Aktuální verze",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_da.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stabil",
"nightly": "Natligt",
"checkForUpdates": "Søg efter opdateringer",
"checkForUpdatesWarning": "Udførelse af en check for opdateringer vil forbinde til Butterfly hjemmeside for at få oplysningerne.",
"usingLatestStable": "Du bruger den seneste stabile version",
"usingLatestNightly": "Du bruger den seneste natlige version",
"currentVersion": "Nuværende version",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stabil",
"nightly": "Nightly",
"checkForUpdates": "Nach Updates suchen",
"checkForUpdatesWarning": "Wenn Sie nach Updates suchen, werden Sie sich mit der Butterfly-Website verbinden, um die Informationen zu erhalten.",
"usingLatestStable": "Sie verwenden die neueste stabile Version",
"usingLatestNightly": "Sie verwenden die neueste Nightly Version",
"currentVersion": "Aktuelle Version",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_el.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Σταθερό",
"nightly": "Νυχτερινή",
"checkForUpdates": "Έλεγχος ενημερώσεων",
"checkForUpdatesWarning": "Εκτελώντας έναν έλεγχο για ενημερώσεις θα συνδεθείτε στην ιστοσελίδα Butterfly για να πάρετε τις πληροφορίες.",
"usingLatestStable": "Χρησιμοποιείτε την τελευταία σταθερή έκδοση",
"usingLatestNightly": "Χρησιμοποιείτε την τελευταία νυχτερινή έκδοση",
"currentVersion": "Τρέχουσα έκδοση",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Estable",
"nightly": "Noche",
"checkForUpdates": "Buscar actualizaciones",
"checkForUpdatesWarning": "Realizar una comprobación de actualizaciones se conectará al sitio web de Butterfly para obtener la información.",
"usingLatestStable": "Estás usando la última versión estable",
"usingLatestNightly": "Estás usando la última versión nocturna",
"currentVersion": "Versión actual",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_fi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Vakaa",
"nightly": "Yöllä",
"checkForUpdates": "Tarkista päivitykset",
"checkForUpdatesWarning": "Tarkistamalla päivityksiä voit ottaa yhteyttä Butterflen verkkosivuihin saadaksesi tiedot.",
"usingLatestStable": "Käytät viimeisintä vakaata versiota",
"usingLatestNightly": "Olet käyttämässä uusinta yöllä versiota",
"currentVersion": "Nykyinen versio",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stable",
"nightly": "Nuit",
"checkForUpdates": "Vérifier les mises à jour",
"checkForUpdatesWarning": "Effectuer une vérification des mises à jour se connectera au site web Butterfly pour obtenir les informations.",
"usingLatestStable": "Vous utilisez la dernière version stable",
"usingLatestNightly": "Vous utilisez la dernière version de nightly",
"currentVersion": "Version actuelle",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_he.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stable",
"nightly": "Nightly",
"checkForUpdates": "Check for updates",
"checkForUpdatesWarning": "Performing a check for updates will connect to the Butterfly website to get the information.",
"usingLatestStable": "You are using the latest stable version",
"usingLatestNightly": "You are using the latest nightly version",
"currentVersion": "Current version",
Expand Down
1 change: 1 addition & 0 deletions app/lib/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"stable": "Stable",
"nightly": "Nightly",
"checkForUpdates": "Check for updates",
"checkForUpdatesWarning": "Performing a check for updates will connect to the Butterfly website to get the information.",
"usingLatestStable": "You are using the latest stable version",
"usingLatestNightly": "You are using the latest nightly version",
"currentVersion": "Current version",
Expand Down
Loading

0 comments on commit d7b7d5a

Please sign in to comment.