Flutter style의 'title'은 deprecated가 되어 'headline6'이 된 모양.

4995 단어 DartFlutter

어느 날, title이 deprecated가 되었다. .



Flutter 스타일에서 사용하는 titletitle입니다. .


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    initializeDateFormatting('ja');
    return MaterialApp(
      title: 'Persona Expenses',
      theme: ThemeData(
          primarySwatch: Colors.red,
          accentColor: Colors.amber,
          fontFamily: 'Quicksand',
          textTheme: ThemeData.light().textTheme.copyWith(
              title: TextStyle(
                  fontFamily: 'OpenSans',
                  fontSize: 18,
                  fontWeight: FontWeight.bold)),
      home: MyHomePage(),
    );
  }
}

headline6 사용하기




class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    initializeDateFormatting('ja');
    return MaterialApp(
      title: 'Persona Expenses',
      theme: ThemeData(
          primarySwatch: Colors.red,
          accentColor: Colors.amber,
          fontFamily: 'Quicksand',
          textTheme: ThemeData.light().textTheme.copyWith(
             // 変更!
              headline6: TextStyle(
                  fontFamily: 'OpenSans',
                  fontSize: 18,
                  fontWeight: FontWeight.bold)),
      home: MyHomePage(),
    );
  }
}

참고

좋은 웹페이지 즐겨찾기