SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. abstract class CustomState<T extends StatefulWidget> extends State<T> {
  2.   ThemeData get theme => Theme.of(context);
  3.  
  4.   TextTheme get textTheme => theme.textTheme;
  5.  
  6.   Translations get translation => Translations.of(context);
  7. }
  8.  
  9. class MyWidget extends StatefulWidget {
  10.   @override
  11.   _MyWidgetState createState() => _MyWidgetState();
  12. }
  13.  
  14. class _MyWidgetState extends CustomState<MyWidget> {
  15.   @override
  16.   Widget build(BuildContext context) {
  17.     print(textTheme);
  18.     print(translation);
  19.     print(theme);
  20.     return Container();
  21.   }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top