mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
feat: detail card fit small screen
This commit is contained in:
@@ -24,6 +24,8 @@ class DetailCard extends ConsumerStatefulWidget {
|
|||||||
class _DetailCardState extends ConsumerState<DetailCard> {
|
class _DetailCardState extends ConsumerState<DetailCard> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
@@ -41,7 +43,7 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[screenWidth<600? SizedBox():
|
||||||
Flexible(
|
Flexible(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -89,7 +91,7 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
|||||||
const Text(""),
|
const Text(""),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
overflow: TextOverflow.visible,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 9,
|
maxLines: 9,
|
||||||
widget.details.overview ?? "",
|
widget.details.overview ?? "",
|
||||||
)),
|
)),
|
||||||
|
|||||||
Reference in New Issue
Block a user