반응형
이슈
No Directionality widget found.
Stack widgets require a Directionality widget ancestor to resolve the 'alignment' argument.
The default value for 'alignment' is AlignmentDirectional.topStart, which requires a text direction.
The specific widget that could not find a Directionality ancestor was:
Stack
The ownership chain for the affected widget is: Stack Padding & ClipPath #
DecoratedBox & ConstrainedBox & Container &
Column & Iphone16ProMax1 &
_FocusInheritedScope
_FocusScopeWithExternalFocusNode #
Typically, the Directionality widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree. It determines the ambient reading direction and is used, for example, to determine how to lay out text, how to interpret "start" and "end" values, and to resolve EdgeInsetsDirectional, AlignmentDirectional, and other "Directional" objects.
Instead of providing a Directionality widget, another solution would be passing a non-directional 'alignment', or an explicit 'textDirection', to the Stack.
See also: https://docs.flutter.dev/testing/errors
해결
figma to code 이용해서 하다가 위 에러가 발생해서 찾아본 결과
간단히 main 함수를 고쳤더니 해결되었다.
void main() {
runApp(
MaterialApp(
home: Iphone16ProMax1(), // 루트 위젯 설정
),
);
}
반응형
'개발 > fluttter' 카테고리의 다른 글
[flutter] figma to code 이용해보기 (0) | 2025.01.15 |
---|---|
[flutter] figma2flutter 이용해보기 (0) | 2025.01.15 |