diff --git a/.run/example.run.xml b/.run/example.run.xml
new file mode 100644
index 0000000..5650683
--- /dev/null
+++ b/.run/example.run.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index c6759a6..deb66de 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
@@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1020;
+ LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a28140c..3db53b6 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
=2.12.0 <3.0.0"
+ dart: ">=2.14.0 <3.0.0"
flutter: ">=1.17.0"
diff --git a/lib/pressable.dart b/lib/pressable.dart
index 08e0466..3b4d20e 100644
--- a/lib/pressable.dart
+++ b/lib/pressable.dart
@@ -4,14 +4,17 @@ import 'package:flutter/material.dart';
import 'package:pressable/src/builder.dart';
import 'package:pressable/src/fill.dart';
import 'package:pressable/src/opacity.dart';
+import 'package:pressable/src/platform.dart';
import 'package:pressable/src/ripple.dart';
import 'package:pressable/src/scale.dart';
+import 'package:pressable/src/theme/theme.dart';
-export 'package:pressable/src/builder.dart' show PressableBuilderCallback;
-export 'package:pressable/src/fill.dart' show PressableFillTheme;
-export 'package:pressable/src/opacity.dart' show PressableOpacityTheme;
-export 'package:pressable/src/ripple.dart' show PressableRippleTheme;
-export 'package:pressable/src/scale.dart' show PressableScaleTheme;
+export 'package:pressable/src/builder.dart';
+export 'package:pressable/src/fill.dart';
+export 'package:pressable/src/opacity.dart';
+export 'package:pressable/src/ripple.dart';
+export 'package:pressable/src/scale.dart';
+export 'package:pressable/src/theme/theme.dart';
/// Choose named constructors to pick press effect.
abstract class Pressable extends StatefulWidget {
@@ -90,6 +93,32 @@ abstract class Pressable extends StatefulWidget {
);
}
+ /// Provide platform specific [PressableTheme]. You must provide theme for
+ /// current platform otherwise error is thrown.
+ factory Pressable.platform({
+ Key? key,
+ required Widget child,
+ VoidCallback? onPressed,
+ VoidCallback? onLongPressed,
+ PressableTheme? ios,
+ PressableTheme? android,
+ PressableTheme? macOS,
+ PressableTheme? windows,
+ PressableTheme? linux,
+ }) {
+ return PressablePlatform(
+ key: key,
+ ios: ios,
+ macOS: macOS,
+ windows: windows,
+ linux: linux,
+ android: android,
+ onPressed: onPressed,
+ onLongPressed: onLongPressed,
+ child: child,
+ );
+ }
+
/// Use builder to define your own effect.
factory Pressable.builder({
Key? key,
diff --git a/lib/src/base.dart b/lib/src/base.dart
index 2afd2df..eff1863 100644
--- a/lib/src/base.dart
+++ b/lib/src/base.dart
@@ -1,4 +1,3 @@
-import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
abstract class PressableBaseState extends State {
diff --git a/lib/src/fill.dart b/lib/src/fill.dart
index bda3102..9de368d 100644
--- a/lib/src/fill.dart
+++ b/lib/src/fill.dart
@@ -1,4 +1,3 @@
-import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:pressable/pressable.dart';
import 'package:pressable/src/base.dart';
@@ -35,16 +34,3 @@ class _PressableFillState extends PressableBaseState {
);
}
}
-
-class PressableFillTheme extends Equatable {
- const PressableFillTheme({
- this.fillColor = Colors.black38,
- this.borderRadius = BorderRadius.zero,
- });
-
- final Color fillColor;
- final BorderRadius borderRadius;
-
- @override
- List