기본 widget을 사용하다보면 영어로 되어있는것을 볼수 있다 .(ex)datepicker

바꿔보자

 

일단 pubspec.yaml의 디펜던시에 추가

dependencies:
  flutter:
    sdk: flutter
    
  flutter_localizations: //추가
    sdk: flutter//추가

 

 

 

 

 

main으로가서 

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "현지",
      localizationsDelegates: [ //추가
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: [ //추가
        const Locale('ko'),
      ],
    );
  }
}

 

 

 

 

widget들 변할걸 볼수있다 

반응형

'flutter > study' 카테고리의 다른 글

firebase dynamiclink 만들기  (0) 2023.03.03
google map 연동  (0) 2022.09.25
money comma  (0) 2021.11.05
TextField 사용시 바깥부분 터치시 focus 잃게하는방법  (0) 2021.07.28
app 이름 변경  (0) 2021.07.21

textField사용시 왠만하면 넣어야할듯 

 

최상위에 GestureDetector를 넣고 아래 내용 추가 

class Touch extends StatelessWidget {
  const Touch({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: () {
          FocusScopeNode currentFocus = FocusScope.of(context);
          if (!currentFocus.hasPrimaryFocus) {
            currentFocus.unfocus();
          }
        },
        child: Scaffold()
    );
  }
}

or

SystemChannels.textInput.invokeMethod('TextInput.hide');

 

or 

 

추가

SingleChildScrollView( //or listview
              keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
              )

이놈을 넣으면 바깥쪽눌렀을때 바로 포커스를 잃지는않지만 스크롤시 잃는다 

 

참고 : https://flutterigniter.com/dismiss-keyboard-form-lose-focus/

반응형

'flutter > study' 카테고리의 다른 글

firebase dynamiclink 만들기  (0) 2023.03.03
google map 연동  (0) 2022.09.25
money comma  (0) 2021.11.05
flutter 현지화  (0) 2021.07.28
app 이름 변경  (0) 2021.07.21

virtual Machine setting -> options -> shared folders 에 always enabled 체크 후 add눌러서 공유할파일위치 선정

 

 

 

 

finder의 환경설정 클릭 후 연결된 서버 누르면 vmware shared folders가 생기면 거기서 빼쓰면된다

 

반응형

+ Recent posts