Improve seed grid sizing (#2687)

* Attempt to improve seed grid layout and sizing

* Cleanup
This commit is contained in:
tuxsudo
2025-12-02 00:19:27 +01:00
committed by GitHub
parent 4f41817361
commit 1d715d3963
+19 -3
View File
@@ -8,13 +8,27 @@ class SeedPhraseGridWidget extends StatelessWidget {
final List<String> list;
@override
Widget build(BuildContext context) {
double desiredTileWidth = 120;
double spacing = 4;
double padding = 4;
double screenWidth = MediaQuery.of(context).size.width;
int crossAxisCount =
((screenWidth + spacing - (2 * padding)) / (desiredTileWidth + spacing))
.floor();
if (crossAxisCount < 1) crossAxisCount = 1;
return GridView.builder(
itemCount: list.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 2.8,
crossAxisCount: crossAxisCount,
childAspectRatio: 2.6,
mainAxisSpacing: 8.0,
crossAxisSpacing: 8.0,
),
@@ -41,6 +55,8 @@ class SeedPhraseGridWidget extends StatelessWidget {
fontWeight: FontWeight.w700,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
),
softWrap: true,
maxLines: null,
),
),
const SizedBox(width: 6),
@@ -48,7 +64,7 @@ class SeedPhraseGridWidget extends StatelessWidget {
child: Text(
'${item[0].toLowerCase()}${item.substring(1)}',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
height: 1.9,
height: 1,
fontWeight: FontWeight.w700,
color: Theme.of(context).colorScheme.onSurface,
),