I developed a game with Flutter that I embedded on a webpage. None of the actions works on finger touch on Safari on the iPad. They respond only to mouse clicks. They do respond to finger touch on Chrome on a mobile device.
On the first screen, there is a simple Flat Button with onPressed to navigate to the next screen. The button is working perfectly fine on Chrome, Firefox, even Safari, but for this one, only with a mouse. If I tried the game on Safari on an iPad, the onPressed doesn't work with finger touch, nor with a pencil.
Same thing for the logo that I embedded in an InkWell widget with an onTap.
Here is the page with the game: http://www.maxetom.com/jeux_lecture/son_a1.php
Here is the code for the button:
import 'package:flutter/material.dart';
class OrangeButton extends StatelessWidget {
final String screenName;
final String text;
OrangeButton(this.text, this.screenName);
void callNextScreen(BuildContext context) {
Navigator.of(context).pushNamed(screenName);
}
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(15),
child: FlatButton(
color: Theme.of(context).accentColor,
textColor: Colors.white,
onPressed: () => callNextScreen(context),
child: Container(
alignment: Alignment.center,
width: 120,
height: 50,
child: Text(
text,
style: Theme.of(context).textTheme.bodyText1,
),
),
),
);
}
}
Here is the code for the InkWell + onTap:
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter/material.dart';
class Logo extends StatelessWidget {
const Logo({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: Colors.transparent,
alignment: Alignment.centerRight,
padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 5.0),
child: Material(
color: Theme.of(context).primaryColorDark,
child: InkWell(
child: Text(
'maxetom',
style: TextStyle(
fontFamily: 'Bradley',
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white,
letterSpacing: 1.5,
),
textAlign: TextAlign.right,
),
onTap: () async {
final url = 'http://www.maxetom.com/';
if (await canLaunch(url)) {
await launch(
url,
forceSafariVC: false,
);
}
},
),
),
);
}
}
I used "Flutter build web" to build the release for the web version.
I'm probably missing something. Does anybody have an idea?
Thank you!