728x90 반응형 프로그램 개발해서 돈벌기165 Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] "Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]" 에러는 안드로이드 API 31 이후 버전에서 발생하고 있습니다. 아래와 같이 처리해 줍니다. flutter 프로젝트에서 andoroid > app > src > main 내에 있는 "AndroidManifest.xml" 파일 내 LAUNCHER activity에 android:exported="true"를 추가해 주면 해결됩니다. 2023. 3. 28. flutter에서 Row와 Column 내 텍스트 왼쪽 정렬 및 여백 Row Flutter의 Row 위젯은 자식 위젯을 수평으로 정렬하는 위젯입니다. 자식 위젯을 왼쪽에 붙이기 위해서는 MainAxisAlignment 속성을 사용하여 자식 위젯들을 왼쪽으로 정렬할 수 있습니다. 아래는 Row 위젯 내부에 Text 위젯을 왼쪽에 붙이는 예시 코드입니다. Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Text('왼쪽에 붙일 텍스트'), // 추가적인 자식 위젯들 ], ) 위 코드에서 MainAxisAlignment.start는 자식 위젯들을 Row 위젯의 시작 부분에 정렬하도록 설정하는 것입니다. 이렇게 설정하면 Text 위젯이 Row 위젯의 좌측에 붙어 출력됩니다. 필요에 따라 추가적인 자식 위젯을 childre.. 2023. 3. 23. flutter에서 MaterialApp 배경색 변경 MaterialApp에서 Scaffold 위젯 내 backgroundColor 프로퍼티를 사용하여 배경색을 바꾸어 줍니다. 배경색을 다크 그레이로 변경하는 샘플 코드입니다. import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( backgroundColor: Colors.grey[800], // Set background color to dark gray appBar: AppBar( title: Text('My App'.. 2023. 3. 23. 안드로이드 코틀린에서 싱글톤과 gc 메모리 사용 단점 안드로이드 코틀린에서 싱글톤 패턴(Singleton Pattern)을 사용하면 객체를 전역적으로 사용할 수 있기 때문에 코드의 재사용성과 유지보수성이 높아질 수 있습니다. 하지만 싱글톤 패턴은 메모리 누수(Memory Leak)를 발생시킬 수 있는 단점이 있습니다. 싱글톤 객체가 생성된 후에는 앱이 종료될 때까지 메모리를 점유하고 있기 때문에, 객체가 사용되지 않더라도 메모리를 계속 점유하고 있을 수 있습니다. 이로 인해 메모리 사용량이 증가하여 앱의 성능에 영향을 미칠 수 있습니다. 또한, 가비지 컬렉션(Garbage Collection) 메모리 사용에 대한 단점도 있습니다. 안드로이드에서는 가비지 컬렉션을 통해 더 이상 사용되지 않는 객체를 메모리에서 제거합니다. 그러나 싱글톤 객체는 앱이 종료될 때.. 2023. 3. 23. flutter 버튼 중 onFocusChange를 갖고 있는 버튼들은? Flutter에서 onFocusChange 이벤트를 가진 버튼은 ElevatedButton, TextButton, OutlinedButton입니다. 이들 버튼 위젯에는 포커스를 받거나 잃을 때 호출되는 onFocusChange 콜백 함수가 있습니다. 이 콜백 함수는 bool 값을 매개변수로 받으며, 포커스를 받았을 때 true를, 포커스를 잃었을 때 false를 전달합니다. 예를 들어 ElevatedButton에서 onFocusChange 이벤트를 사용하는 방법은 다음과 같습니다. ElevatedButton( onPressed: () { // 버튼이 눌렸을 때 실행되는 로직 }, onFocusChange: (isFocused) { if (isFocused) { // 버튼이 포커스를 받았을 때 실행되는 로.. 2023. 3. 23. flutter에서 OutlinedButton width 변경 방법 SizeBox 사용 SizedBox( width: 200, // set the width to 200 child: OutlinedButton( onPressed: () { // add your onPressed logic here }, child: Text('My Button'), ), ); Container 사용 Container( width: 200, // set the width to 200 child: OutlinedButton( onPressed: () { // add your onPressed logic here }, child: Text('My Button'), ), ); container 미국∙영국 [kənˈteɪnə(r)] 1. 그릇, 용기 2. (화물 수송용) 컨테이너 2023. 3. 23. 이전 1 ··· 11 12 13 14 15 16 17 ··· 28 다음 728x90 반응형