ui improve

This commit is contained in:
Simon Ding
2024-07-04 15:43:47 +08:00
parent ba4e4de5b3
commit be96f7f000
2 changed files with 37 additions and 21 deletions

View File

@@ -88,13 +88,13 @@ class _MyHomePageState extends State<MyHomePage> {
// the App.build method, and use it to set our appbar title. // the App.build method, and use it to set our appbar title.
title: Text(widget.title), title: Text(widget.title),
), ),
body: Center( body: const Center(
// Center is a layout widget. It takes a single child and positions it // Center is a layout widget. It takes a single child and positions it
// in the middle of the parent. // in the middle of the parent.
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
NavDrawer(), NavDrawer(),
const SearchPage(), SearchPage(),
], ],
)), )),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(

View File

@@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:ui/APIs.dart'; import 'package:ui/APIs.dart';
@@ -38,7 +37,14 @@ class _SearchPageState extends State<SearchPage> {
for (final item in list) { for (final item in list) {
var m = item as Map<String, dynamic>; var m = item as Map<String, dynamic>;
cards.add(Card( cards.add(Card(
margin: const EdgeInsets.all(10), margin: const EdgeInsets.all(4),
clipBehavior: Clip.hardEdge,
child: InkWell(
//splashColor: Colors.blue.withAlpha(30),
onTap: () {
//showDialog(context: context, builder: builder)
debugPrint('Card tapped.');
},
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
@@ -52,12 +58,22 @@ class _SearchPageState extends State<SearchPage> {
), ),
), ),
Flexible( Flexible(
child: ListTile(title: Text(m["name"])), child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
m["name"],
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.bold),
), ),
Flexible(child: Text(m["overview"])) const Text(""),
Text(m["overview"])
], ],
), ),
)); )
],
),
)));
} }
return Expanded( return Expanded(