No Directionality widget found. InkWell widgets require a Directionality widget ancestor. You have to add a MaterialApp widget before container, like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class _MyStatefullWidgetState extends State<MyStatefullWidget> { @override Widget build(BuildContext context) { return MaterialApp( home: Container( color: Colors.red, child: Center( child: RaisedButton( child: Text("klick mich", textDirection: TextDirection.ltr), onPressed: () { print("Hi"); }, ), ), ), ); } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.