wlmaker 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +7 -6
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -550,9 +550,6 @@ part 'wl_${name}_i18n.dart';
|
|
|
550
550
|
part 'wl_${name}_skeleton.dart';
|
|
551
551
|
|
|
552
552
|
class Wl${pascal} extends StatelessWidget {
|
|
553
|
-
final Wl${pascal}Variant variant;
|
|
554
|
-
final Wl${pascal}I18n i18n;
|
|
555
|
-
|
|
556
553
|
factory Wl${pascal}({
|
|
557
554
|
required Wl${pascal}I18n i18n,
|
|
558
555
|
Key? key,
|
|
@@ -581,6 +578,9 @@ class Wl${pascal} extends StatelessWidget {
|
|
|
581
578
|
super.key,
|
|
582
579
|
});
|
|
583
580
|
|
|
581
|
+
final Wl${pascal}Variant variant;
|
|
582
|
+
final Wl${pascal}I18n i18n;
|
|
583
|
+
|
|
584
584
|
@override
|
|
585
585
|
Widget build(BuildContext context) {
|
|
586
586
|
final theme = context.theme;
|
|
@@ -702,7 +702,8 @@ class Wl${pascal}Skeleton extends StatelessWidget {
|
|
|
702
702
|
`
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
function useCaseTemplate(name, pascal, tierPlural3) {
|
|
705
|
+
function useCaseTemplate(name, pascal, tierPlural3, tier) {
|
|
706
|
+
const widgetCall = tier === "organism" || tier === "template" ? `const Wl${pascal}(i18n: Wl${pascal}I18n())` : `const Wl${pascal}()`;
|
|
706
707
|
return `import 'package:design_system/design_system.dart';
|
|
707
708
|
import 'package:flutter/material.dart';
|
|
708
709
|
import 'package:widgetbook/widgetbook.dart';
|
|
@@ -714,7 +715,7 @@ import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
|
|
|
714
715
|
path: 'wl_design_system/${tierPlural3}/wl_${name}',
|
|
715
716
|
)
|
|
716
717
|
Widget useCaseWl${pascal}(BuildContext context) {
|
|
717
|
-
return
|
|
718
|
+
return ${widgetCall};
|
|
718
719
|
}
|
|
719
720
|
`;
|
|
720
721
|
}
|
|
@@ -924,7 +925,7 @@ async function createUseCase(name, tierInput, options) {
|
|
|
924
925
|
}
|
|
925
926
|
fs7.writeFileSync(
|
|
926
927
|
useCasePath,
|
|
927
|
-
useCaseTemplate(cleanName, pascal, plural)
|
|
928
|
+
useCaseTemplate(cleanName, pascal, plural, tier)
|
|
928
929
|
);
|
|
929
930
|
console.log(
|
|
930
931
|
chalk3.green(
|