main.dart
で定義しているaccentColorがdeprecatedに
VSCodeの機能で簡単に解決!
Quick Fix>Migrate to 'ColorScheme.secondary'
を選択
これで以下のような形になるかと
main.dart
child: MaterialApp(
title: 'Title',
theme: ThemeData(
primaryColor: HexColor('F8EEF4'),
colorScheme:
ColorScheme.fromSwatch().copyWith(secondary: Colors.yellow[100]),
),
Theme.of(context).colorScheme.secondary
で使います
style: ElevatedButton.styleFrom(
primary: Theme.of(context).colorScheme.secondary,
onPrimary: Colors.black,
shape: const StadiumBorder(),
),