| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:go_router/go_router.dart';
- import '../../widget/my_txt.dart';
- /// @author: bo.zeng
- /// @email: cnhbwds@gmail.com
- /// @date: 2025 2025/4/25 13:15
- /// @description:
- class SearchBarWidget extends StatelessWidget {
- final int tabIndex;
- const SearchBarWidget({super.key, required this.tabIndex});
- @override
- Widget build(BuildContext context) {
- if (tabIndex == 3 ) {
- return const SizedBox.shrink();
- } else {
- return GestureDetector(
- onTap: () {
- if (tabIndex == 0) {
- context.push("/search");
- } else if (tabIndex == 2){
- context.push("/video/search");
- } else if (tabIndex == 1) {
- context.push("/activity/search");
- }
- },
- child: Container(
- height: 32.h,
- decoration: BoxDecoration(
- shape: BoxShape.rectangle,
- borderRadius: BorderRadius.circular(30.0.r),
- color: Colors.white,
- ),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(width: 5.w),
- Icon(Icons.search_outlined, color: Colors.grey, size: 30.w),
- myTxt(text: "输入您想搜索的内容", fontSize: 16.sp, color: Colors.grey),
- ],
- ),
- ),
- );
- }
- }
- }
|