We will create class for Roboto font family. Just simple create a dart class name styles.dart and save the below code.
final robotoRegular = TextStyle(
fontFamily: 'Roboto',
fontWeight: FontWeight.w400,
fontSize: 12,
);
final robotoMedium = TextStyle(
fontFamily: 'Roboto',
fontWeight: FontWeight.w500,
fontSize: 12,
);
final robotoBold = TextStyle(
fontFamily: 'Roboto',
fontWeight: FontWeight.w700,
fontSize: 12,
);
final robotoBlack = TextStyle(
fontFamily: 'Roboto',
fontWeight: FontWeight.w900,
fontSize: 12,
);
Each of the TextStyle class returns an TextStyle object. So for Text() widget style you can call any of them based on your needs.
If you wanna style your text like
Text("style text", style:robotoRegular);
The above line is good enough to call custom style from UI.