index.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. ],
  44. ),
  45. );
  46. }
  47. Widget buildButton(String text, Widget targetPage) {
  48. return FlatButton(
  49. onPressed: () {
  50. Navigator.push(context, MaterialPageRoute(builder: (_) => targetPage));
  51. },
  52. child: Text(text),
  53. );
  54. }
  55. }