Closed webbosolutions closed 1 year ago
Let say, you have a page that shows video from somewhere, like below:
class MyVideoPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('A page suppose to show video'),
ElevatedButton(
onPressed: () {
print('button pressed!');
},
child: Text('Next'),
),
],
),
);
}
}
When press Next, you want to continue to houzi screens, you'll move all existing code from main()
function to lets say houzi_function()
. and you'll call this functionality from button press event like this:
onPressed: () {
print('button pressed!');
houzi_function();
},
and you'll show this page as first screen from main function like this:
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyVideoPage(),
);
}
}
I've attached the main.dart file here. That first shows a page, and when click it takes you to houzi screens. You can replace your main.dart with this one to test the functionality. Don't forget to remove .txt extension from the file name.
You can modify MyVideoPage
according to your needs. When done, just call houzi_function();
method and it'll show houzi screens.
Thanks For Reply But Do You mean the page that show video is it real code i mean if i copy your video page code will work but where i add video source please i understand now i have 2 pages main dart and video page is it right?
I have just given you an example page. You'll need to develop video page yourself.
thanks
We need To Add Introduction Video splash screen