I just run the basic flutter code. I want to make stateful widget, only containing Text("hi") so I write my code like below
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Container(child: Text("hi");
}
}
but I got error No Directionality widget found. RichText widgets require a Directionality widget ancestor
I can fix my error to add textDirection attribute, but I wonder when I use Text I didn't get that error even if I don't use that attribute. I just want to use only Text, Container