Add text to search card

pull/4/head
Oystein Kristoffer Tveit 2020-08-19 16:27:00 +02:00
parent 42a6f5e412
commit b5f983d377
1 changed files with 25 additions and 27 deletions

View File

@ -4,38 +4,36 @@ import 'package:unofficial_jisho_api/api.dart';
class SearchResultCard extends StatelessWidget {
final JishoResult _result;
const SearchResultCard(this._result);
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
child: Container(
child: Center(
child: Text(_result.toJson().toString()),
),
height: 50.0,
margin: EdgeInsets.symmetric(
horizontal: 20.0,
vertical: 20.0,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 1,
offset: Offset(2, 2), // changes position of shadow
)
]),
),
),
],
return Container(
child: Column(
children: [
Text(_result.slug),
Text(_result.senses.toString()),
],
),
alignment: Alignment.center,
height: 50.0,
margin: EdgeInsets.symmetric(
horizontal: 20.0,
vertical: 20.0,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 1,
offset: Offset(2, 2), // changes position of shadow
)
]),
);
}
SearchResultCard(this._result);
}