简体   繁体   中英

what is replacement for textTheme in flutter. I'm getting following error

I'm new to flutter getting this error. can anyone please help with this? trying to and text styles.

在此处输入图像描述

import 'package:flutter/material.dart';
import 'screens/location_detail/location_detail.dart';
import 'style.dart';


class App extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
   return MaterialApp(
     home:LocationDetail(),
     theme:ThemeData(
       appBarTheme: AppBarTheme(
         textTheme: TextTheme(title: AppBarTextStyle)
       )
     )
   );
  }
}

You can use toolBarTextStyle and titleTextStyle instead of textTheme . For more details please refer below link textTheme

You can use titleTextStyle like this:

appBarTheme: AppBarTheme(
     titleTextStyle: TextStyle(color: Colors.blue)
)

appBar: AppBar(
    title: Text(
      ' ',
      style: Theme.of(context).appBarTheme.titleTextStyle,
    ),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM