home_scene.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:shuqi/public.dart';
  4. import 'home_list_view.dart';
  5. class HomeScene extends StatefulWidget {
  6. @override
  7. State<StatefulWidget> createState() => HomeSceneState();
  8. }
  9. class HomeSceneState extends State<HomeScene> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return DefaultTabController(
  13. length: 4,
  14. child: Scaffold(
  15. appBar: AppBar(
  16. systemOverlayStyle: SystemUiOverlayStyle.dark,
  17. title: Container(
  18. padding: EdgeInsets.symmetric(horizontal: 15),
  19. child: TabBar(
  20. labelColor: SQColor.darkGray,
  21. labelStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
  22. unselectedLabelColor: SQColor.gray,
  23. indicatorColor: SQColor.secondary,
  24. indicatorSize: TabBarIndicatorSize.label,
  25. indicatorWeight: 3,
  26. indicatorPadding: EdgeInsets.fromLTRB(8, 0, 8, 5),
  27. tabs: [
  28. Tab(text: '精选'),
  29. Tab(text: '女生'),
  30. Tab(text: '男生'),
  31. Tab(text: '漫画'),
  32. ],
  33. ),
  34. ),
  35. backgroundColor: SQColor.white,
  36. elevation: 0,
  37. ),
  38. body: TabBarView(children: [
  39. HomeListView(HomeListType.excellent),
  40. HomeListView(HomeListType.female),
  41. HomeListView(HomeListType.male),
  42. HomeListView(HomeListType.cartoon),
  43. ]),
  44. ),
  45. );
  46. }
  47. }