1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
-
- class TypeHeader extends StatefulWidget {
- TypeHeader({Key? key, required this.type}) : super(key: key);
-
- final bool type;
-
- @override
- State<TypeHeader> createState() => _TypeHeaderState();
- }
-
- class _TypeHeaderState extends State<TypeHeader> {
- @override
- Widget build(BuildContext context) {
- if (widget.type) {
- return
- Container(
- height: 32.w,
- decoration: BoxDecoration(color: Colors.white),
- child: Row(
- children: [
- Image(
- image: AssetImage('images/gpsImgae.png'),
- fit: BoxFit.cover,
- width: 14.w,
- height: 17.h,
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
- child: Text(
- '邓州市',
- style: TextStyle(
- color: Color(0xff202020),
- fontSize: 16.sp,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
- child: Icon(Icons.arrow_drop_down),
- ),
- Expanded(
- flex: 1,
- child:_initWidget(),
- ),
- ],
- ),
- );
- } else {
- return _initWidget();
- }
- }
- }
- //
-
- class _initWidget extends StatelessWidget {
- const _initWidget({Key? key}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return Container(
- height: 32.w,
- decoration: const BoxDecoration(color: Colors.white),
- child: GestureDetector(
- onTap: () {
- print('点击了搜索');
- Get.toNamed('/searchPage');
- },
- child: Container(
- decoration: const BoxDecoration(
- // color: Colors.red,
- color: Color(0x30cccccc),
- borderRadius: BorderRadius.all(Radius.circular(25)),
- ),
- child: Row(
- children: [
- Padding(
- padding: EdgeInsets.fromLTRB(10.w, 0, 5, 0),
- child: Icon(
- Icons.search,
- size: 19,
- color: Color(0xff666666),
- ),
- ),
- Text(
- '请输入关键字查询',
- style: TextStyle(color: Color(0xff666666), fontSize: 14),
- )
- ],
- ),
- )
- // Search(),
- ));
- }
- }
|