How to use typography of material angular dart components with Dart 2?

Issue

I wanted to use the material typography in the components with the help of material angular_dart components. How can I do that?
app_component.html

<section class="layout">
    <h1 class="headline">The headline goes here!</h1>
    <h2 class="sub-headline">Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.</h2>
    <div class="body-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
</section>

app_component.scss

@import 'package:angular_components/css/material/material';

:host {

}

.headline {

}

.sub-headline {
}

.body-text {

}

Solution

There are a bunch of mixins you can use here:

For your example:

@import 'package:angular_components/css/material/material';

.headline {
  @include mat-font-headline;
}

.sub-headline {
  @include mat-font-subhead;
}

.body-text {
  @include mat-font-body;
}

enter image description here

Answered By – Ted Sander

Answer Checked By – Cary Denson (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *