mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
Improve seed grid sizing (#2687)
* Attempt to improve seed grid layout and sizing * Cleanup
This commit is contained in:
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user