diff --git a/README.md b/README.md index 46331df1..0cda58df 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ Components are always prefixed with `ImpaktfullUi` to avoid conflicts with other - ImpaktfullUiNetworkImage - ImpaktfullUiNotification - ImpaktfullUiNotificationBadge +- ImpaktfullUiPagination +- ImpaktfullUiRefreshIndicator - ImpaktfullUiSideNavigation - ImpaktfullUiSideNavigationItem - ImpaktfullUiSnackyConfigurator @@ -84,21 +86,20 @@ Components are always prefixed with `ImpaktfullUi` to avoid conflicts with other Many more to come in the future, always with the focus on minimizing maintenance and maximizing a recognizable UI/brand for impaktfull -- ImpaktfullDatePicker -- ImpaktfullDateTimePicker -- ImpaktfullDateTimePickerDialog -- ImpaktfullDateTimeRangePicker -- ImpaktfullListItemTitle -- ImpaktfullNavBar -- ImpaktfullPagination -- ImpaktfullRadioButtonListItem -- ImpaktfullScreen -- ImpaktfullSelectableListItem -- ImpaktfullSeparatedColumn -- ImpaktfullSwitchListItem -- ImpaktfullTabBar -- ImpaktfullTabBarItem -- ImpaktfullTimePicker +- ImpaktfullUiDatePicker +- ImpaktfullUiDateTimePicker +- ImpaktfullUiDateTimePickerDialog +- ImpaktfullUiDateTimeRangePicker +- ImpaktfullUiListItemTitle +- ImpaktfullUiNavBar +- ImpaktfullUiRadioButtonListItem +- ImpaktfullUiScreen +- ImpaktfullUiSelectableListItem +- ImpaktfullUiSeparatedColumn +- ImpaktfullUiSwitchListItem +- ImpaktfullUiTabBar +- ImpaktfullUiTabBarItem +- ImpaktfullUiTimePicker ### Theming @@ -125,6 +126,9 @@ These icons can be overriden in the theme itself. By adding your own IconData. - add - arrowLeft +- arrowRight +- arrowUp +- arrowDown - check - chevronDown - chevronLeft diff --git a/example/lib/src/component_library/components/pagination/pagination_library_item.dart b/example/lib/src/component_library/components/pagination/pagination_library_item.dart new file mode 100644 index 00000000..3f60b008 --- /dev/null +++ b/example/lib/src/component_library/components/pagination/pagination_library_item.dart @@ -0,0 +1,39 @@ +import 'package:impaktfull_ui_example/src/component_library/components/pagination/pagination_library_variant.dart'; +import 'package:impaktfull_ui_example/src/component_library/config/component_library_inputs.dart'; +import 'package:impaktfull_ui_example/src/component_library/config/component_library_item.dart'; +import 'package:impaktfull_ui_example/src/component_library/inputs/component_library_int_input.dart'; + +class PaginationLibraryItem extends ComponentLibraryItem { + const PaginationLibraryItem(); + + @override + String get title => 'ImpaktfullUiPagination'; + + @override + List getComponentVariants() { + return [ + const PaginationLibraryVariant(), + ]; + } +} + +class PaginationLibraryInputs extends ComponentLibraryInputs { + final ComponentLibraryIntInput page = ComponentLibraryIntInput( + 'Page', + initialValue: 1, + ); + final ComponentLibraryIntInput amountOfItems = ComponentLibraryIntInput( + 'amountOfItems', + initialValue: 55, + ); + final ComponentLibraryIntInput itemsPerPage = ComponentLibraryIntInput( + 'itemsPerPage', + initialValue: 10, + ); + @override + List buildInputItems() => [ + itemsPerPage, + amountOfItems, + page, + ]; +} diff --git a/example/lib/src/component_library/components/pagination/pagination_library_variant.dart b/example/lib/src/component_library/components/pagination/pagination_library_variant.dart new file mode 100644 index 00000000..c4c8dcc5 --- /dev/null +++ b/example/lib/src/component_library/components/pagination/pagination_library_variant.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:impaktfull_ui_2/impaktfull_ui.dart'; +import 'package:impaktfull_ui_example/src/component_library/components/pagination/pagination_library_item.dart'; +import 'package:impaktfull_ui_example/src/component_library/config/component_library_item.dart'; + +class PaginationLibraryVariant extends ComponentLibraryVariant { + const PaginationLibraryVariant(); + + @override + String get title => 'Default'; + + @override + List build(BuildContext context, PaginationLibraryPrimaryInputs inputs) { + return [ + ImpaktfullUiPagination( + amountOfItems: inputs.amountOfItems.value ?? 0, + itemsPerPage: inputs.itemsPerPage.value ?? 0, + page: inputs.page.value ?? 0, + onLoadPage: (page) { + inputs.page.updateState(page); + ImpaktfullUiNotification.show(title: 'Load page $page'); + }, + ), + ]; + } + + @override + PaginationLibraryPrimaryInputs inputs() => PaginationLibraryPrimaryInputs(); +} + +class PaginationLibraryPrimaryInputs extends PaginationLibraryInputs {} diff --git a/example/lib/src/component_library/config/component_library.dart b/example/lib/src/component_library/config/component_library.dart index 71f4be12..8a8ce2e4 100644 --- a/example/lib/src/component_library/config/component_library.dart +++ b/example/lib/src/component_library/config/component_library.dart @@ -21,6 +21,7 @@ import 'package:impaktfull_ui_example/src/component_library/components/loading_i import 'package:impaktfull_ui_example/src/component_library/components/modal/modal_library_item.dart'; import 'package:impaktfull_ui_example/src/component_library/components/notification/notification_library_item.dart'; import 'package:impaktfull_ui_example/src/component_library/components/notification_badge/notification_badge_library_item.dart'; +import 'package:impaktfull_ui_example/src/component_library/components/pagination/pagination_library_item.dart'; import 'package:impaktfull_ui_example/src/component_library/components/refreshindicator/refreshindicator_library_item.dart'; import 'package:impaktfull_ui_example/src/component_library/components/sidebar_navigation/sidebar_navigation_library_item.dart'; import 'package:impaktfull_ui_example/src/component_library/components/simple_list_item/simple_list_item_library_item.dart'; @@ -57,6 +58,7 @@ class ComponentLibrary { const ModalLibraryItem(), const NotificationLibraryItem(), const NotificationBadgeLibraryItem(), + const PaginationLibraryItem(), const RefreshIndicatorLibraryItem(), const SidebarNavigationLibraryItem(), const SidebarNavigationItemLibraryItem(), diff --git a/lib/impaktfull_ui.dart b/lib/impaktfull_ui.dart index 565f2c6a..84b4b406 100644 --- a/lib/impaktfull_ui.dart +++ b/lib/impaktfull_ui.dart @@ -27,6 +27,7 @@ export 'src/components/modal/modal.dart'; export 'src/components/network_image/network_image.dart'; export 'src/components/notification/notification.dart'; export 'src/components/notification_badge/notification_badge.dart'; +export 'src/components/pagination/pagination.dart'; export 'src/components/refresh_indicator/refresh_indicator.dart'; export 'src/components/sidebar_navigation/sidebar_navigation.dart'; export 'src/components/sidebar_navigation_item/sidebar_navigation_item.dart'; diff --git a/lib/src/components/button/button.dart b/lib/src/components/button/button.dart index c02f6be5..b1b8bfbd 100644 --- a/lib/src/components/button/button.dart +++ b/lib/src/components/button/button.dart @@ -58,96 +58,95 @@ class _ImpaktfullUiButtonState extends State { bool get hasOnTap => widget.onTap != null || widget.onAsyncTap != null; @override Widget build(BuildContext context) { - final iconSize = _getIconSize(); return ImpaktfullUiComponentThemeBuidler( overrideComponentTheme: widget.theme, builder: (context, theme, componentTheme) { + final iconSize = _getIconSize(); final textStyle = _getTextStyle(componentTheme); final color = textStyle?.color; final backgroundColor = _getBackgroundColor(componentTheme); final borderColor = _getBorderColor(componentTheme); - return ImpaktfullUiTouchFeedback( - color: backgroundColor, - borderRadius: componentTheme.dimens.borderRadius, - border: borderColor == null - ? null - : Border.all( - color: borderColor, - width: 1, - strokeAlign: BorderSide.strokeAlignInside, + final isClickable = widget.onTap != null || widget.onAsyncTap != null; + return Opacity( + opacity: isClickable ? 1 : 0.5, + child: ImpaktfullUiTouchFeedback( + color: backgroundColor, + borderRadius: componentTheme.dimens.borderRadius, + border: borderColor == null + ? null + : Border.all( + color: borderColor, + width: 1, + strokeAlign: BorderSide.strokeAlignInside, + ), + onTap: isClickable ? _onTap : null, + child: Stack( + alignment: Alignment.center, + children: [ + Opacity( + opacity: _isLoading ? 0 : 1, + child: Padding( + padding: _getPadding(componentTheme), + child: ImpaktfullUiAutoLayout.horizontal( + mainAxisSize: widget.fullWidth ? MainAxisSize.max : MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 4, + children: [ + if (widget.leadingChild != null) ...[ + widget.leadingChild!, + ], + if (widget.leadingIcon != null) ...[ + ImpaktfullUiAssetWidget( + asset: widget.leadingIcon, + color: color, + size: iconSize, + ), + ], + if (widget.title != null) ...[ + Expanded( + flex: widget.fullWidth ? 1 : 0, + child: Text( + widget.title!, + textAlign: TextAlign.center, + style: textStyle, + ), + ), + ], + if (widget.trailingIcon != null) ...[ + ImpaktfullUiAssetWidget( + asset: widget.trailingIcon, + color: color, + size: iconSize, + ), + ], + if (widget.trailingChild != null) ...[ + widget.trailingChild!, + ], + ], + ), + ), ), - onTap: - widget.onTap == null && widget.onAsyncTap == null ? null : _onTap, - child: Stack( - alignment: Alignment.center, - children: [ - Opacity( - opacity: _isLoading ? 0 : 1, - child: Padding( - padding: _getPadding(componentTheme), + AnimatedOpacity( + opacity: _isLoading ? 1 : 0, + duration: theme.durations.short, + curve: Curves.easeInOut, child: ImpaktfullUiAutoLayout.horizontal( - mainAxisSize: - widget.fullWidth ? MainAxisSize.max : MainAxisSize.min, + mainAxisSize: widget.fullWidth ? MainAxisSize.max : MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, spacing: 4, children: [ - if (widget.leadingChild != null) ...[ - widget.leadingChild!, - ], - if (widget.leadingIcon != null) ...[ - ImpaktfullUiAssetWidget( - asset: widget.leadingIcon, - color: color, - size: iconSize, + Expanded( + flex: widget.fullWidth ? 1 : 0, + child: SizedBox( + height: _getLoadingSize(), + child: _isLoading ? ImpaktfullUiLoadingIndicator(color: color) : const SizedBox(), ), - ], - if (widget.title != null) ...[ - Expanded( - flex: widget.fullWidth ? 1 : 0, - child: Text( - widget.title!, - textAlign: TextAlign.center, - style: textStyle, - ), - ), - ], - if (widget.trailingIcon != null) ...[ - ImpaktfullUiAssetWidget( - asset: widget.trailingIcon, - color: color, - size: iconSize, - ), - ], - if (widget.trailingChild != null) ...[ - widget.trailingChild!, - ], + ), ], ), ), - ), - AnimatedOpacity( - opacity: _isLoading ? 1 : 0, - duration: theme.durations.short, - curve: Curves.easeInOut, - child: ImpaktfullUiAutoLayout.horizontal( - mainAxisSize: - widget.fullWidth ? MainAxisSize.max : MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - spacing: 4, - children: [ - Expanded( - flex: widget.fullWidth ? 1 : 0, - child: SizedBox( - height: _getLoadingSize(), - child: _isLoading - ? ImpaktfullUiLoadingIndicator(color: color) - : const SizedBox(), - ), - ), - ], - ), - ), - ], + ], + ), ), ); }, diff --git a/lib/src/components/pagination/pagination.dart b/lib/src/components/pagination/pagination.dart new file mode 100644 index 00000000..0f7b03e3 --- /dev/null +++ b/lib/src/components/pagination/pagination.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; +import 'package:impaktfull_ui_2/src/components/auto_layout/auto_layout.dart'; +import 'package:impaktfull_ui_2/src/components/button/button.dart'; +import 'package:impaktfull_ui_2/src/components/pagination/pagination_style.dart'; +import 'package:impaktfull_ui_2/src/components/theme/theme_component_builder.dart'; +import 'package:impaktfull_ui_2/src/util/descriptor/component_descriptor_mixin.dart'; + +export 'pagination_style.dart'; + +part 'pagination.describe.dart'; + +class ImpaktfullUiPagination extends StatelessWidget with ComponentDescriptorMixin { + final int page; + final int itemsPerPage; + final int amountOfItems; + final ValueChanged onLoadPage; + final ImpaktfullUiPaginationTheme? theme; + + int get amountOfPages => (amountOfItems / itemsPerPage).ceil(); + bool get isFinalPage => page == amountOfPages; + + const ImpaktfullUiPagination({ + required this.page, + required this.itemsPerPage, + required this.amountOfItems, + required this.onLoadPage, + this.theme, + super.key, + }); + + @override + Widget build(BuildContext context) { + return ImpaktfullUiComponentThemeBuidler( + overrideComponentTheme: theme, + builder: (context, theme, componentTheme) => ImpaktfullUiAutoLayout.horizontal( + spacing: 8, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ImpaktfullUiButton( + type: ImpaktfullUiButtonType.secondaryGrey, + leadingIcon: componentTheme.assets.arrowLeft, + onTap: page == 1 ? null : () => onLoadPage(page - 1), + ), + Expanded( + child: Text( + 'Page $page of $amountOfPages', + style: componentTheme.textStyles.text, + textAlign: TextAlign.center, + ), + ), + ImpaktfullUiButton( + type: ImpaktfullUiButtonType.secondaryGrey, + leadingIcon: componentTheme.assets.arrowRight, + onTap: isFinalPage ? null : () => onLoadPage(page + 1), + ), + ], + ), + ); + } + + @override + String describe(BuildContext context) => _describeInstance(context, this); +} diff --git a/lib/src/components/pagination/pagination.describe.dart b/lib/src/components/pagination/pagination.describe.dart new file mode 100644 index 00000000..61e33c83 --- /dev/null +++ b/lib/src/components/pagination/pagination.describe.dart @@ -0,0 +1,7 @@ +part of 'pagination.dart'; + +String _describeInstance(BuildContext context, ImpaktfullUiPagination instance) { + final descriptor = ComponentDescriptor(); + descriptor.add('theme', instance.theme); + return descriptor.describe(); +} \ No newline at end of file diff --git a/lib/src/components/pagination/pagination_style.dart b/lib/src/components/pagination/pagination_style.dart new file mode 100644 index 00000000..dde5e27b --- /dev/null +++ b/lib/src/components/pagination/pagination_style.dart @@ -0,0 +1,44 @@ +import 'package:flutter/widgets.dart'; +import 'package:impaktfull_ui_2/src/models/asset.dart'; +import 'package:impaktfull_ui_2/src/theme/theme.dart'; + +class ImpaktfullUiPaginationTheme extends ImpaktfullUiComponentTheme { + final ImpaktfullUiPaginationAssetsTheme assets; + final ImpaktfullUiPaginationColorTheme colors; + final ImpaktfullUiPaginationDimensTheme dimens; + final ImpaktfullUiPaginationTextStyleTheme textStyles; + + const ImpaktfullUiPaginationTheme({ + required this.assets, + required this.colors, + required this.dimens, + required this.textStyles, + }); + + static ImpaktfullUiPaginationTheme of(BuildContext context) => ImpaktfullUiTheme.of(context).components.pagination; +} + +class ImpaktfullUiPaginationAssetsTheme { + final ImpaktfullUiAsset arrowLeft; + final ImpaktfullUiAsset arrowRight; + const ImpaktfullUiPaginationAssetsTheme({ + required this.arrowLeft, + required this.arrowRight, + }); +} + +class ImpaktfullUiPaginationColorTheme { + const ImpaktfullUiPaginationColorTheme(); +} + +class ImpaktfullUiPaginationDimensTheme { + const ImpaktfullUiPaginationDimensTheme(); +} + +class ImpaktfullUiPaginationTextStyleTheme { + final TextStyle text; + + const ImpaktfullUiPaginationTextStyleTheme({ + required this.text, + }); +} diff --git a/lib/src/components/touch_feedback/touch_feedback.dart b/lib/src/components/touch_feedback/touch_feedback.dart index e4a9f744..4fc37160 100644 --- a/lib/src/components/touch_feedback/touch_feedback.dart +++ b/lib/src/components/touch_feedback/touch_feedback.dart @@ -34,13 +34,11 @@ class ImpaktfullUiTouchFeedback extends StatelessWidget { @override Widget build(BuildContext context) { if (onTap == null) { - return Container( - decoration: BoxDecoration( - borderRadius: borderRadius, - border: border, - color: color ?? Colors.transparent, - boxShadow: shadow, - ), + return ImpaktfullUiContainer( + border: border, + boxShadow: shadow, + borderRadius: borderRadius, + color: color ?? Colors.transparent, child: child, ); } diff --git a/lib/src/theme/asset_theme.dart b/lib/src/theme/asset_theme.dart index 49ebc567..6c8384b7 100644 --- a/lib/src/theme/asset_theme.dart +++ b/lib/src/theme/asset_theme.dart @@ -35,6 +35,9 @@ class ImpaktfullUiAssetTheme { ImpaktfullUiIconTheme( add: ImpaktfullUiAsset.icon(PhosphorIcons.plus()), arrowLeft: ImpaktfullUiAsset.icon(PhosphorIcons.arrowLeft()), + arrowRight: ImpaktfullUiAsset.icon(PhosphorIcons.arrowRight()), + arrowUp: ImpaktfullUiAsset.icon(PhosphorIcons.arrowUp()), + arrowDown: ImpaktfullUiAsset.icon(PhosphorIcons.arrowDown()), check: ImpaktfullUiAsset.icon(PhosphorIcons.check()), chevronDown: ImpaktfullUiAsset.icon(PhosphorIcons.caretDown()), chevronLeft: ImpaktfullUiAsset.icon(PhosphorIcons.caretLeft()), @@ -49,8 +52,7 @@ class ImpaktfullUiAssetTheme { error: ImpaktfullUiAsset.icon(PhosphorIcons.warningDiamond()), home: ImpaktfullUiAsset.icon(PhosphorIcons.houseSimple()), info: ImpaktfullUiAsset.icon(PhosphorIcons.info()), - lineVertical: - ImpaktfullUiAsset.icon(PhosphorIcons.lineVertical()), + lineVertical: ImpaktfullUiAsset.icon(PhosphorIcons.lineVertical()), list: ImpaktfullUiAsset.icon(PhosphorIcons.list()), logout: ImpaktfullUiAsset.icon(PhosphorIcons.signOut()), minus: ImpaktfullUiAsset.icon(PhosphorIcons.minus()), @@ -134,6 +136,9 @@ class ImpaktfullUiAssetTheme { class ImpaktfullUiIconTheme { final ImpaktfullUiAsset add; final ImpaktfullUiAsset arrowLeft; + final ImpaktfullUiAsset arrowRight; + final ImpaktfullUiAsset arrowUp; + final ImpaktfullUiAsset arrowDown; final ImpaktfullUiAsset check; final ImpaktfullUiAsset chevronDown; final ImpaktfullUiAsset chevronLeft; @@ -160,6 +165,9 @@ class ImpaktfullUiIconTheme { const ImpaktfullUiIconTheme({ required this.add, required this.arrowLeft, + required this.arrowRight, + required this.arrowUp, + required this.arrowDown, required this.check, required this.chevronDown, required this.chevronLeft, @@ -187,6 +195,9 @@ class ImpaktfullUiIconTheme { ImpaktfullUiIconTheme copyWith({ ImpaktfullUiAsset? add, ImpaktfullUiAsset? arrowLeft, + ImpaktfullUiAsset? arrowRight, + ImpaktfullUiAsset? arrowUp, + ImpaktfullUiAsset? arrowDown, ImpaktfullUiAsset? check, ImpaktfullUiAsset? chevronDown, ImpaktfullUiAsset? chevronLeft, @@ -213,6 +224,9 @@ class ImpaktfullUiIconTheme { ImpaktfullUiIconTheme( add: add ?? this.add, arrowLeft: arrowLeft ?? this.arrowLeft, + arrowRight: arrowRight ?? this.arrowRight, + arrowUp: arrowUp ?? this.arrowUp, + arrowDown: arrowDown ?? this.arrowDown, check: check ?? this.check, chevronDown: chevronDown ?? this.chevronDown, chevronLeft: chevronLeft ?? this.chevronLeft, diff --git a/lib/src/theme/component_theme.dart b/lib/src/theme/component_theme.dart index 95ff6ed7..72522328 100644 --- a/lib/src/theme/component_theme.dart +++ b/lib/src/theme/component_theme.dart @@ -22,6 +22,7 @@ import 'package:impaktfull_ui_2/src/components/modal/modal.dart'; import 'package:impaktfull_ui_2/src/components/network_image/network_image.dart'; import 'package:impaktfull_ui_2/src/components/notification/notification.dart'; import 'package:impaktfull_ui_2/src/components/notification_badge/notification_badge.dart'; +import 'package:impaktfull_ui_2/src/components/pagination/pagination.dart'; import 'package:impaktfull_ui_2/src/components/refresh_indicator/refresh_indicator.dart'; import 'package:impaktfull_ui_2/src/components/sidebar_navigation/sidebar_navigation.dart'; import 'package:impaktfull_ui_2/src/components/sidebar_navigation_item/sidebar_navigation_item.dart'; @@ -63,6 +64,7 @@ class ImpaktfullUiComponentsTheme { final ImpaktfullUiNetworkImageTheme networkImage; final ImpaktfullUiNotificationTheme notification; final ImpaktfullUiNotificationBadgeTheme notificationBadge; + final ImpaktfullUiPaginationTheme pagination; final ImpaktfullUiRefreshIndicatorTheme refreshIndicator; final ImpaktfullUiSidebarNavigationTheme sidebarNavigation; final ImpaktfullUiSidebarNavigationItemTheme sidebarNavigationItem; @@ -100,6 +102,7 @@ class ImpaktfullUiComponentsTheme { required this.networkImage, required this.notification, required this.notificationBadge, + required this.pagination, required this.refreshIndicator, required this.sidebarNavigation, required this.sidebarNavigationItem, @@ -138,6 +141,7 @@ class ImpaktfullUiComponentsTheme { ImpaktfullUiNetworkImageTheme? networkImage, ImpaktfullUiNotificationTheme? notification, ImpaktfullUiNotificationBadgeTheme? notificationBadge, + ImpaktfullUiPaginationTheme? pagination, ImpaktfullUiRefreshIndicatorTheme? refreshIndicator, ImpaktfullUiSidebarNavigationTheme? sidebarNavigation, ImpaktfullUiSidebarNavigationItemTheme? sidebarNavigationItem, @@ -175,10 +179,10 @@ class ImpaktfullUiComponentsTheme { networkImage: networkImage ?? this.networkImage, notification: notification ?? this.notification, notificationBadge: notificationBadge ?? this.notificationBadge, + pagination: pagination ?? this.pagination, refreshIndicator: refreshIndicator ?? this.refreshIndicator, sidebarNavigation: sidebarNavigation ?? this.sidebarNavigation, - sidebarNavigationItem: - sidebarNavigationItem ?? this.sidebarNavigationItem, + sidebarNavigationItem: sidebarNavigationItem ?? this.sidebarNavigationItem, simpleListItem: simpleListItem ?? this.simpleListItem, snackyConfigurator: snackyConfigurator ?? this.snackyConfigurator, switchTheme: switchTheme ?? this.switchTheme, @@ -237,7 +241,9 @@ class ImpaktfullUiComponentsTheme { return ImpaktfullUiNotificationTheme.of(context) as T; } else if (T == ImpaktfullUiNotificationBadgeTheme) { return ImpaktfullUiNotificationBadgeTheme.of(context) as T; - } else if (T == ImpaktfullUiRefreshIndicatorTheme) { + } else if (T == ImpaktfullUiPaginationTheme) { + return ImpaktfullUiPaginationTheme.of(context) as T; + } else if (T == ImpaktfullUiRefreshIndicatorTheme) { return ImpaktfullUiRefreshIndicatorTheme.of(context) as T; } else if (T == ImpaktfullUiSidebarNavigationTheme) { return ImpaktfullUiSidebarNavigationTheme.of(context) as T; diff --git a/lib/src/theme/theme_default.dart b/lib/src/theme/theme_default.dart index 0c7ec7d4..56171410 100644 --- a/lib/src/theme/theme_default.dart +++ b/lib/src/theme/theme_default.dart @@ -22,6 +22,7 @@ import 'package:impaktfull_ui_2/src/components/modal/modal.dart'; import 'package:impaktfull_ui_2/src/components/network_image/network_image.dart'; import 'package:impaktfull_ui_2/src/components/notification/notification.dart'; import 'package:impaktfull_ui_2/src/components/notification_badge/notification_badge.dart'; +import 'package:impaktfull_ui_2/src/components/pagination/pagination.dart'; import 'package:impaktfull_ui_2/src/components/refresh_indicator/refresh_indicator.dart'; import 'package:impaktfull_ui_2/src/components/sidebar_navigation/sidebar_navigation.dart'; import 'package:impaktfull_ui_2/src/components/sidebar_navigation_item/sidebar_navigation_item.dart'; @@ -93,13 +94,11 @@ class DefaultTheme { destructive: destructive ?? const Color(0xFFBD0D00), ); final dimens = ImpaktfullUiDimensTheme( - borderRadiusExtraSmall: - borderRadiusExtraSmall ?? BorderRadius.circular(4), + borderRadiusExtraSmall: borderRadiusExtraSmall ?? BorderRadius.circular(4), borderRadiusSmall: borderRadiusSmall ?? BorderRadius.circular(6), borderRadius: borderRadiusSmall ?? BorderRadius.circular(8), borderRadiusLarge: borderRadiusLarge ?? BorderRadius.circular(12), - borderRadiusExtraLarge: - borderRadiusExtraLarge ?? BorderRadius.circular(16), + borderRadiusExtraLarge: borderRadiusExtraLarge ?? BorderRadius.circular(16), borderRadiusCircle: BorderRadius.circular(99999999), ); final textStyles = ImpaktfullUiTextStylesTheme( @@ -257,8 +256,7 @@ class DefaultTheme { alternative: textStyles.onCardPrimary.text.small.bold, grey: textStyles.onCard.text.small.bold, destructivePrimary: textStyles.onDestructive.text.small.bold, - destructiveAlternative: - textStyles.onCardDestructive.text.small.bold, + destructiveAlternative: textStyles.onCardDestructive.text.small.bold, ), ), card: ImpaktfullUiCardTheme( @@ -377,9 +375,8 @@ class DefaultTheme { ), textStyles: ImpaktfullUiInputFieldTextStylesTheme( text: textStyles.onCard.text.medium, - hint: textStyles.onCardSecondary.text.medium.copyWith( - color: textStyles.onCardTertiary.text.medium.color - ?.withOpacity(0.5)), + hint: textStyles.onCardSecondary.text.medium + .copyWith(color: textStyles.onCardTertiary.text.medium.color?.withOpacity(0.5)), label: textStyles.onCard.text.small.medium, ), ), @@ -478,9 +475,19 @@ class DefaultTheme { text: textStyles.onPrimary.text.small, ), ), + pagination: ImpaktfullUiPaginationTheme( + assets: ImpaktfullUiPaginationAssetsTheme( + arrowLeft: assets.icons.arrowLeft, + arrowRight: assets.icons.arrowRight, + ), + colors: const ImpaktfullUiPaginationColorTheme(), + dimens: const ImpaktfullUiPaginationDimensTheme(), + textStyles: ImpaktfullUiPaginationTextStyleTheme( + text: textStyles.onCard.text.small, + ), + ), refreshIndicator: ImpaktfullUiRefreshIndicatorTheme( - colors: ImpaktfullUiRefreshIndicatorColorTheme( - loadingIndicator: colors.accent), + colors: ImpaktfullUiRefreshIndicatorColorTheme(loadingIndicator: colors.accent), ), sidebarNavigation: ImpaktfullUiSidebarNavigationTheme( assets: const ImpaktfullUiSidebarNavigationAssetsTheme(),