Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed May 7, 2024
1 parent 207da37 commit 2a80d56
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 89 deletions.
72 changes: 24 additions & 48 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ packages:
dependency: transitive
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 @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: barcode
sha256: "1fe4a55344505850517ce72d4a3a7b9ccf51b0dc1631ee7e552f6eacc4947f96"
sha256: ab180ce22c6555d77d45f0178a523669db67f95856e3378259ef2ffeb43e6003
url: "https://pub.dev"
source: hosted
version: "2.2.7"
version: "2.2.8"
bidi:
dependency: transitive
description:
Expand Down Expand Up @@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: cached_network_image_web
sha256: "42a835caa27c220d1294311ac409a43361088625a4f23c820b006dd9bffb3316"
sha256: "205d6a9f1862de34b93184f22b9d2d94586b2f05c581d546695e3d8f6a805cd7"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.2.0"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -113,14 +113,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.18.0"
convert:
dependency: transitive
description:
name: convert
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -189,10 +181,10 @@ packages:
dependency: transitive
description:
name: file_picker
sha256: "45c70b43df893027e441a6fa0aacc8f484fb9f9c60c746dc8f1dc4f774cf55cd"
sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a"
url: "https://pub.dev"
source: hosted
version: "8.0.2"
version: "8.0.3"
fixnum:
dependency: transitive
description:
Expand All @@ -210,10 +202,10 @@ packages:
dependency: transitive
description:
name: flutter_cache_manager
sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba"
sha256: "395d6b7831f21f3b989ebedbb785545932adb9afe2622c1ffacf7f4b53a7e544"
url: "https://pub.dev"
source: hosted
version: "3.3.1"
version: "3.3.2"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -244,10 +236,10 @@ packages:
dependency: transitive
description:
name: go_router
sha256: "771c8feb40ad0ef639973d7ecf1b43d55ffcedb2207fd43fab030f5639e40446"
sha256: b465e99ce64ba75e61c8c0ce3d87b66d8ac07f0b35d0a7e0263fcfc10f99e836
url: "https://pub.dev"
source: hosted
version: "13.2.4"
version: "13.2.5"
google_fonts:
dependency: "direct main"
description:
Expand Down Expand Up @@ -288,14 +280,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.7"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -419,10 +403,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.4"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -487,14 +471,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "70fe966348fe08c34bf929582f1d8247d9d9408130723206472b4687227e4333"
url: "https://pub.dev"
source: hosted
version: "3.8.0"
qr:
dependency: transitive
description:
Expand Down Expand Up @@ -584,18 +560,18 @@ packages:
dependency: transitive
description:
name: sqflite
sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.3.3+1"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5"
sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4"
url: "https://pub.dev"
source: hosted
version: "2.5.3"
version: "2.5.4"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -759,10 +735,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8
sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
url: "https://pub.dev"
source: hosted
version: "4.3.3"
version: "4.4.0"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -799,10 +775,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
url: "https://pub.dev"
source: hosted
version: "5.2.0"
version: "5.5.0"
window_manager:
dependency: transitive
description:
Expand Down
2 changes: 0 additions & 2 deletions lib/components/atoms/slide_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class SlideView extends StatelessWidget {

final variantStyle = style.applyVariant(variant);

sdController.dependencyKey.watch(context);

final backgroundWidget = slide.background != null
? CacheImage(
url: slide.background!,
Expand Down
9 changes: 9 additions & 0 deletions lib/components/molecules/slide_thumbnail_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ class _SlideThumbnailListState extends State<SlideThumbnailList> {

var _visibleItems = <ItemPosition>[];

@override
void didUpdateWidget(covariant SlideThumbnailList oldWidget) {
super.didUpdateWidget(oldWidget);

if (widget.currentSlide != oldWidget.currentSlide) {
goToPage(widget.currentSlide);
}
}

Future<void> goToPage(int page, {bool animate = true}) async {
if (page < 0 || page >= widget.slides.length) return;

Expand Down
2 changes: 1 addition & 1 deletion lib/components/superdeck_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class _SuperDeckAppState extends State<SuperDeckApp> {
final result = _initialize.watch(context);

return result.map(
data: (value) => child!,
data: (_) => child!,
loading: () => renderLoading(),
error: (error, _) {
return ExceptionWidget(
Expand Down
17 changes: 7 additions & 10 deletions lib/providers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:signals/signals_flutter.dart';

import '../builder/slides_loader.dart';
import '../helpers/constants.dart';
import '../helpers/utils.dart';
import '../services/project_service.dart';
import '../superdeck.dart';

Expand All @@ -29,15 +28,6 @@ class SDController {

final examples = mapSignal<String, Example>({});

late final dependencyKey = computed(() {
final variant = style.value.toString();
final previousVariant = style.previousValue.toString();
final example = examples.values.toString();
print(shortHashId(variant));
print(style.value.getDiff(style.previousValue!));
return shortHashId(variant + example);
});

late final error = computed(
() {
final data = _data.value;
Expand All @@ -55,6 +45,12 @@ class SDController {
this.examples.assign({for (var e in examples) e.name: e});
});

if (_data.isDone) {
await _data.reload();
} else {
await _data.future;
}

if (kCanRunProcess) {
SlidesLoader.instance.listen(_data.refresh);
}
Expand Down Expand Up @@ -113,6 +109,7 @@ class NavigationProvider {
}

void goToSlide(int slide) {
if (slide < 0 || slide >= sdController.slides.value.length) return;
currentSlide.value = slide;
}

Expand Down
Loading

0 comments on commit 2a80d56

Please sign in to comment.