Skip to content

Commit

Permalink
Merge pull request #13 from josecleiton/main
Browse files Browse the repository at this point in the history
[FIX] Add override annotation on MaterialColor generation
  • Loading branch information
frederikstonge committed Mar 25, 2024
2 parents b20e952 + 5f25b67 commit b5dc8f4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/figma2flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import 'package:figma2flutter/transformers/size_transformer.dart';
import 'package:figma2flutter/transformers/spacing_transformer.dart';
import 'package:figma2flutter/transformers/typography_transformer.dart';
import 'package:figma2flutter/utils/sets_and_themes.dart';
import 'package:path/path.dart';

/// Code for making terminal output foreground red
const _red = '\x1b[033;0;31m';
Expand Down
1 change: 1 addition & 0 deletions lib/transformers/material_color_transformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class MaterialColorTransformer extends MultiTokenTransformer {
// Add the color to the lines
lines.add(
'''
@override
MaterialColor get $name => const MaterialColor($primary, {
${colors.map((e) => '${e.digit}: ${e.color.declaration(isConst: false)}').join(',\n ')},
});
Expand Down
1 change: 1 addition & 0 deletions test/transformers/material_color_transformer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void main() {
expect(
transformer.lines[0],
equals('''
@override
MaterialColor get primary => const MaterialColor(0xFF0EA5E9, {
50: Color(0xFFF0FAFF),
100: Color(0xFFE0F5FE),
Expand Down

0 comments on commit b5dc8f4

Please sign in to comment.