-
Notifications
You must be signed in to change notification settings - Fork 0
/
assets.dart
85 lines (80 loc) · 1.87 KB
/
assets.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
abstract interface class Asset {}
@widgetbook.UseCase(
path: '[AVM]',
name: 'icons',
type: Asset,
)
Widget previewIcons(BuildContext context) {
final files = [
'menu.svg',
'qr_code_scanner.svg',
];
const double spacing = 8;
return GridView.extent(
primary: true,
maxCrossAxisExtent: 64,
mainAxisSpacing: spacing,
crossAxisSpacing: spacing,
children: [
for (final file in files)
Padding(
padding: const EdgeInsets.all(8),
child: Container(
color: const Color(0xFFC0C0C0),
child: SvgPicture.asset(
"assets/icons/$file",
),
),
)
],
);
}
@widgetbook.UseCase(
path: '[AVM]',
name: 'images',
type: Asset,
)
Widget previewImages(BuildContext context) {
final files = [
'close.svg',
'danger.svg',
'info.svg',
'lock.svg',
'notification.svg',
'tick.svg',
];
const double spacing = 8;
return GridView.extent(
primary: true,
maxCrossAxisExtent: 140,
padding: const EdgeInsets.all(spacing),
mainAxisSpacing: spacing,
crossAxisSpacing: spacing,
childAspectRatio: 0.65,
children: [
for (final file in files)
Container(
color: const Color(0xFFC0C0C0),
child: Column(
children: [
SvgPicture.asset(
"assets/images/$file",
width: 120,
height: 120,
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
file,
textAlign: TextAlign.center,
),
)
],
),
)
],
);
}