From 55857bd92cd394b32ae1a454b42580ae570e20cf Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Wed, 25 Jun 2025 17:06:20 +0200 Subject: [PATCH] rebuilt tile to be reusable and added TextOverflow behaviour --- .../widgets/double_row_info_tile.dart | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 lib/presentation/widgets/double_row_info_tile.dart diff --git a/lib/presentation/widgets/double_row_info_tile.dart b/lib/presentation/widgets/double_row_info_tile.dart new file mode 100644 index 0000000..621cc74 --- /dev/null +++ b/lib/presentation/widgets/double_row_info_tile.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; +import 'package:game_tracker/core/custom_theme.dart'; + +Widget doubleRowInfoTile( + String titleOneUpperLeft, + String titleTwoUpperLeft, + String titleUpperRight, + String titleLowerLeft, + String titleLowerRight, +) { + return Container( + margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: CustomTheme.secondaryColor, + ), + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 10, + child: Text( + "$titleOneUpperLeft $titleTwoUpperLeft", + style: TextStyle(fontSize: 20), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + Spacer(), + Expanded( + flex: 3, + child: Text( + "$titleUpperRight", + style: TextStyle(fontSize: 20), + overflow: TextOverflow.ellipsis, + maxLines: 1, + textAlign: TextAlign.end, + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 10, + child: Text( + "$titleLowerLeft", + style: TextStyle(fontSize: 20), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + Spacer(), + Expanded( + flex: 4, + child: Text( + "$titleLowerRight", + style: TextStyle(fontSize: 20), + overflow: TextOverflow.ellipsis, + maxLines: 1, + textAlign: TextAlign.end, + ), + ), + ], + ), + ], + ), + ); +}