1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import 'package:farmer_client/pages/home/widgets/home/widgets/headers.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
-
- import '../../widgets/CarsCard.dart';
- import '../../widgets/Search.dart';
-
- class MoreCars extends StatefulWidget {
- const MoreCars({Key? key}) : super(key: key);
-
- @override
- State<MoreCars> createState() => _MoreCarsState();
- }
-
- class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
- late TabController _controller =
- TabController(length: tabText.length, vsync: this);
- List<String> tabText = [
- '全部',
- '播种机',
- '收割机',
- '挺长名字的农机选项分类',
- ];
-
- @override
- void initState() {
- // TODO: implement initState
- super.initState();
- }
-
- @override
- Widget build(BuildContext context) {
- // _controller=TabController(length: tabText.length, vsync: this);
- return Scaffold(
- resizeToAvoidBottomInset: false,
- appBar: AppBar(
- centerTitle: true,
- backgroundColor: Colors.transparent,
- foregroundColor: const Color(0xFF333333),
- elevation: 0,
- toolbarHeight: 44.w,
- title: Text(
- '更多',
- style: TextStyle(
- color: const Color(0xFF333333),
- fontWeight: FontWeight.bold,
- fontSize: 17.sp,
- letterSpacing: 2),
- ),
- ),
- body: SafeArea(
- child: Container(
- decoration: BoxDecoration(color: Colors.white),
- child: ListView(children: [
- Column(
- children: [
- Container(
- padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
- width: 350.w,
- child: TypeHeader(
- type: false,
- ),
- ),
- TabBar(
- labelStyle: TextStyle(
- fontSize: ScreenUtil().setSp(19),
- fontWeight: FontWeight.bold), //选中的样式
- unselectedLabelStyle:
- TextStyle(fontSize: ScreenUtil().setSp(16)), //未选中的样式
- controller: _controller,
- isScrollable: true, //可滚动
- indicatorColor: Colors.black, //指示器的颜色
- labelColor: Colors.black, //选中文字颜色
- unselectedLabelColor: Color(0xffadadad),
- // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
- tabs: tabText.map((e) => Tab(text: e)).toList(),
- onTap: (int i) {
- print('当前+${i}');
- },
- ),
- Container(
- child: Column(
- children: [],
- ),
- )
- ],
- )
- ]),
- )));
- }
- }
|