index.dart 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/material.dart';
  2. import 'package:ijkplayer_example/page/paging_page.dart';
  3. import 'package:ijkplayer_example/page/screen_shot_page.dart';
  4. import 'package:ijkplayer_example/page/video_list.dart';
  5. import '../i18n/i18n.dart';
  6. import 'error_url.dart';
  7. import 'asset_page.dart';
  8. import 'controller_stream_use.dart';
  9. import 'custom_ijk_opt_page.dart';
  10. import 'dialog_video_page.dart';
  11. import 'full_screen.dart';
  12. import 'gallery_page.dart';
  13. import 'ijk_status_page.dart';
  14. import 'in_overlay_page.dart';
  15. import 'network.dart';
  16. class IndexPage extends StatefulWidget {
  17. @override
  18. _IndexPageState createState() => _IndexPageState();
  19. }
  20. class _IndexPageState extends State<IndexPage> {
  21. @override
  22. Widget build(BuildContext context) {
  23. return Scaffold(
  24. appBar: AppBar(
  25. title: Text(currentI18n.indexTitle),
  26. ),
  27. body: ListView(
  28. children: <Widget>[
  29. buildButton(currentI18n.networkButton, NetworkPage()),
  30. buildButton(currentI18n.photoButton, PlayGalleryPage()),
  31. buildButton(currentI18n.assetButton, AssetPage()),
  32. buildButton(currentI18n.listViewButton, VideoList()),
  33. buildButton(currentI18n.fullScreenAutoButton, FullScreen()),
  34. buildButton(currentI18n.fullScreenManualButton, FullScreen2()),
  35. buildButton(currentI18n.withDialogButton, DialogVideoPage()),
  36. buildButton(currentI18n.pageViewButton, PagingPickPage()),
  37. buildButton(currentI18n.useStreamUsage, ControllerStreamUsagePage()),
  38. buildButton(currentI18n.screenshotTitle, ScreenShotPage()),
  39. buildButton(currentI18n.overlayPageTitle, InOverlayPage()),
  40. buildButton(currentI18n.ijkStatusTitle, IjkStatusPage()),
  41. buildButton(currentI18n.customOption, CustomIjkOptionPage()),
  42. buildButton(currentI18n.errorUrl, ErrorUrlPage()),
  43. buildButton(
  44. currentI18n.customFullScreenWidget, CustomFullControllerPage()),
  45. ],
  46. ),
  47. );
  48. }
  49. Widget buildButton(String text, Widget targetPage) {
  50. return FlatButton(
  51. onPressed: () {
  52. Navigator.push(context, MaterialPageRoute(builder: (_) => targetPage));
  53. },
  54. child: Text(text),
  55. );
  56. }
  57. }