You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
import 'package:flutter/material.dart';
 | 
						|
import 'package:test_sa/extensions/context_extension.dart';
 | 
						|
import 'package:test_sa/new_views/app_style/app_color.dart';
 | 
						|
 | 
						|
class AppSearchField extends StatefulWidget {
 | 
						|
  final Function(String) onChanged;
 | 
						|
  final Function(String) onSubmitted;
 | 
						|
 | 
						|
  const AppSearchField({Key key, this.onChanged, this.onSubmitted}) : super(key: key);
 | 
						|
 | 
						|
  @override
 | 
						|
  State<AppSearchField> createState() => _AppSearchFieldState();
 | 
						|
}
 | 
						|
 | 
						|
class _AppSearchFieldState extends State<AppSearchField> {
 | 
						|
  @override
 | 
						|
  Widget build(BuildContext context) {
 | 
						|
    return TextField(
 | 
						|
      onChanged: widget.onChanged,
 | 
						|
      onSubmitted: widget.onSubmitted,
 | 
						|
      decoration: InputDecoration(
 | 
						|
          prefixIcon: const Icon(
 | 
						|
            Icons.search,
 | 
						|
            color: AppColor.neutral20,
 | 
						|
          ),
 | 
						|
          hintText: context.translation.search,
 | 
						|
          hintStyle: TextStyle(fontSize: Theme.of(context).textTheme.bodySmall.fontSize),
 | 
						|
          filled: true,
 | 
						|
          fillColor: AppColor.neutral30,
 | 
						|
          border: OutlineInputBorder(
 | 
						|
            borderRadius: BorderRadius.circular(15),
 | 
						|
            borderSide: BorderSide.none,
 | 
						|
          )),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |