mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Refactor: move some generic widgets out of the main package
This commit is contained in:
parent
f50d7fbf26
commit
571c88a668
34 changed files with 111 additions and 34 deletions
|
@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:nc_photos/controller/pref_controller.dart';
|
import 'package:nc_photos/controller/pref_controller.dart';
|
||||||
import 'package:nc_photos/theme/dimension.dart';
|
import 'package:nc_photos/theme/dimension.dart';
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
const defaultSeedColor = Color(0xFF2196F3);
|
const defaultSeedColor = Color(0xFF2196F3);
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ import 'package:nc_photos/use_case/create_share.dart';
|
||||||
import 'package:nc_photos/use_case/remove_share.dart';
|
import 'package:nc_photos/use_case/remove_share.dart';
|
||||||
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
||||||
import 'package:nc_photos/widget/network_thumbnail.dart';
|
import 'package:nc_photos/widget/network_thumbnail.dart';
|
||||||
import 'package:nc_photos/widget/unbounded_list_tile.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
import 'package:np_common/ci_string.dart';
|
import 'package:np_common/ci_string.dart';
|
||||||
import 'package:np_common/string_extension.dart';
|
import 'package:np_common/string_extension.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
part 'album_share_outlier_browser.g.dart';
|
part 'album_share_outlier_browser.g.dart';
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ import 'package:nc_photos/use_case/archive_file.dart';
|
||||||
import 'package:nc_photos/use_case/inflate_file_descriptor.dart';
|
import 'package:nc_photos/use_case/inflate_file_descriptor.dart';
|
||||||
import 'package:nc_photos/use_case/remove.dart';
|
import 'package:nc_photos/use_case/remove.dart';
|
||||||
import 'package:nc_photos/widget/album_share_outlier_browser.dart';
|
import 'package:nc_photos/widget/album_share_outlier_browser.dart';
|
||||||
import 'package:nc_photos/widget/asset_icon.dart';
|
|
||||||
import 'package:nc_photos/widget/collection_picker.dart';
|
import 'package:nc_photos/widget/collection_picker.dart';
|
||||||
import 'package:nc_photos/widget/draggable_item_list.dart';
|
import 'package:nc_photos/widget/draggable_item_list.dart';
|
||||||
import 'package:nc_photos/widget/export_collection_dialog.dart';
|
import 'package:nc_photos/widget/export_collection_dialog.dart';
|
||||||
|
@ -63,6 +62,7 @@ import 'package:nc_photos/widget/shared_album_info_dialog.dart';
|
||||||
import 'package:nc_photos/widget/simple_input_dialog.dart';
|
import 'package:nc_photos/widget/simple_input_dialog.dart';
|
||||||
import 'package:nc_photos/widget/viewer.dart';
|
import 'package:nc_photos/widget/viewer.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:sliver_tools/sliver_tools.dart';
|
import 'package:sliver_tools/sliver_tools.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@ import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/np_api_util.dart';
|
import 'package:nc_photos/np_api_util.dart';
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
import 'package:nc_photos/widget/app_bar_circular_progress_indicator.dart';
|
|
||||||
import 'package:nc_photos/widget/collection_grid_item.dart';
|
import 'package:nc_photos/widget/collection_grid_item.dart';
|
||||||
import 'package:nc_photos/widget/new_collection_dialog.dart';
|
import 'package:nc_photos/widget/new_collection_dialog.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
part 'collection_picker.g.dart';
|
part 'collection_picker.g.dart';
|
||||||
|
|
|
@ -13,8 +13,8 @@ import 'package:nc_photos/entity/file_util.dart' as file_util;
|
||||||
import 'package:nc_photos/exception_util.dart' as exception_util;
|
import 'package:nc_photos/exception_util.dart' as exception_util;
|
||||||
import 'package:nc_photos/k.dart' as k;
|
import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:path/path.dart' as path_lib;
|
import 'package:path/path.dart' as path_lib;
|
||||||
|
|
||||||
part 'dir_picker.g.dart';
|
part 'dir_picker.g.dart';
|
||||||
|
|
|
@ -7,9 +7,8 @@ import 'package:nc_photos/controller/account_controller.dart';
|
||||||
import 'package:nc_photos/stream_util.dart';
|
import 'package:nc_photos/stream_util.dart';
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
import 'package:nc_photos/widget/account_picker_dialog.dart';
|
import 'package:nc_photos/widget/account_picker_dialog.dart';
|
||||||
import 'package:nc_photos/widget/app_bar_circular_progress_indicator.dart';
|
|
||||||
import 'package:nc_photos/widget/app_bar_title_container.dart';
|
|
||||||
import 'package:nc_photos/widget/translucent_sliver_app_bar.dart';
|
import 'package:nc_photos/widget/translucent_sliver_app_bar.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
/// AppBar for home screens
|
/// AppBar for home screens
|
||||||
class HomeSliverAppBar extends StatelessWidget {
|
class HomeSliverAppBar extends StatelessWidget {
|
||||||
|
|
|
@ -24,7 +24,6 @@ import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
import 'package:nc_photos/theme/dimension.dart';
|
import 'package:nc_photos/theme/dimension.dart';
|
||||||
import 'package:nc_photos/throttler.dart';
|
import 'package:nc_photos/throttler.dart';
|
||||||
import 'package:nc_photos/widget/animated_visibility.dart';
|
|
||||||
import 'package:nc_photos/widget/builder/photo_list_item_builder.dart';
|
import 'package:nc_photos/widget/builder/photo_list_item_builder.dart';
|
||||||
import 'package:nc_photos/widget/handler/add_selection_to_collection_handler.dart';
|
import 'package:nc_photos/widget/handler/add_selection_to_collection_handler.dart';
|
||||||
import 'package:nc_photos/widget/handler/archive_selection_handler.dart';
|
import 'package:nc_photos/widget/handler/archive_selection_handler.dart';
|
||||||
|
@ -39,6 +38,7 @@ import 'package:nc_photos/widget/selectable_item_stream_list_mixin.dart';
|
||||||
import 'package:nc_photos/widget/selection_app_bar.dart';
|
import 'package:nc_photos/widget/selection_app_bar.dart';
|
||||||
import 'package:nc_photos/widget/viewer.dart';
|
import 'package:nc_photos/widget/viewer.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
part 'home_search.g.dart';
|
part 'home_search.g.dart';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import 'package:nc_photos/np_api_util.dart';
|
||||||
import 'package:nc_photos/object_extension.dart';
|
import 'package:nc_photos/object_extension.dart';
|
||||||
import 'package:nc_photos/pixel_image_provider.dart';
|
import 'package:nc_photos/pixel_image_provider.dart';
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
|
||||||
import 'package:nc_photos/url_launcher_util.dart';
|
import 'package:nc_photos/url_launcher_util.dart';
|
||||||
import 'package:nc_photos/widget/handler/permission_handler.dart';
|
import 'package:nc_photos/widget/handler/permission_handler.dart';
|
||||||
import 'package:nc_photos/widget/image_editor/color_toolbar.dart';
|
import 'package:nc_photos/widget/image_editor/color_toolbar.dart';
|
||||||
|
@ -24,6 +23,7 @@ import 'package:nc_photos/widget/image_editor/crop_controller.dart';
|
||||||
import 'package:nc_photos/widget/image_editor/transform_toolbar.dart';
|
import 'package:nc_photos/widget/image_editor/transform_toolbar.dart';
|
||||||
import 'package:nc_photos/widget/image_editor_persist_option_dialog.dart';
|
import 'package:nc_photos/widget/image_editor_persist_option_dialog.dart';
|
||||||
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
class ImageEditorArguments {
|
class ImageEditorArguments {
|
||||||
const ImageEditorArguments(this.account, this.file);
|
const ImageEditorArguments(this.account, this.file);
|
||||||
|
|
|
@ -4,8 +4,8 @@ import 'package:nc_photos/double_extension.dart';
|
||||||
import 'package:nc_photos/iterable_extension.dart';
|
import 'package:nc_photos/iterable_extension.dart';
|
||||||
import 'package:nc_photos/object_extension.dart';
|
import 'package:nc_photos/object_extension.dart';
|
||||||
import 'package:nc_photos/widget/image_editor/toolbar_button.dart';
|
import 'package:nc_photos/widget/image_editor/toolbar_button.dart';
|
||||||
import 'package:nc_photos/widget/stateful_slider.dart';
|
|
||||||
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
enum ColorToolType {
|
enum ColorToolType {
|
||||||
brightness,
|
brightness,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:nc_photos/k.dart' as k;
|
import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
/// Button in the image editor toolbar
|
/// Button in the image editor toolbar
|
||||||
///
|
///
|
||||||
|
|
|
@ -28,9 +28,9 @@ import 'package:nc_photos/widget/handler/permission_handler.dart';
|
||||||
import 'package:nc_photos/widget/image_editor_persist_option_dialog.dart';
|
import 'package:nc_photos/widget/image_editor_persist_option_dialog.dart';
|
||||||
import 'package:nc_photos/widget/selectable.dart';
|
import 'package:nc_photos/widget/selectable.dart';
|
||||||
import 'package:nc_photos/widget/settings/enhancement_settings.dart';
|
import 'package:nc_photos/widget/settings/enhancement_settings.dart';
|
||||||
import 'package:nc_photos/widget/stateful_slider.dart';
|
|
||||||
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
import 'package:nc_photos_plugin/nc_photos_plugin.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
part 'image_enhancer.g.dart';
|
part 'image_enhancer.g.dart';
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/size.dart';
|
import 'package:nc_photos/size.dart';
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
||||||
import 'package:nc_photos/widget/stateful_slider.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ import 'package:nc_photos/exception_util.dart' as exception_util;
|
||||||
import 'package:nc_photos/k.dart' as k;
|
import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
||||||
import 'package:nc_photos/widget/stateful_slider.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
part 'photos/bloc.dart';
|
part 'photos/bloc.dart';
|
||||||
|
|
|
@ -13,8 +13,8 @@ import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/widget/fancy_option_picker.dart';
|
import 'package:nc_photos/widget/fancy_option_picker.dart';
|
||||||
import 'package:nc_photos/widget/gps_map.dart';
|
import 'package:nc_photos/widget/gps_map.dart';
|
||||||
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
import 'package:nc_photos/widget/page_visibility_mixin.dart';
|
||||||
import 'package:nc_photos/widget/stateful_slider.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:screen_brightness/screen_brightness.dart';
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ import 'package:nc_photos/widget/collection_browser.dart';
|
||||||
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
import 'package:nc_photos/widget/empty_list_indicator.dart';
|
||||||
import 'package:nc_photos/widget/network_thumbnail.dart';
|
import 'package:nc_photos/widget/network_thumbnail.dart';
|
||||||
import 'package:nc_photos/widget/shared_file_viewer.dart';
|
import 'package:nc_photos/widget/shared_file_viewer.dart';
|
||||||
import 'package:nc_photos/widget/unbounded_list_tile.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
part 'sharing_browser.g.dart';
|
part 'sharing_browser.g.dart';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import 'package:nc_photos/app_localizations.dart';
|
||||||
import 'package:nc_photos/k.dart' as k;
|
import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/num_extension.dart';
|
import 'package:nc_photos/num_extension.dart';
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/widget/switch_form_field.dart';
|
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
part 'slideshow_dialog.g.dart';
|
part 'slideshow_dialog.g.dart';
|
||||||
|
|
|
@ -8,7 +8,6 @@ import 'package:nc_photos/entity/file_descriptor.dart';
|
||||||
import 'package:nc_photos/entity/file_util.dart' as file_util;
|
import 'package:nc_photos/entity/file_util.dart' as file_util;
|
||||||
import 'package:nc_photos/k.dart' as k;
|
import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
import 'package:nc_photos/widget/animated_visibility.dart';
|
|
||||||
import 'package:nc_photos/widget/disposable.dart';
|
import 'package:nc_photos/widget/disposable.dart';
|
||||||
import 'package:nc_photos/widget/horizontal_page_viewer.dart';
|
import 'package:nc_photos/widget/horizontal_page_viewer.dart';
|
||||||
import 'package:nc_photos/widget/image_viewer.dart';
|
import 'package:nc_photos/widget/image_viewer.dart';
|
||||||
|
@ -17,6 +16,7 @@ import 'package:nc_photos/widget/video_viewer.dart';
|
||||||
import 'package:nc_photos/widget/viewer_mixin.dart';
|
import 'package:nc_photos/widget/viewer_mixin.dart';
|
||||||
import 'package:nc_photos/widget/wakelock_util.dart';
|
import 'package:nc_photos/widget/wakelock_util.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
|
|
||||||
part 'slideshow_viewer.g.dart';
|
part 'slideshow_viewer.g.dart';
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ import 'package:nc_photos/np_api_util.dart';
|
||||||
import 'package:nc_photos/platform/k.dart' as platform_k;
|
import 'package:nc_photos/platform/k.dart' as platform_k;
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/use_case/request_public_link.dart';
|
import 'package:nc_photos/use_case/request_public_link.dart';
|
||||||
import 'package:nc_photos/widget/animated_visibility.dart';
|
|
||||||
import 'package:nc_photos/widget/disposable.dart';
|
import 'package:nc_photos/widget/disposable.dart';
|
||||||
import 'package:nc_photos/widget/wakelock_util.dart';
|
import 'package:nc_photos/widget/wakelock_util.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
|
|
||||||
part 'video_viewer.g.dart';
|
part 'video_viewer.g.dart';
|
||||||
|
|
|
@ -32,12 +32,12 @@ import 'package:nc_photos/use_case/inflate_file_descriptor.dart';
|
||||||
import 'package:nc_photos/use_case/list_file_tag.dart';
|
import 'package:nc_photos/use_case/list_file_tag.dart';
|
||||||
import 'package:nc_photos/use_case/update_property.dart';
|
import 'package:nc_photos/use_case/update_property.dart';
|
||||||
import 'package:nc_photos/widget/about_geocoding_dialog.dart';
|
import 'package:nc_photos/widget/about_geocoding_dialog.dart';
|
||||||
import 'package:nc_photos/widget/animated_visibility.dart';
|
|
||||||
import 'package:nc_photos/widget/gps_map.dart';
|
import 'package:nc_photos/widget/gps_map.dart';
|
||||||
import 'package:nc_photos/widget/handler/add_selection_to_collection_handler.dart';
|
import 'package:nc_photos/widget/handler/add_selection_to_collection_handler.dart';
|
||||||
import 'package:nc_photos/widget/list_tile_center_leading.dart';
|
import 'package:nc_photos/widget/list_tile_center_leading.dart';
|
||||||
import 'package:nc_photos/widget/photo_date_time_edit_dialog.dart';
|
import 'package:nc_photos/widget/photo_date_time_edit_dialog.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
|
import 'package:np_ui/np_ui.dart';
|
||||||
import 'package:path/path.dart' as path_lib;
|
import 'package:path/path.dart' as path_lib;
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
|
|
|
@ -983,6 +983,13 @@ packages:
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
np_ui:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "../np_ui"
|
||||||
|
relative: true
|
||||||
|
source: path
|
||||||
|
version: "0.0.1"
|
||||||
octo_image:
|
octo_image:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -105,6 +105,8 @@ dependencies:
|
||||||
path: ../np_common
|
path: ../np_common
|
||||||
np_log:
|
np_log:
|
||||||
path: ../np_log
|
path: ../np_log
|
||||||
|
np_ui:
|
||||||
|
path: ../np_ui
|
||||||
octo_image: any
|
octo_image: any
|
||||||
page_view_indicators: ^2.0.0
|
page_view_indicators: ^2.0.0
|
||||||
path: ^1.8.0
|
path: ^1.8.0
|
||||||
|
|
30
np_ui/.gitignore
vendored
Normal file
30
np_ui/.gitignore
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Miscellaneous
|
||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
*.pyc
|
||||||
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.buildlog/
|
||||||
|
.history
|
||||||
|
.svn/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
|
# IntelliJ related
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
|
|
||||||
|
# Flutter/Dart/Pub related
|
||||||
|
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||||
|
/pubspec.lock
|
||||||
|
**/doc/api/
|
||||||
|
.dart_tool/
|
||||||
|
.packages
|
||||||
|
build/
|
10
np_ui/.metadata
Normal file
10
np_ui/.metadata
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
|
||||||
|
channel: stable
|
||||||
|
|
||||||
|
project_type: package
|
1
np_ui/analysis_options.yaml
Normal file
1
np_ui/analysis_options.yaml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
include: package:np_lints/np.yaml
|
10
np_ui/lib/np_ui.dart
Normal file
10
np_ui/lib/np_ui.dart
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
library np_ui;
|
||||||
|
|
||||||
|
export 'src/animated_visibility.dart';
|
||||||
|
export 'src/app_bar_circular_progress_indicator.dart';
|
||||||
|
export 'src/app_bar_title_container.dart';
|
||||||
|
export 'src/asset_icon.dart';
|
||||||
|
export 'src/material3.dart';
|
||||||
|
export 'src/stateful_slider.dart';
|
||||||
|
export 'src/switch_form_field.dart';
|
||||||
|
export 'src/unbounded_list_tile.dart';
|
|
@ -5,18 +5,17 @@ import 'package:flutter/widgets.dart';
|
||||||
/// The point is to disable non-visible buttons
|
/// The point is to disable non-visible buttons
|
||||||
class AnimatedVisibility extends StatefulWidget {
|
class AnimatedVisibility extends StatefulWidget {
|
||||||
const AnimatedVisibility({
|
const AnimatedVisibility({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.opacity,
|
required this.opacity,
|
||||||
this.curve = Curves.linear,
|
this.curve = Curves.linear,
|
||||||
required this.duration,
|
required this.duration,
|
||||||
this.onEnd,
|
this.onEnd,
|
||||||
this.alwaysIncludeSemantics = false,
|
this.alwaysIncludeSemantics = false,
|
||||||
}) : assert(opacity >= 0.0 && opacity <= 1.0),
|
}) : assert(opacity >= 0.0 && opacity <= 1.0);
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
createState() => _AnimatedVisibilityState();
|
State<StatefulWidget> createState() => _AnimatedVisibilityState();
|
||||||
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final double opacity;
|
final double opacity;
|
||||||
|
@ -28,13 +27,13 @@ class AnimatedVisibility extends StatefulWidget {
|
||||||
|
|
||||||
class _AnimatedVisibilityState extends State<AnimatedVisibility> {
|
class _AnimatedVisibilityState extends State<AnimatedVisibility> {
|
||||||
@override
|
@override
|
||||||
initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_isActive = widget.opacity > 0;
|
_isActive = widget.opacity > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (!_isActive && widget.opacity > 0) {
|
if (!_isActive && widget.opacity > 0) {
|
||||||
_isActive = true;
|
_isActive = true;
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
import 'package:np_ui/src/material3.dart';
|
||||||
|
|
||||||
/// App bar title with optional subtitle and leading icon
|
/// App bar title with optional subtitle and leading icon
|
||||||
class AppBarTitleContainer extends StatelessWidget {
|
class AppBarTitleContainer extends StatelessWidget {
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// Icon using an image in asset
|
||||||
class AssetIcon extends StatelessWidget {
|
class AssetIcon extends StatelessWidget {
|
||||||
const AssetIcon(
|
const AssetIcon(
|
||||||
this.assetName, {
|
this.assetName, {
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// Material 3 theming support to provide features not yet supported natively
|
||||||
|
/// in Flutter
|
||||||
class M3 extends ThemeExtension<M3> {
|
class M3 extends ThemeExtension<M3> {
|
||||||
const M3({
|
const M3({
|
||||||
required this.checkbox,
|
required this.checkbox,
|
|
@ -3,16 +3,16 @@ import 'package:flutter/material.dart';
|
||||||
/// Slider with state
|
/// Slider with state
|
||||||
class StatefulSlider extends StatefulWidget {
|
class StatefulSlider extends StatefulWidget {
|
||||||
const StatefulSlider({
|
const StatefulSlider({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.initialValue,
|
required this.initialValue,
|
||||||
this.min = 0.0,
|
this.min = 0.0,
|
||||||
this.max = 1.0,
|
this.max = 1.0,
|
||||||
this.divisions,
|
this.divisions,
|
||||||
this.onChangeEnd,
|
this.onChangeEnd,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
createState() => _StatefulSliderState();
|
State<StatefulWidget> createState() => _StatefulSliderState();
|
||||||
|
|
||||||
final double initialValue;
|
final double initialValue;
|
||||||
final double min;
|
final double min;
|
||||||
|
@ -23,13 +23,13 @@ class StatefulSlider extends StatefulWidget {
|
||||||
|
|
||||||
class _StatefulSliderState extends State<StatefulSlider> {
|
class _StatefulSliderState extends State<StatefulSlider> {
|
||||||
@override
|
@override
|
||||||
initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_value = widget.initialValue;
|
_value = widget.initialValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Slider(
|
return Slider(
|
||||||
value: _value,
|
value: _value,
|
||||||
min: widget.min,
|
min: widget.min,
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:nc_photos/theme/material3.dart';
|
import 'package:np_ui/src/material3.dart';
|
||||||
|
|
||||||
/// A [ListTile]-like widget with unbounded height
|
/// A [ListTile]-like widget with unbounded height
|
||||||
class UnboundedListTile extends StatelessWidget {
|
class UnboundedListTile extends StatelessWidget {
|
||||||
|
@ -13,7 +13,7 @@ class UnboundedListTile extends StatelessWidget {
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final content = Padding(
|
final content = Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
16
np_ui/pubspec.yaml
Normal file
16
np_ui/pubspec.yaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
name: np_ui
|
||||||
|
description: Generic UI widgets and theming support package
|
||||||
|
version: 0.0.1
|
||||||
|
publish_to: none
|
||||||
|
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.19.6 <3.0.0'
|
||||||
|
flutter: ">=3.3.0"
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
flutter:
|
||||||
|
sdk: flutter
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
np_lints:
|
||||||
|
path: ../np_lints
|
Loading…
Reference in a new issue