Skip to content

Commit

Permalink
Asset clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Apr 23, 2024
1 parent d5530eb commit 9748b3a
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"linux":[{"name":"path_provider_linux","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"windows":[{"name":"path_provider_windows","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"web":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"screen_retriever","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"window_manager","dependencies":["screen_retriever"]}],"date_created":"2024-04-22 19:48:01.412100","version":"3.19.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"linux":[{"name":"path_provider_linux","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"windows":[{"name":"path_provider_windows","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"screen_retriever","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/screen_retriever-0.1.9/","native_build":true,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"window_manager","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/window_manager-0.3.8/","native_build":true,"dependencies":["screen_retriever"]}],"web":[{"name":"file_picker","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/leofarias/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"screen_retriever","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"window_manager","dependencies":["screen_retriever"]}],"date_created":"2024-04-22 22:30:38.064057","version":"3.19.5"}
Binary file removed example/assets/images/sd_slide_0_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_10_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_11_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_12_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_1_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_2_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_3_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_4_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_5_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_6_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_7_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_8_thumb.png
Binary file not shown.
Binary file removed example/assets/images/sd_slide_9_thumb.png
Binary file not shown.
74 changes: 58 additions & 16 deletions lib/components/atoms/slide_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import '../../helpers/constants.dart';
import '../../helpers/slide_to_image.dart';
import '../../models/slide_model.dart';
import '../../superdeck.dart';
import '../molecules/scaled_app.dart';
import 'slide_view.dart';

final _previewStyle = AnimatedStyle(
Style(
Expand Down Expand Up @@ -124,6 +126,23 @@ class _SlideThumbnailState extends State<SlideThumbnail> {

final result = asyncState.watch(context);

final child = result.map(
data: (data) => Image.memory(
data,
gaplessPlayback: true,
),
loading: () {
return const Center(
child: CircularProgressIndicator(),
);
},
error: (error, _) {
return const Center(
child: Text('Error loading image'),
);
},
);

return GestureDetector(
onTap: widget.onTap,
child: PreviewBox(
Expand All @@ -133,25 +152,48 @@ class _SlideThumbnailState extends State<SlideThumbnail> {
child: AbsorbPointer(
child: AspectRatio(
aspectRatio: kAspectRatio,
child: result.map(
data: (data) => Image.memory(
data,
gaplessPlayback: true,
),
loading: () {
return const Center(
child: CircularProgressIndicator(),
);
},
error: (error, _) {
return const Center(
child: Text('Error loading image'),
);
},
),
child: child,
),
),
),
);
}
}

class SlideThumbnailDynamic extends StatelessWidget {
final bool selected;
final VoidCallback onTap;
final int index;
final Slide slide;

const SlideThumbnailDynamic({
super.key,
required this.selected,
required this.index,
required this.onTap,
required this.slide,
});

@override
Widget build(BuildContext context) {
final selectedColor = selected ? Colors.blue : Colors.transparent;

return GestureDetector(
onTap: onTap,
child: PreviewBox(
style: Style(
box.border.all.color(selectedColor),
),
child: AbsorbPointer(
child: AspectRatio(
aspectRatio: kAspectRatio,
child: ScaledWidget(
child: SlideView(
slide,
),
)),
),
),
);
}
}
6 changes: 2 additions & 4 deletions lib/components/molecules/slide_thumbnail_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ class _SlideThumbnailListState extends State<SlideThumbnailList> {
padding: const EdgeInsets.all(20),
itemBuilder: (context, idx) {
final slide = widget.slides[idx];
final style = SuperDeckProvider.instance.style.watch(context);
SuperDeckProvider.instance.style.watch(context);

final slideStyle = style.applyVariant(slide.styleVariant);

return SlideThumbnail(
return SlideThumbnailDynamic(
index: idx,
selected: idx == widget.currentSlide,
onTap: () => goToPage(idx),
Expand Down

0 comments on commit 9748b3a

Please sign in to comment.