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.

enter image description here

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)
       )
     )
   );
  }
}

2 answers

  • answered 2022-01-13 05:21 Vaidarbhi

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

  • answered 2022-01-13 05:35 Rohith Nambiar

    You can use titleTextStyle like this:

    appBarTheme: AppBarTheme(
         titleTextStyle: TextStyle(color: Colors.blue)
    )
    
    appBar: AppBar(
        title: Text(
          ' ',
          style: Theme.of(context).appBarTheme.titleTextStyle,
        ),
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum