Skip to content

Commit

Permalink
Chore/doc improvements (#164)
Browse files Browse the repository at this point in the history
* Update doc compoennts

* Update comments and dartdoc options

* Added flex, and text widget documentation

* Update docs

* Theming wip

* Revert some changes on flex

* Update docs

* Update conflicts

* ran formatting

* Updates

* Renamed widget state utilities

* Update test
  • Loading branch information
leoafarias authored Jan 24, 2024
1 parent b964c25 commit 6349ade
Show file tree
Hide file tree
Showing 91 changed files with 2,859 additions and 2,555 deletions.
1,290 changes: 652 additions & 638 deletions coverage/lcov.info

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
dartdoc:
showStats: true
categories:
"Widgets":
name: Widgets
"Second Category":
name: Great
categoryOrder: ["Widgets", "Second Category"]
nodoc: ['lib/src/deprecations.dart']

2 changes: 1 addition & 1 deletion demo/lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AppShell extends HookConsumerWidget {
final darkMode = ref.watch(darkModeProvider);

return MixTheme(
data: MixThemeData.withMaterialTokens(),
data: MixThemeData.withMaterial(),
child: AdaptiveNavigationScaffold(
appBar: AppBar(
title: const Text('Mix Gallery'),
Expand Down
2 changes: 1 addition & 1 deletion demo/lib/components/box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
Widget boxDecorationContainer(BuildContext context) {
final boxStyle = Style(
backgroundColor.red(),
onPress(
onPressed(
backgroundColor.blue(),
),
opacity(0.5),
Expand Down
10 changes: 5 additions & 5 deletions demo/lib/docs/variants/catalog/pressable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class VariantsCatalogPressable extends StatelessWidget {
'Hover',
Style(
onHover(
box.border(color: $colors.primary(), width: 2),
box.border(color: $md.colorScheme.primary(), width: 2),
box.padding(4.0),
),
),
Expand All @@ -21,8 +21,8 @@ class VariantsCatalogPressable extends StatelessWidget {
buildBlock(
'Focus',
Style(
onFocus(
box.border(color: $colors.primary(), width: 2),
onFocused(
box.border(color: $md.colorScheme.primary(), width: 2),
box.padding(4.0),
),
),
Expand All @@ -32,9 +32,9 @@ class VariantsCatalogPressable extends StatelessWidget {
buildBlock(
'Press',
Style(
onPress(
onPressed(
box.border(
color: $colors.primary(),
color: $md.colorScheme.primary(),
width: 2,
),
box.padding(4.0),
Expand Down
8 changes: 4 additions & 4 deletions demo/lib/docs/variants/default.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class VariantsDefaultExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
final style = Style(
box.color($colors.secondary()),
text.style.color.of($colors.onSecondary),
box.color($md.colorScheme.secondary()),
text.style.color.of($md.colorScheme.onSecondary),
onHover(
box.color.of($colors.primary),
text.style(color: $colors.onPrimary()),
box.color.of($md.colorScheme.primary),
text.style(color: $md.colorScheme.onPrimary()),
),
);

Expand Down
10 changes: 5 additions & 5 deletions demo/lib/views/basic_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class BasicExample extends HookWidget {
box.borderRadius(10),
box.shapeDecoration.color.white(),
text.style.color.white(),
onPress(
onPressed(
box.color(Colors.black),
),
onHover(
opacity(0.5),
),
onLongPress(
onLongPressed(
box.color(Colors.green),
),
);
Expand Down Expand Up @@ -79,10 +79,10 @@ class BasicExample extends HookWidget {
style: onSurfaceMix.merge(
Style(
onLight(
text.style.color.of($colors.error),
text.style.color.of($md.colorScheme.error),
),
onDark(
text.style.color.of($colors.primary),
text.style.color.of($md.colorScheme.primary),
),
),
),
Expand Down Expand Up @@ -117,7 +117,7 @@ class BasicExample extends HookWidget {
style: onSurfaceMix.merge(
Style(
icon.size(70),
icon.color.of($colors.secondary),
icon.color.of($md.colorScheme.secondary),
),
),
),
Expand Down
12 changes: 6 additions & 6 deletions demo/lib/views/button_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ButtonSizeVariants {

Style get _baseStyle => Style(
box.borderRadius(4),
onPress(
onPressed(
scale(0.95),
),
flex.mainAxisAlignment.center(),
Expand All @@ -32,7 +32,7 @@ Style get _baseStyle => Style(
decoration: TextDecoration.none,
fontWeight: FontWeight.w600,
),
text.style.of($textStyles.bodySmall),
text.style.of($md.textTheme.bodySmall),
flex.mainAxisSize.min(),
ButtonSizeVariants.small(
box.padding.horizontal(10),
Expand Down Expand Up @@ -143,11 +143,11 @@ Style get _style => Style(
color: const Color(0xFFFF004C),
),
box.color(const Color(0x0F07E2FF)),
icon.color.of($colors.onBackground),
icon.color.of($md.colorScheme.onBackground),
onDisabled(
box.color.of($colors.background),
text.style.color.of($colors.onBackground),
icon.color.of($colors.onBackground),
box.color.of($md.colorScheme.background),
text.style.color.of($md.colorScheme.onBackground),
icon.color.of($md.colorScheme.onBackground),
),
);

Expand Down
10 changes: 5 additions & 5 deletions demo/lib/views/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ class CustomMixWidget extends StatelessWidget {
box.margin.vertical(10),
box.elevation(10),
box.borderRadius(10),
box.color($colors.primary()),
text.style.of($textStyles.bodyMedium),
text.style(color: $colors.onPrimary()),
box.color($md.colorScheme.primary()),
text.style.of($md.textTheme.bodyMedium),
text.style(color: $md.colorScheme.onPrimary()),
onHover(
box.elevation(2),
box.padding(20),
box.color.of($colors.secondary),
text.style.color.of($colors.onSecondary),
box.color.of($md.colorScheme.secondary),
text.style.color.of($md.colorScheme.onSecondary),
),
);

Expand Down
4 changes: 2 additions & 2 deletions demo/lib/views/layout_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Style get mix => Style(
box.width(300),
box.borderRadius(10),
box.elevation(2),
box.color.of($colors.surface),
box.color.of($md.colorScheme.surface),
box.alignment.center(),
text.style.color.of($colors.onSurface),
text.style.color.of($md.colorScheme.onSurface),
);

class LayoutExample extends StatelessWidget {
Expand Down
12 changes: 6 additions & 6 deletions demo/lib/views/typography_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import 'package:mix/mix.dart';
import '../styles.dart';

Style get button => Style(
text.style.of($textStyles.bodyMedium),
text.style.of($md.textTheme.bodyMedium),
box.padding.top(10),
text.style.bold(),
text.style(fontSize: 6.0),
box.color.of($colors.primary),
box.color.of($md.colorScheme.primary),
onHover(
box.color.of($colors.secondary),
box.color.of($md.colorScheme.secondary),
),
box.padding(8, 15),
);
Expand Down Expand Up @@ -38,22 +38,22 @@ class TypographyExample extends StatelessWidget {
style: headingMix.merge(
Style(
text.style(
color: $colors.surface(),
color: $md.colorScheme.surface(),
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
letterSpacing: 2,
wordSpacing: 2,
height: 1.5,
shadows: [
Shadow(
color: $colors.secondary(),
color: $md.colorScheme.secondary(),
offset: const Offset(2, 2),
blurRadius: 2,
),
],
),
onDark(
text.style.color.of($colors.surface),
text.style.color.of($md.colorScheme.surface),
),
),
),
Expand Down
14 changes: 7 additions & 7 deletions demo/lib/views/variants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ class VariantsExample extends HookWidget {
);

final style = Style(
box.color($colors.primary()),
text.style(color: $colors.onPrimary()),
box.color($md.colorScheme.primary()),
text.style(color: $md.colorScheme.onPrimary()),
onHover(
box.color($colors.secondary()),
text.style(color: $colors.onPrimary()),
box.color($md.colorScheme.secondary()),
text.style(color: $md.colorScheme.onPrimary()),
),
).merge(baseStyle);

final onDarkStyle = Style(
box.color($colors.primary()),
text.style(color: $colors.onPrimary()),
box.color($md.colorScheme.primary()),
text.style(color: $md.colorScheme.onPrimary()),
onDark(
box.color(Colors.red),
text.style(color: $colors.onPrimary()),
text.style(color: $md.colorScheme.onPrimary()),
),
).merge(baseStyle);

Expand Down
2 changes: 1 addition & 1 deletion demo/lib/widgetbook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class WidgetbookApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MixTheme(
data: MixThemeData.withMaterialTokens(),
data: MixThemeData.withMaterial(),
child: Widgetbook.material(
directories: directories,
addons: [materialTheme],
Expand Down
84 changes: 0 additions & 84 deletions lib/exports.dart

This file was deleted.

Loading

0 comments on commit 6349ade

Please sign in to comment.