File tree Expand file tree Collapse file tree 4 files changed +57
-2
lines changed Expand file tree Collapse file tree 4 files changed +57
-2
lines changed Original file line number Diff line number Diff line change 40
40
- Deprecate [ #531 ] ( https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/531 ) -
41
41
Update deprecated ` ShowCaseWidget ` removal version.
42
42
- Improvement [ #505 ] ( https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/505 ) -
43
- Fixed example app to run in flutter version ` v3.32.5 ` .
43
+ Fixed example app to run in flutter version ` v3.32.5 ` .
44
+ - Fixed [ #564 ] ( https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/564 ) -
45
+ Apply textScaler to tooltip widgets.
44
46
45
47
## [ 4.0.1]
46
48
- Fixed [ #493 ] ( https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493 ) - ShowCase.withWidget not showing issue
Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+
3
+ /// Container for captured inherited widget data from showcase's context.
4
+ class FlutterInheritedData {
5
+ const FlutterInheritedData ({
6
+ required this .mediaQuery,
7
+ required this .textDirection,
8
+ required this .capturedThemes,
9
+ required this .textStyle,
10
+ });
11
+
12
+ factory FlutterInheritedData .fromContext (BuildContext context) {
13
+ return FlutterInheritedData (
14
+ mediaQuery: MediaQuery .of (context),
15
+ capturedThemes: InheritedTheme .capture (
16
+ from: context,
17
+ to: Navigator .maybeOf (context)? .context,
18
+ ),
19
+ textDirection: Directionality .of (context),
20
+ textStyle: DefaultTextStyle .of (context).style,
21
+ );
22
+ }
23
+
24
+ final MediaQueryData mediaQuery;
25
+ final CapturedThemes capturedThemes;
26
+ final TextDirection textDirection;
27
+ final TextStyle textStyle;
28
+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import 'dart:math';
24
24
import 'package:flutter/foundation.dart' ;
25
25
import 'package:flutter/widgets.dart' ;
26
26
27
+ import '../models/flutter_inherited_data.dart' ;
27
28
import '../models/linked_showcase_data_model.dart' ;
28
29
import '../models/tooltip_action_config.dart' ;
29
30
import '../tooltip/tooltip.dart' ;
@@ -98,6 +99,10 @@ class ShowcaseController {
98
99
/// Global floating action widget to be displayed
99
100
FloatingActionWidget ? globalFloatingActionWidget;
100
101
102
+ /// Captured inherited widget data from showcase context
103
+ late final FlutterInheritedData inheritedData =
104
+ FlutterInheritedData .fromContext (_context);
105
+
101
106
/// Returns the Showcase widget configuration.
102
107
///
103
108
/// Provides access to all properties and settings of the current showcase
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ class OverlayManager {
177
177
child: const Align (),
178
178
);
179
179
180
- return Stack (
180
+ final overlayChild = Stack (
181
181
// This key is used to force rebuild the overlay when needed.
182
182
// this key enables `_overlayEntry?.markNeedsBuild();` to detect that
183
183
// output of the builder has changed.
@@ -202,6 +202,26 @@ class OverlayManager {
202
202
...controllers.expand ((object) => object.tooltipWidgets),
203
203
],
204
204
);
205
+
206
+ final inheritedData = firstController.inheritedData;
207
+
208
+ // Wrap the child with captured themes to maintain the original context's
209
+ // theme. Captured themes are used as to cover cases where there are
210
+ // multiple themes in the widget tree.
211
+ final themedChild = inheritedData.capturedThemes.wrap (overlayChild);
212
+
213
+ // Wrap with other inherited widgets to maintain showcase's context's
214
+ // inherited values.
215
+ return Directionality (
216
+ textDirection: inheritedData.textDirection,
217
+ child: MediaQuery (
218
+ data: inheritedData.mediaQuery,
219
+ child: DefaultTextStyle (
220
+ style: inheritedData.textStyle,
221
+ child: themedChild,
222
+ ),
223
+ ),
224
+ );
205
225
}
206
226
207
227
/// Extracts and returns linked showcase data from controllers.
You can’t perform that action at this time.
0 commit comments