Skip to content

Commit

Permalink
Merge 3346910 into c8ec07e
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-vz committed Jan 9, 2023
2 parents c8ec07e + 3346910 commit 33e1c75
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## [0.8.1] - 2023-01-09
### Added
- Semantics to TouchFeedBack

## [0.8.0] - 2022-10-17
### Breaking
- Removed native dialogs
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>11.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
40 changes: 23 additions & 17 deletions example/ios/Podfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -340,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -414,7 +414,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -463,7 +463,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
73 changes: 43 additions & 30 deletions lib/src/widget/touch_feedback/touch_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:icapps_architecture/icapps_architecture.dart';
class TouchFeedBack extends StatelessWidget {
final Widget child;
final VoidCallback? onClick;
final String? label;
final Color? androidSplashColor;
final Color color;
final BorderRadius? borderRadius;
Expand All @@ -18,6 +19,7 @@ class TouchFeedBack extends StatelessWidget {
const TouchFeedBack({
required this.child,
required this.onClick,
this.label,
this.borderRadius,
this.androidSplashColor,
this.color = Colors.transparent,
Expand All @@ -35,6 +37,7 @@ class TouchFeedBack extends StatelessWidget {
return TouchFeedBackIOS(
child: child,
onClick: onClick,
label: label,
color: color,
borderRadius: borderRadius,
elevation: elevation,
Expand All @@ -44,28 +47,33 @@ class TouchFeedBack extends StatelessWidget {
}

Widget _buildAndroid() {
return Material(
borderRadius: borderRadius,
color: color,
elevation: elevation,
shadowColor: shadowColor,
shape: shapeBorder,
child: onClick == null
? child
: InkWell(
customBorder: shapeBorder,
borderRadius: borderRadius,
splashColor: androidSplashColor,
onTap: onClick,
child: child,
),
return Semantics(
label: label,
button: true,
child: Material(
borderRadius: borderRadius,
color: color,
elevation: elevation,
shadowColor: shadowColor,
shape: shapeBorder,
child: onClick == null
? child
: InkWell(
customBorder: shapeBorder,
borderRadius: borderRadius,
splashColor: androidSplashColor,
onTap: onClick,
child: child,
),
),
);
}
}

class TouchFeedBackIOS extends StatefulWidget {
final Widget child;
final VoidCallback? onClick;
final String? label;
final Color color;
final BorderRadius? borderRadius;
final ShapeBorder? shapeBorder;
Expand All @@ -75,6 +83,7 @@ class TouchFeedBackIOS extends StatefulWidget {
const TouchFeedBackIOS({
required this.child,
required this.onClick,
this.label,
this.borderRadius,
this.color = Colors.transparent,
this.shapeBorder,
Expand Down Expand Up @@ -104,21 +113,25 @@ class _TouchFeedBackIOSState extends State<TouchFeedBackIOS> {

@override
Widget build(BuildContext context) {
return GestureDetector(
excludeFromSemantics: widget.onClick == null,
onTapDown: _onTapDown,
onTap: widget.onClick,
onTapCancel: () => _setTouched(false),
onTapUp: (details) => _setTouched(false),
child: Transform.scale(
scale: touched ? touchScale : defaultScale,
child: Material(
borderRadius: widget.borderRadius,
color: widget.color,
child: widget.child,
shape: widget.shapeBorder,
elevation: widget.elevation,
shadowColor: widget.shadowColor,
return Semantics(
label: widget.label,
button: true,
child: GestureDetector(
excludeFromSemantics: widget.onClick == null,
onTapDown: _onTapDown,
onTap: widget.onClick,
onTapCancel: () => _setTouched(false),
onTapUp: (details) => _setTouched(false),
child: Transform.scale(
scale: touched ? touchScale : defaultScale,
child: Material(
borderRadius: widget.borderRadius,
color: widget.color,
child: widget.child,
shape: widget.shapeBorder,
elevation: widget.elevation,
shadowColor: widget.shadowColor,
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/icapps/flutter-icapps-architecture
repository: https://github.com/icapps/flutter-icapps-architecture
issue_tracker: https://github.com/icapps/flutter-icapps-architecture/issues

version: 0.8.0
version: 0.8.1

environment:
sdk: '>=2.17.0 <3.0.0'
Expand Down

0 comments on commit 33e1c75

Please sign in to comment.