index.dart 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:sport/pages/game/game_info.dart';
  4. import 'package:sport/pages/game/rank_info.dart';
  5. import 'package:sport/pages/home/home_info_page.dart';
  6. class GamePage extends StatefulWidget {
  7. @override
  8. State<StatefulWidget> createState() {
  9. return _GamePageState();
  10. }
  11. }
  12. class _GamePageState extends State<GamePage> with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
  13. @override
  14. bool get wantKeepAlive => true;
  15. @override
  16. void didChangeDependencies() {
  17. super.didChangeDependencies();
  18. }
  19. @override
  20. Widget build(BuildContext context) {
  21. super.build(context);
  22. return Scaffold(
  23. appBar: AppBar(
  24. backgroundColor: Theme.of(context).scaffoldBackgroundColor,
  25. elevation: 0, // 去掉AppBar下面的阴影
  26. title: Text("运动项目", style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600, height: 1.2, color: const Color(0xff333333)),),
  27. ),
  28. body: GameInfoView(),);
  29. // return DefaultTabController(
  30. // length: 2,
  31. // child: Scaffold(
  32. // appBar: AppBar(
  33. // backgroundColor: Theme.of(context).scaffoldBackgroundColor,
  34. // elevation: 0, // 去掉AppBar下面的阴影
  35. // title: indexTabBar(["运动项目", "运动榜单"]),
  36. // ),
  37. // body: Container(
  38. // child: TabBarView(
  39. // physics: const NeverScrollableScrollPhysics(),
  40. // children: <Widget>[
  41. // // 运动的View
  42. // GameInfoView(),
  43. // // 榜单的View
  44. // RankInfo(),
  45. // ],
  46. // ),
  47. // )),
  48. // );
  49. }
  50. }