diff --git a/lib/src/utils/matrix_gesture_detector.dart b/lib/src/utils/matrix_gesture_detector.dart index d8495d7..f75969a 100644 --- a/lib/src/utils/matrix_gesture_detector.dart +++ b/lib/src/utils/matrix_gesture_detector.dart @@ -123,15 +123,15 @@ class MatrixGestureDetectorState extends State { ); } - _ValueUpdater translationUpdater = _ValueUpdater( + ValueUpdater translationUpdater = ValueUpdater( value: Offset.zero, onUpdate: (oldVal, newVal) => newVal - oldVal, ); - _ValueUpdater scaleUpdater = _ValueUpdater( + ValueUpdater scaleUpdater = ValueUpdater( value: 1.0, onUpdate: (oldVal, newVal) => newVal / oldVal, ); - _ValueUpdater rotationUpdater = _ValueUpdater( + ValueUpdater rotationUpdater = ValueUpdater( value: 0.0, onUpdate: (oldVal, newVal) => newVal - oldVal, ); @@ -221,13 +221,13 @@ class MatrixGestureDetectorState extends State { } } -typedef _OnUpdate = T Function(T oldValue, T newValue); +typedef OnUpdate = T Function(T oldValue, T newValue); -class _ValueUpdater { - final _OnUpdate onUpdate; +class ValueUpdater { + final OnUpdate onUpdate; T value; - _ValueUpdater({ + ValueUpdater({ required this.value, required this.onUpdate, }); diff --git a/lib/src/views/main_control_views/filters_view.dart b/lib/src/views/main_control_views/filters_view.dart index 566a8e4..dc4aad3 100644 --- a/lib/src/views/main_control_views/filters_view.dart +++ b/lib/src/views/main_control_views/filters_view.dart @@ -7,12 +7,12 @@ import 'package:flutter_story_editor/src/theme/style.dart'; class FiltersView extends StatefulWidget { - List> selectedFilters = []; + final List> selectedFilters; final List? selectedFiles; final int currentPageIndex; final Function(List) onFilterChange; - FiltersView({super.key, this.selectedFilters = const [], this.selectedFiles, required this.currentPageIndex, required this.onFilterChange}); + const FiltersView({super.key, required this.selectedFilters, this.selectedFiles, required this.currentPageIndex, required this.onFilterChange}); @override State createState() => _FiltersViewState();