material-components / material-components-flutter-codelabs

Codelabs for Material Components for Flutter
212 stars 244 forks source link

deprecated code exists #300

Open keilvher1 opened 5 months ago

keilvher1 commented 5 months ago

Column( children: [ Image.asset('assets/diamond.png'), const SizedBox(height: 16.0), Text( 'SHRINE', style: Theme.of(context).textTheme.headline5, ), ], )

headline5 has deprecated. So change it to headlineSmall

keilvher1 commented 5 months ago

caption: base.caption!.copyWith( fontWeight: FontWeight.w400, fontSize: 14.0, ), caption is also deprecated. change it to bodySmall

keilvher1 commented 5 months ago

bodyText1: base.bodyText1!.copyWith( fontWeight: FontWeight.w500, fontSize: 16.0, ), bodyText1 to bodyLarge. code will be with you.

Amunoz-1 commented 5 months ago

Step 5 - Towards the end:

Finally, let's have the Cancel button use the secondary color rather than the primary for increased contrast.

TextButton(
child: const Text('CANCEL'),
onPressed: () {
_usernameController.clear();
_passwordController.clear();
},
style: TextButton.styleFrom(
primary: Theme.of(context).colorScheme.secondary,
),
),

had to change 'primary' to 'foregroundColor'

chenkigba commented 3 weeks ago

headline5 -> headlineLarge headline6 -> titleLarge caption -> bodySmall bodyText1 -> bodyLarge