Skip to content
7 changes: 7 additions & 0 deletions examples/stac_gallery/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
Expand All @@ -13,6 +16,7 @@ PODS:
DEPENDENCIES:
- Flutter (from `Flutter`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)

Expand All @@ -21,6 +25,8 @@ EXTERNAL SOURCES:
:path: Flutter
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite_darwin:
:path: ".symlinks/plugins/sqflite_darwin/darwin"
webview_flutter_wkwebview:
Expand All @@ -29,6 +35,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
webview_flutter_wkwebview: 1821ceac936eba6f7984d89a9f3bcb4dea99ebb2

Expand Down
3 changes: 2 additions & 1 deletion packages/stac/lib/src/parsers/theme/stac_theme_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import 'package:stac/src/parsers/theme/stac_scrollbar_theme_data_parser.dart';
import 'package:stac/src/parsers/theme/stac_snack_bar_theme_data_parser.dart';
import 'package:stac/src/parsers/theme/stac_tab_bar_theme_data_parser.dart';
import 'package:stac/src/parsers/theme/stac_text_theme_parser.dart';
import 'package:stac/src/parsers/theme/stac_tool_tip_theme_data_parser.dart';
import 'package:stac/src/utils/color_utils.dart';
import 'package:stac_core/stac_core.dart';

Expand Down Expand Up @@ -125,7 +126,7 @@ extension StacThemeParser on StacTheme {
// TextSelectionThemeData? textSelectionTheme,
// TimePickerThemeData? timePickerTheme,
// ToggleButtonsThemeData? toggleButtonsTheme,
// TooltipThemeData? tooltipTheme,
tooltipTheme: tooltipTheme?.parse(context),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
import 'package:stac/src/parsers/foundation/foundation.dart';
import 'package:stac_core/stac_core.dart';

/// Parser extension for [StacTooltipThemeData].
///
/// Converts [StacTooltipThemeData] to Flutter's [TooltipThemeData].
extension StacTooltipThemeDataParser on StacTooltipThemeData {
TooltipThemeData parse(BuildContext context) {
return TooltipThemeData(
constraints: constraints?.parse,
padding: padding?.parse,
margin: margin?.parse,
verticalOffset: verticalOffset,
preferBelow: preferBelow,
excludeFromSemantics: excludeFromSemantics,
decoration: decoration?.parse(context),
textStyle: textStyle?.parse(context),
textAlign: textAlign?.parse,
waitDuration: waitDuration?.parse,
showDuration: showDuration?.parse,
exitDuration: exitDuration?.parse,
triggerMode: triggerMode?.parse,
enableFeedback: enableFeedback,
);
}
}
4 changes: 3 additions & 1 deletion packages/stac/lib/src/parsers/theme/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export 'package:stac_core/stac_core.dart'
StacSnackBarThemeData,
StacTabBarThemeData,
StacTextTheme,
StacTheme;
StacTheme,
StacTooltipThemeData;

// Export parsers
export 'stac_app_bar_theme_parser.dart';
Expand Down Expand Up @@ -55,3 +56,4 @@ export 'stac_snack_bar_theme_data_parser.dart';
export 'stac_tab_bar_theme_data_parser.dart';
export 'stac_text_theme_parser.dart';
export 'stac_theme_parser.dart';
export 'stac_tool_tip_theme_data_parser.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import 'package:stac_core/foundation/theme/stac_scrollbar_theme_data/stac_scroll
import 'package:stac_core/foundation/theme/stac_snack_bar_theme_data/stac_snack_bar_theme_data.dart';
import 'package:stac_core/foundation/theme/stac_tab_bar_theme_data/stac_tab_bar_theme_data.dart';
import 'package:stac_core/foundation/theme/stac_text_theme/stac_text_theme.dart';
import 'package:stac_core/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart';

part 'stac_theme.g.dart';

Expand Down Expand Up @@ -155,7 +156,7 @@ class StacTheme implements StacElement {
// TextSelectionThemeData? textSelectionTheme,
// TimePickerThemeData? timePickerTheme,
// ToggleButtonsThemeData? toggleButtonsTheme,
// TooltipThemeData? tooltipTheme,
this.tooltipTheme,
});

