Skip to content

Commit 98c0a7d

Browse files
committed
main : Added cursor pointer for bouceable widget
1 parent 0193387 commit 98c0a7d

File tree

6 files changed

+57
-50
lines changed

6 files changed

+57
-50
lines changed

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -127,7 +127,7 @@
127127
97C146E61CF9000F007C117D /* Project object */ = {
128128
isa = PBXProject;
129129
attributes = {
130-
LastUpgradeCheck = 1020;
130+
LastUpgradeCheck = 1300;
131131
ORGANIZATIONNAME = "";
132132
TargetAttributes = {
133133
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
4446
</dict>
4547
</plist>

example/lib/views/app_store_view.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:flutter/material.dart';
3-
import 'package:flutter/painting.dart';
4-
import 'package:flutter/rendering.dart';
5-
import 'package:flutter/widgets.dart';
63
import 'package:flutter_bounceable/flutter_bounceable.dart';
74

85
class AppStoreView extends StatelessWidget {

example/pubspec.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.1"
10+
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -21,7 +21,7 @@ packages:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0"
24+
version: "1.2.0"
2525
charcode:
2626
dependency: transitive
2727
description:
@@ -42,7 +42,7 @@ packages:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0"
45+
version: "1.16.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
@@ -56,7 +56,7 @@ packages:
5656
name: fake_async
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.2.0"
59+
version: "1.3.0"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -94,7 +94,14 @@ packages:
9494
name: matcher
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "0.12.10"
97+
version: "0.12.11"
98+
material_color_utilities:
99+
dependency: transitive
100+
description:
101+
name: material_color_utilities
102+
url: "https://pub.dartlang.org"
103+
source: hosted
104+
version: "0.1.4"
98105
meta:
99106
dependency: transitive
100107
description:
@@ -108,7 +115,7 @@ packages:
108115
name: path
109116
url: "https://pub.dartlang.org"
110117
source: hosted
111-
version: "1.8.0"
118+
version: "1.8.1"
112119
sky_engine:
113120
dependency: transitive
114121
description: flutter
@@ -120,7 +127,7 @@ packages:
120127
name: source_span
121128
url: "https://pub.dartlang.org"
122129
source: hosted
123-
version: "1.8.1"
130+
version: "1.8.2"
124131
stack_trace:
125132
dependency: transitive
126133
description:
@@ -155,21 +162,14 @@ packages:
155162
name: test_api
156163
url: "https://pub.dartlang.org"
157164
source: hosted
158-
version: "0.4.2"
159-
typed_data:
160-
dependency: transitive
161-
description:
162-
name: typed_data
163-
url: "https://pub.dartlang.org"
164-
source: hosted
165-
version: "1.3.0"
165+
version: "0.4.9"
166166
vector_math:
167167
dependency: transitive
168168
description:
169169
name: vector_math
170170
url: "https://pub.dartlang.org"
171171
source: hosted
172-
version: "2.1.0"
172+
version: "2.1.2"
173173
sdks:
174-
dart: ">=2.12.0 <3.0.0"
174+
dart: ">=2.17.0-0 <3.0.0"
175175
flutter: ">=1.17.0"

lib/src/bounceable.dart

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,46 @@ class _BounceableState extends State<Bounceable>
7070
}
7171

7272
@override
73-
Widget build(BuildContext context) {
74-
void onTap() {
75-
if (widget.onTap != null) widget.onTap!();
73+
void reassemble() {
74+
super.reassemble();
75+
}
7676

77-
_controller.reverse().then((_) {
78-
_controller.forward();
79-
});
80-
}
77+
void _onTap() {
78+
if (widget.onTap != null) widget.onTap!();
8179

82-
void onTapUp(TapUpDetails details) {
83-
if (widget.onTapUp != null) widget.onTapUp!(details);
80+
_controller.reverse().then((_) {
8481
_controller.forward();
85-
}
82+
});
83+
}
8684

87-
void onTapDown(TapDownDetails details) {
88-
if (widget.onTapDown != null) widget.onTapDown!(details);
89-
_controller.reverse();
90-
}
85+
void _onTapUp(TapUpDetails details) {
86+
if (widget.onTapUp != null) widget.onTapUp!(details);
87+
_controller.forward();
88+
}
9189

92-
void onTapCancel() {
93-
if (widget.onTapCancel != null) widget.onTapCancel!();
94-
_controller.forward();
95-
}
96-
97-
return GestureDetector(
98-
onTapCancel: widget.onTap != null ? onTapCancel : null,
99-
onTapDown: widget.onTap != null ? onTapDown : null,
100-
onTapUp: widget.onTap != null ? onTapUp : null,
101-
onTap: widget.onTap != null ? onTap : null,
102-
child: ScaleTransition(
103-
scale: _animation,
104-
child: widget.child,
90+
void _onTapDown(TapDownDetails details) {
91+
if (widget.onTapDown != null) widget.onTapDown!(details);
92+
_controller.reverse();
93+
}
94+
95+
void _onTapCancel() {
96+
if (widget.onTapCancel != null) widget.onTapCancel!();
97+
_controller.forward();
98+
}
99+
100+
@override
101+
Widget build(BuildContext context) {
102+
return MouseRegion(
103+
cursor: SystemMouseCursors.click,
104+
child: GestureDetector(
105+
onTapCancel: widget.onTap != null ? _onTapCancel : null,
106+
onTapDown: widget.onTap != null ? _onTapDown : null,
107+
onTapUp: widget.onTap != null ? _onTapUp : null,
108+
onTap: widget.onTap != null ? _onTap : null,
109+
child: ScaleTransition(
110+
scale: _animation,
111+
child: widget.child,
112+
),
105113
),
106114
);
107115
}

0 commit comments

Comments
 (0)