material-components-flutter-codelabs icon indicating copy to clipboard operation
material-components-flutter-codelabs copied to clipboard

deprecated code exists

Open keilvher1 opened this issue 1 year ago • 4 comments

Column( children: <Widget>[ 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 avatar Apr 01 '24 06:04 keilvher1

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

keilvher1 avatar Apr 01 '24 06:04 keilvher1

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

keilvher1 avatar Apr 01 '24 06:04 keilvher1

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'

Amunoz-1 avatar Apr 03 '24 20:04 Amunoz-1

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

chenkigba avatar Aug 22 '24 07:08 chenkigba