Updated gen_defaults to use new JSON output from the Material token database. (#97596)

This commit is contained in:
Darren Austin
2022-02-02 10:22:57 -08:00
committed by GitHub
parent 32abf42a00
commit 97124d7bf9
38 changed files with 1213 additions and 1076 deletions

View File

@@ -97,6 +97,21 @@ static final String tokenBar = 'bar';
tempDir.deleteSync(recursive: true);
}
});
test('Templates can get proper shapes from given data', () {
const Map<String, dynamic> tokens = <String, dynamic>{
'foo.shape': 'shape.large',
'shape.large': <String, dynamic>{
'family': 'SHAPE_FAMILY_ROUNDED_CORNERS',
'topLeft': 1.0,
'topRight': 2.0,
'bottomLeft': 3.0,
'bottomRight': 4.0,
}
};
final TestTemplate template = TestTemplate('foobar.dart', tokens);
expect(template.shape('foo.shape'), 'const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(1.0), topRight: Radius.circular(2.0), bottomLeft: Radius.circular(3.0), bottomRight: Radius.circular(4.0)))');
});
}
class TestTemplate extends TokenTemplate {