Hey everyone, I'm building a little mini-game into my flutter web app and want to have a physics based ball that rolls from one side of a constrained box to another tied to mouse movement. Any tips or suggestions?
I was thinking of using an animated slider and tying it to the coordinates of the mouse from a pointer listener. Not sure what the math would be to accomplish this, so feel free to add suggestions there as well.
@abbadabbatech thx for the reply. I am trying to play via network url: https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4' . My approach was to do this..but is doesn't seem to work. ''' void main() {
ui.platformViewRegistry.registerViewFactory(
'hello-world-html',
(int viewId) => IFrameElement()..src = 'https://www.youtube.com/embed/tgbNymZ7vqY'
);
runApp(Directionality(
textDirection: TextDirection.ltr,
child: HtmlView(viewType: 'hello-world-html'),
));
}'''
sorry about that.
'''
void main() {
ui.platformViewRegistry.registerViewFactory(
'hello-world-html',
(int viewId) => IFrameElement()..src = ' https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4'
);
runApp(Directionality(
textDirection: TextDirection.ltr,
child: HtmlView(viewType: 'hello-world-html'),
));
}
'''
``
your code
``
void main() {
ui.platformViewRegistry.registerViewFactory(
'hello-world-html',
(int viewId) => IFrameElement()..src = 'https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4'
);
runApp(Directionality(
textDirection: TextDirection.ltr,
child: HtmlView(viewType: 'hello-world-html'),
));
}
http://localhost:8080/post?id=1234
in the Flutter code I will be able to take that ID argument in the post
endpoint
flutter config --enable-web
now, do anyone know any available online doc talking about the best pratice to manage a flutter project for both mobile and web? It seems I still need to have two different versions of pubspec.yaml
and remove all the packages which are not supported by the web. so any best practise? Maybe I just move all the common packages out to be a single lib package. So end up three dart packages. one for common class, one for mobile and one for web. Is this a good design? Thanks a lot.
pubspec.yaml
. I didn’t find the right procedure to do it. Flutter team hides this deeply. After following the right procedure, it turns out it has to be a completely diffrerent project/package due to flutter create —web .
did something I am unsure. So, the question still applies. Should I create three projects (packages)? One for common, one for mobile and one for web? Is this best practise? I haven’t tried it if that way will work or not.