Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support dartdoc generation #138

Merged
merged 7 commits into from
Oct 21, 2021
Merged

feat: support dartdoc generation #138

merged 7 commits into from
Oct 21, 2021

Conversation

wasabeef
Copy link
Member

@wasabeef wasabeef commented Oct 19, 2021

What does this change?

  • Added dartdoc generation.

before

  AssetGenImage get chip5 => const AssetGenImage('pictures/chip5.jpg');

  static const Color gray410 = Color(0xFF979797);

  static const MaterialAccentColor yellowOcherAccent = MaterialAccentColor(
    0xFFFFBCA3,
    <int, Color>{
      100: Color(0xFFFFE8E0),
      200: Color(0xFFFFBCA3),
      400: Color(0xFFFFA989),
      700: Color(0xFFFF9E7A),
    },
  );

  static const String raleway = 'Raleway';

after

  /// File path: pictures/chip5.jpg
  AssetGenImage get chip5 => const AssetGenImage('pictures/chip5.jpg');

  /// Color: #979797
  static const Color gray410 = Color(0xFF979797);

  /// MaterialAccentColor:
  ///   100: #FFFFE8E0
  ///   200: #FFFFBCA3
  ///   400: #FFFFA989
  ///   700: #FFFF9E7A
  static const MaterialAccentColor yellowOcherAccent = MaterialAccentColor(
    0xFFFFBCA3,
    <int, Color>{
      100: Color(0xFFFFE8E0),
      200: Color(0xFFFFBCA3),
      400: Color(0xFFFFA989),
      700: Color(0xFFFF9E7A),
    },
  );

  /// Font family: Raleway
  static const String raleway = 'Raleway';

@wasabeef wasabeef added this to the 4.0.1 milestone Oct 19, 2021
@@ -29,7 +29,7 @@ String generateColors(
buffer.writeln("import 'package:flutter/material.dart';");
buffer.writeln();
buffer.writeln('class ColorName {');
buffer.writeln(' ColorName._();');
buffer.writeln('ColorName._();');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary because of using DartFormatter.

@@ -21,11 +21,12 @@ String generateFonts(
buffer.writeln(header);
buffer.writeln(ignoreAnalysis);
buffer.writeln('class FontFamily {');
buffer.writeln(' FontFamily._();');
buffer.writeln('FontFamily._();');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary because of using DartFormatter.

}

String _assetsClassDefinition(List<_Statement> statements) {
final statementsBlock = statements
.map((statement) => ' ${statement.toStaticFieldString()}')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary because of using DartFormatter.

@@ -313,7 +335,11 @@ String _directoryClassGenDefinition(
List<_Statement> statements,
) {
final statementsBlock = statements
.map((statement) => ' ${statement.toGetterString()}')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary because of using DartFormatter.

@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #138 (27aa95b) into main (be15ba6) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 27aa95b differs from pull request most recent head caea89a. Consider uploading reports for the commit caea89a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
+ Coverage   98.86%   98.91%   +0.04%     
==========================================
  Files          17       17              
  Lines         529      551      +22     
==========================================
+ Hits          523      545      +22     
  Misses          6        6              
Impacted Files Coverage Δ
packages/core/lib/generators/assets_generator.dart 100.00% <100.00%> (ø)
packages/core/lib/generators/colors_generator.dart 98.33% <100.00%> (+0.11%) ⬆️
packages/core/lib/generators/fonts_generator.dart 100.00% <100.00%> (ø)
packages/core/lib/utils/color.dart 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be15ba6...caea89a. Read the comment docs.

@wasabeef wasabeef added the enhancement New feature or request label Oct 19, 2021
@wasabeef wasabeef changed the title feat: support dartdoc generation []feat: support dartdoc generation Oct 20, 2021
@wasabeef wasabeef changed the title []feat: support dartdoc generation [WIP] feat: support dartdoc generation Oct 20, 2021
@wasabeef wasabeef modified the milestones: 4.0.1, 4.1.0 Oct 21, 2021
@wasabeef wasabeef changed the title [WIP] feat: support dartdoc generation feat: support dartdoc generation Oct 21, 2021
@wasabeef wasabeef requested a review from lcdsmao October 21, 2021 05:58
Copy link
Member

@lcdsmao lcdsmao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

packages/core/lib/utils/color.dart Outdated Show resolved Hide resolved
wasabeef and others added 2 commits October 21, 2021 21:08
@wasabeef wasabeef merged commit 160fd60 into main Oct 21, 2021
@wasabeef wasabeef deleted the gen-dartdoc branch October 21, 2021 13:24
@wasabeef wasabeef mentioned this pull request Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants