반응형

 ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.9.1)
  ════════════════════════════════════════════


✓ Successfully generated launcher icons
Unhandled exception:
FormatException: Invalid number (at character 1)

^

#0      int._handleFormatError (dart:core-patch/integers_patch.dart:129:7)
#1      int.parse (dart:core-patch/integers_patch.dart:55:14)
#2      minSdk (package:flutter_launcher_icons/android.dart:309:18)
#3      createIconsFromConfig (package:flutter_launcher_icons/main.dart:94:47)
#4      createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7)
#5      main (file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/bin/main.dart:6:26)
#6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255

 

플러터 버전 : 2.10.2

다트 버전 : 2.16.1

패키지를 이용해서 런처 아이콘 적용하려고 했으나 위와 같은 에러 발생

파일 : app/build.gradle

수정

 - before : minSdkVersion flutter.minSdkVersion

 - after : minSdkVersion 23

반응형
반응형

에러

┌─ Flutter Fix ─────────────────────────────────────────
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update
│ D:\00.Project\01.Mobile\search_app\android\build.gradle:
│ ext.kotlin_version = '<latest-version>'
└───────────────────────────────────────────────
 

수정 내용

위치 : android\build.gradle

before

 ext.kotlin_version = '1.3.50'

after
 ext.kotlin_version = '1.6.10'

반응형
반응형

before

dependencies:
  flutter:
    sdk: flutter

after (2줄 추가 flutter_localizations:)

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

 

ex) main.dart

MaterialApp(
      title: 'Hello, Flutter',
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: [
        Locale('ko', 'KR'),
        // Locale('es', ''), // Spanish, no country code
      ],
    );

 

참고 링크:

Internationalizing Flutter apps | Flutter

 

Internationalizing Flutter apps

How to internationalize your Flutter app.

docs.flutter.dev

GlobalMaterialLocalizations class - flutter_localizations library - Dart API

country_code_picker | Flutter Package (pub.dev)

 

country_code_picker | Flutter Package

A flutter package for showing a country code selector. In addition it gives the possibility to select a list of favorites countries, as well as to search using a simple searchbox

pub.dev

 

반응형
반응형

패키지 : intl | Dart Package (pub.dev)

 

intl | Dart Package

Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.

pub.dev

사용법 : DateFormat('yyyy/MM/dd').format(DateTime.now()), -> 2022/01/01

반응형
반응형

두군데서 개발을 하다보니 업그레이드 하다가 에러가 발생하는 경우가 생김

아래와 같이 flutter upgrade 시도시 에러가 날때 force 명령어를 사용해서 강제로 업그레이드를 시도해주자

 

Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is
recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to
remove local changes, then re-run this command with "--force".

 

강제 업그레이드

 -> flutter upgrade --force

 

개발문구는 그나마 볼만하긴한데, 가끔은 에러 문구도 다국어 처리 해주는 것도 나쁘지 않을듯 하네

(어디까지나 내가 영어가 짧아서 그런거겠지 ㅎㅎㅎ)

반응형

'01.모바일 > Flutter' 카테고리의 다른 글

[Flutter] 한글 표시  (0) 2022.03.01
[Flutter] DateFormat  (0) 2022.03.01
[Flutter] 디버깅 시작 방법  (0) 2022.02.26
[Flutter] 지원 디바이스 추가  (0) 2022.02.26
[Flutter] Cascade(..) 문법 쩜쩜  (0) 2022.02.26
반응형

종류별 시작 방법

1) flutter run -d windows

2) flutter run -d edge

3) flutter run -d android

4) flutter run -d ios

반응형
반응형

지원 디바이스 추가

 1) flutter create --platforms=windows .

※ 마지막에 쩜을 잘 추가해 주자

추가 가능 종류

   -> android, ios, windows, web

반응형
반응형

공식 문서

https://dart.dev/guides/language/language-tour#cascade-notation

 

A tour of the Dart language

A tour of all the major Dart language features.

dart.dev

단순하게 생각하면 객체 멤버 변수에 대한 접근을 보다 간결하게 할 수 있도록 해줌

before

Hello hello = Hello();

hello.title = "타이틀";

hello.body = "몸뚱아리";

 

after

Hello()

..title = "타이틀";

..body = "몸뚱아리";

반응형
반응형

Custom Appbar에 넣은 Expanded에서 위의 에러가 발생

상위 위젯에 Stack을 사용해서 발생한 것으로 보임.

암튼 해당 에러가 발생하면 찾아서 지워보자. ㅎㅎ

 

The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.

 

The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData.

Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
The offending Expanded is currently placed inside a ColoredBox widget.

 

반응형
반응형

환경

 - Visual Studio 2022

 - Visual Studio Code

 - Flutter Version : 2.8.1

 - Dart Version : 2.15.1

 

생성 방법

 1) flutter devices

   -> desktop 환경이 추가되어 있는지 확인

 2) flutter config --enable-windows-desktop (※ desktop 개발환경이 추가 안되어 있을 경우에만)

 3) 프로젝트를 만들고자 하는 폴더로 이동

   -> ex) cd c:\project

 4) flutter create --platforms=windows "프로젝트명"

   -> ex) flutter create --platforms=windows hello_flutter

 5) c:\project 폴더에 hello_flutter 프로젝트가 생김

   -> 생성된 폴더 : c:\project\hello_flutter

 6) 프로젝트 폴더로 이동 : cd hello_flutter

 7) flutter run -d windows : 프로젝트 디버깅 시작(프로젝트 만들고 한번 실행해보는 것이 좋음)

 

지원 디바이스 추가

 1) flutter create --platforms=windows .

반응형

+ Recent posts