Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Changelog

## 0.14.3
* Added support for customizable target radius in `DescribedFeatureOverlay` via the `targetRadius` property.
* Improved pulse animation for smoother visuals.

## 0.14.2
* Updated All Dependencies versions
* Updated To Flutter version 3.24.3
# Changelog

## 0.14.1
* Updated Provider version

# Changelog
## 0.14.0
* Migrated to null safety

Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,26 @@ This is `OverflowMode.ignore` by default, which will simply render the content y

* `OverflowMode.wrapBackground` will expand the background circle if necessary, but also shrink it if the content is smaller than the default background size.

#### `targetRadius`

The `targetRadius` property allows you to customize the radius of the tap target circle. If you don't provide a value, it defaults to `44.0`.

**Example:**

```dart
DescribedFeatureOverlay(
featureId: 'custom-target-radius-feature',
tapTarget: const Icon(Icons.add),
targetRadius: 60.0, // Custom radius for the target
title: const Text('Custom Target Radius'),
description: const Text('This feature overlay has a larger target radius.'),
child: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
)
```

</details>

### `FeatureDiscovery.discoverFeatures`
Expand Down
1 change: 1 addition & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if (flutterVersionName == null) {


android {
namespace "com.example.example"
compileSdk 34

lintOptions {
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.android.application" version "8.7.3" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
34 changes: 34 additions & 0 deletions example/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
8 changes: 6 additions & 2 deletions lib/src/rendering/custom_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class BackgroundContentLayoutDelegate extends MultiChildLayoutDelegate {
final FeatureOverlayState state;
final double? transitionProgress;

final double targetRadius;

BackgroundContentLayoutDelegate({
required this.overflowMode,
required this.contentPosition,
Expand All @@ -47,6 +49,7 @@ class BackgroundContentLayoutDelegate extends MultiChildLayoutDelegate {
required this.contentOffsetMultiplier,
required this.state,
required this.transitionProgress,
required this.targetRadius,
});

@override
Expand Down Expand Up @@ -74,9 +77,10 @@ class BackgroundContentLayoutDelegate extends MultiChildLayoutDelegate {
overflowMode == OverflowMode.clipContent)
matchedRadius = backgroundRadius;
else {
// 75 is the radius of the pulse when fully expanded.
// targetRadius * 2 is the radius of the pulse when fully expanded.
// Calculating the distance here is easy because the pulse is a circle.
final distanceToOuterPulse = anchorPoint.distanceTo(backgroundPoint) + 75;
final distanceToOuterPulse =
anchorPoint.distanceTo(backgroundPoint) + targetRadius * 2;

// Calculate distance to the furthest point of the content.
final contentArea = Rect.fromLTWH(contentPoint.x, contentPoint.y,
Expand Down
Loading