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

Time:01-13

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

CodePudding user response:

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

CodePudding user response:

You can use titleTextStyle like this:

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

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