2021-03-05 22:12:04 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:jisho_study_tool/bloc/search/search_bloc.dart';
|
2021-08-03 22:13:50 +02:00
|
|
|
import 'package:jisho_study_tool/view/components/search/language_selector.dart';
|
2021-03-05 22:12:04 +01:00
|
|
|
|
|
|
|
class SearchBar extends StatelessWidget {
|
2021-08-03 22:13:50 +02:00
|
|
|
|
|
|
|
const SearchBar();
|
|
|
|
|
2021-03-05 22:12:04 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
TextField(
|
2021-07-17 12:19:03 +02:00
|
|
|
onSubmitted: (text) {
|
|
|
|
BlocProvider.of<SearchBloc>(context)
|
|
|
|
.add(GetSearchResults(text));
|
|
|
|
},
|
2021-03-05 22:12:04 +01:00
|
|
|
controller: TextEditingController(),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
labelText: 'Search',
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
LanguageSelector()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|