I have implemented routing in my flutter app via on-the-fly route generation with
onPressed:() => Navigator.of(context).push(new PageRouteBuilder(
pageBuilder: (_, __, ___) => new Video(),
)),
transitionBuilder
PageRouteBuilder
You can just use MaterialPageBuilder
instead of PageRouteBuilder
.
To play video, you can look into this.
example:
import 'package:chewie/chewie.dart';
final playerWidget = new Chewie(
new VideoPlayerController(
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'
),
aspectRatio: 3 / 2,
autoPlay: true,
looping: true,
);
onPressed:() => Navigator.of(context).push(new MaterialPageRoute(
pageBuilder: (BuildContext context) {
return new Container(child: playerWidget);
},
)),
Hope this helped!