index.jsx.dart 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import 'package:farmer_client/widgets/NullCard.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import '../../widgets/CarsCard.dart';
  5. class SearchPage extends StatefulWidget {
  6. const SearchPage({Key? key}) : super(key: key);
  7. @override
  8. State<SearchPage> createState() => _SearchPage();
  9. }
  10. class _SearchPage extends State<SearchPage> {
  11. @override
  12. Widget build(BuildContext context) {
  13. return Scaffold(
  14. resizeToAvoidBottomInset: false,
  15. appBar: AppBar(
  16. elevation: 0,
  17. centerTitle: true,
  18. backgroundColor: Colors.white,
  19. title: Text(
  20. '搜索',
  21. style: TextStyle(
  22. color: Colors.black,
  23. fontSize: 17.sp,
  24. letterSpacing: 2,
  25. fontWeight: FontWeight.bold),
  26. ),
  27. ),
  28. body: Container(
  29. decoration: const BoxDecoration(
  30. color: Colors.white,
  31. ),
  32. child: ListView(children: [
  33. Container(
  34. width: 345.w,
  35. height: 34.h,
  36. margin: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w),
  37. padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10.w),
  38. decoration: BoxDecoration(
  39. color: Color(0xFFf8f8f8),
  40. borderRadius: BorderRadius.all(Radius.circular(17.w))),
  41. child: Row(
  42. mainAxisAlignment: MainAxisAlignment.center,
  43. children: [
  44. Image.asset(
  45. 'images/icons/search.png',
  46. width: 15.w,
  47. height: 15.w,
  48. ),
  49. Container(
  50. width: 300.w,
  51. margin: EdgeInsets.fromLTRB(5.w, 0, 0, 0),
  52. child: TextField(
  53. style: TextStyle(fontSize: 14.sp),
  54. decoration: const InputDecoration(
  55. isCollapsed: true,
  56. hintText: '搜索关键字查询',
  57. border: InputBorder.none,
  58. counterText: '', //去掉计数
  59. floatingLabelBehavior: FloatingLabelBehavior.never,
  60. ),
  61. onChanged: (e) {
  62. print(999);
  63. setState(() {});
  64. },
  65. ),
  66. ),
  67. ],
  68. ),
  69. ),
  70. Container(
  71. child: Column(
  72. children: [
  73. // NullCard(text: '暂无农机信息'),
  74. CarsCard(),
  75. CarsCard(),
  76. CarsCard(),
  77. CarsCard(),
  78. ],
  79. ),
  80. )
  81. ])),
  82. );
  83. }
  84. }