forked from flutter/flutter
/
card_template.dart
34 lines (27 loc) · 1.05 KB
/
card_template.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
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'template.dart';
class CardTemplate extends TokenTemplate {
const CardTemplate(super.blockName, super.fileName, super.tokens);
@override
String generate() => '''
// Generated version ${tokens["version"]}
class _${blockName}DefaultsM3 extends CardTheme {
const _${blockName}DefaultsM3(this.context)
: super(
clipBehavior: Clip.none,
elevation: ${elevation("md.comp.elevated-card.container")},
margin: const EdgeInsets.all(4.0),
shape: ${shape("md.comp.elevated-card.container")},
);
final BuildContext context;
@override
Color? get color => ${componentColor("md.comp.elevated-card.container")};
@override
Color? get shadowColor => ${colorOrTransparent("md.comp.elevated-card.container.shadow-color")};
@override
Color? get surfaceTintColor => ${colorOrTransparent("md.comp.elevated-card.container.surface-tint-layer.color")};
}
''';
}