32 lines
975 B
Dart
32 lines
975 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||
|
import 'package:jisho_study_tool/bloc/search/search_bloc.dart';
|
||
|
import 'package:jisho_study_tool/view/components/search/LanguageSelector.dart';
|
||
|
|
||
|
class SearchBar extends StatelessWidget {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||
|
child: Column(
|
||
|
children: [
|
||
|
TextField(
|
||
|
onSubmitted: (text) => BlocProvider.of<SearchBloc>(context)
|
||
|
.add(GetSearchResults(text)),
|
||
|
controller: TextEditingController(),
|
||
|
decoration: InputDecoration(
|
||
|
labelText: 'Search',
|
||
|
border: OutlineInputBorder(
|
||
|
borderRadius: BorderRadius.circular(10.0),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
SizedBox(
|
||
|
height: 10.0,
|
||
|
),
|
||
|
LanguageSelector()
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|