// GENERAL CONFIGURATION
Expand Down Expand Up @@ -371,7 +372,9 @@ class StacTheme implements StacElement {
// TextSelectionThemeData? textSelectionTheme,
// TimePickerThemeData? timePickerTheme,
// ToggleButtonsThemeData? toggleButtonsTheme,
// TooltipThemeData? tooltipTheme,

/// The theme for [Tooltip] widgets.
final StacTooltipThemeData? tooltipTheme;

/// Creates a [StacTheme] from JSON.
factory StacTheme.fromJson(Map<String, dynamic> json) =>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:stac_core/stac_core.dart';

part 'stac_tool_tip_theme_data.g.dart';

/// A Stac model representing Flutter's [TooltipThemeData].
///
/// Defines default visual and behavioral properties for [Tooltip] widgets.
///
/// {@tool snippet}
/// Dart Example:
/// ```dart
/// StacTooltipThemeData(
/// padding: StacEdgeInsets.all(8),
/// textStyle: StacTextStyle(color: '#FFFFFF'),
/// preferBelow: true,
/// )
/// ```
/// {@end-tool}
///
/// {@tool snippet}
/// JSON Example:
/// ```json
/// {
/// "padding": { "all": 8 },
/// "margin": { "horizontal": 12 },
/// "verticalOffset": 24,
/// "preferBelow": true,
/// "textStyle": { "color": "#FFFFFF", "fontSize": 12 },
/// "triggerMode": "longPress"
/// }
/// ```
/// {@end-tool}
@JsonSerializable()
class StacTooltipThemeData implements StacElement {
/// Creates a [StacTooltipThemeData] with the given properties.
const StacTooltipThemeData({
this.height,
this.constraints,
this.padding,
this.margin,
this.verticalOffset,
this.preferBelow,
this.excludeFromSemantics,
this.decoration,
this.textStyle,
this.textAlign,
this.waitDuration,
this.showDuration,
this.exitDuration,
this.triggerMode,
this.enableFeedback,
});

/// Minimum height of the tooltip.
final double? height;

/// Size constraints for the tooltip.
final StacBoxConstraints? constraints;

/// Padding inside the tooltip.
final StacEdgeInsets? padding;

/// Margin around the tooltip.
final StacEdgeInsets? margin;

/// Vertical gap between widget and tooltip.
final double? verticalOffset;

/// Whether tooltip prefers to appear below the widget.
final bool? preferBelow;

/// Whether tooltip text is excluded from semantics.
final bool? excludeFromSemantics;

/// Tooltip decoration.
final StacBoxDecoration? decoration;

/// Tooltip text style.
final StacTextStyle? textStyle;

/// Tooltip text alignment.
final StacTextAlign? textAlign;

/// Delay before showing tooltip.
final StacDuration? waitDuration;

/// Duration tooltip remains visible.
final StacDuration? showDuration;

/// Delay before tooltip disappears.
final StacDuration? exitDuration;

/// Trigger mode for tooltip.
final StacTooltipTriggerMode? triggerMode;

/// Whether to provide acoustic/haptic feedback.
final bool? enableFeedback;

/// Creates a [StacTooltipThemeData] from JSON.
factory StacTooltipThemeData.fromJson(Map<String, dynamic> json) =>
_$StacTooltipThemeDataFromJson(json);

@override
Map<String, dynamic> toJson() => _$StacTooltipThemeDataToJson(this);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/stac_core/lib/foundation/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ export 'stac_snack_bar_theme_data/stac_snack_bar_theme_data.dart';
export 'stac_tab_bar_theme_data/stac_tab_bar_theme_data.dart';
export 'stac_text_theme/stac_text_theme.dart';
export 'stac_theme/stac_theme.dart';
export 'stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart';