feature_discovery
feature_discovery copied to clipboard
Cannot align DescribedFeatureOverlay to the right middle of the screen
I tried to display DescribedFeatureOverlay to the widget locates on the middle left of the screen.
prefixIcon: DescribedFeatureOverlay(
featureId: 'date',
tapTarget: Icon(Icons.calendar_today),
contentLocation: ContentLocation.above,
overflowMode: OverflowMode.clipContent,
title: Text('Date'),
description:
Text('Choose the date from calendar'),
child: Icon(Icons.calendar_today),
),
I want this features to added. Facing same problem. Even ContentLocation.trivial
don't works. @ayalma
hey @limsocheat , you can edit source file - flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/feature_discovery-0.13.0+2/lib/src/foundation/feature_discovery.dart
enum ContentLocation {
above,
below,
trivial,
right, // add this
}
this file - flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/feature_discovery-0.13.0+2/lib/src/widgets/overlay.dart
Offset _backgroundPosition(Offset anchor, ContentLocation contentLocation) {
final width = min(_screenSize.width, _screenSize.height);
final isBackgroundCentered = _isCloseToTopOrBottom(anchor);
if (isBackgroundCentered) {
return anchor;
} else {
final startingBackgroundPosition = anchor;
Offset endingBackgroundPosition;
switch (contentLocation) {
// add this case
case ContentLocation.right:
endingBackgroundPosition =
Offset(width / 2.0, anchor.dy + (width / 4.0));
break;
Now, it will work.
Any updates on this ?