import 'package:chat/configs/app_colors.dart';
import 'package:flutter/material.dart';

class SearchPage extends StatefulWidget {
  const SearchPage({Key? key}) : super(key: key);

  @override
  State<SearchPage> createState() => _SearchPageState();
}

class _SearchPageState extends State<SearchPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.white,
      appBar: AppBar(
        title: Container(
          constraints: const BoxConstraints(
            maxHeight: 32,
          ),
          child: ClipRRect(
            borderRadius: BorderRadius.circular(32),
            child: TextField(
              onChanged: (e) async {},
              autofocus: true,
              decoration: const InputDecoration(
                hintText: '请输入搜索内容',
                hintStyle: TextStyle(
                  fontSize: 14,
                  color: AppColors.unactive,
                ),
                border: InputBorder.none,
                focusedBorder: InputBorder.none,
                fillColor: AppColors.white,
                filled: true,
                contentPadding: EdgeInsets.only(
                  bottom: 14,
                  left: 16,
                ),
              ),
              cursorColor: AppColors.primary,
            ),
          ),
        ),
        actions: <Widget>[
          IconButton(
            icon: const Icon(
              Icons.search,
              color: AppColors.black,
            ),
            onPressed: () {},
          ),
        ],
      ),
    );
  }
}
