Skip to content

Commit e0c8b62

Browse files
committed
Rename style vars and simplify showcase examples
Rename style variables for consistency and simplify the example widgets in the homepage showcases. In directives_showcase.dart, titleStyle was renamed to title and the example now returns title('hello world') (removed the subtitle and surrounding Column). In styling_showcase.dart and variants_showcase.dart, boxStyle/cardStyle were renamed to box and examples now directly return box() or box(child: ...) for a simpler, more consistent demo API.
1 parent f547778 commit e0c8b62

3 files changed

Lines changed: 6 additions & 19 deletions

File tree

packages/mix_docs_preview/lib/homepage/directives_showcase.dart

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,13 @@ class Example extends StatelessWidget {
1515
@override
1616
Widget build(BuildContext context) {
1717
// #docregion showcase
18-
final titleStyle = TextStyler()
18+
final title = TextStyler()
1919
.fontSize(20)
2020
.fontWeight(.w700)
2121
.color(Colors.white)
2222
.uppercase();
2323

24-
final subtitleStyle = TextStyler()
25-
.fontSize(14)
26-
.color(Colors.white70)
27-
.capitalize();
28-
29-
return Column(
30-
mainAxisSize: MainAxisSize.min,
31-
crossAxisAlignment: CrossAxisAlignment.start,
32-
children: [
33-
titleStyle('hello world'),
34-
const SizedBox(height: 4),
35-
subtitleStyle('style transforms built in'),
36-
],
37-
);
24+
return title('hello world');
3825
// #enddocregion showcase
3926
}
4027
}

packages/mix_docs_preview/lib/homepage/styling_showcase.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class Example extends StatelessWidget {
1515
@override
1616
Widget build(BuildContext context) {
1717
// #docregion showcase
18-
final boxStyle = BoxStyler()
18+
final box = BoxStyler()
1919
.size(120, 120)
2020
.borderRadius(.circular(16))
2121
.color(Colors.deepPurple);
2222

23-
return boxStyle();
23+
return box();
2424
// #enddocregion showcase
2525
}
2626
}

packages/mix_docs_preview/lib/homepage/variants_showcase.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Example extends StatelessWidget {
1414
@override
1515
Widget build(BuildContext context) {
1616
// #docregion showcase
17-
final cardStyle = BoxStyler()
17+
final box = BoxStyler()
1818
.size(120, 120)
1919
.borderRadius(.circular(16))
2020
.color(Colors.cyan)
@@ -23,7 +23,7 @@ class Example extends StatelessWidget {
2323
.scale(1)
2424
.onHovered(.color(Colors.cyanAccent).scale(1.2));
2525

26-
return cardStyle(
26+
return box(
2727
child: const Text(
2828
'Hover',
2929
style: TextStyle(color: Colors.white, fontSize: 16),

0 commit comments

Comments
 (0)