Flutter 47

[Flutter] iOS 빌드 오류 - XcodeBuild Error by Dependency Package

flutter xcodebuild: error: Could not resolve package dependencies: checksum of downloaded artifact of binary target 'FirebaseFirestore' (4a0070c4bf7e5ab59359dd8a0e68f402f3ec6c1e189fc39cc44ca88418f26ac4) does not match checksum specified by the manifest 위와 같은 FirebaseFirestore 패키지 오류가 났었는데, Xcode 캐시 지우고, Flutter 재빌드하고 해봤는데 아무런 소용이 없었다. 나의 경우는 Xcode 의 의존성 패키지를 업데이트하니깐 관련 오류가 해결이 되었다. 참고 : https://..

Dev/Flutter 2023.07.24

[Flutter] ListView.Builder 를 사용할때 주의할 점

ListView.builder or ListView.seperated 를 사용해서 리스트를 구현할때, UI 관점에서 주의할 점이 있습니다. ListView 를 생성해서 UI 만들어진 리스트를 보게되면 위 아래 공백이 생깁니다. 자세히 보다보니 ListView 에는 기본적인 Padding 값이 존재합니다. 그렇기때문에 Padding 값을 설정하고 ListView 를 만들어줘야 합니다. ListView.separated( shrinkWrap: true, padding: EdgeInsets.zero, itemCount: items.length, separatorBuilder: (BuildContext context, int index) => const SizedBox(height: 15), itemBuilde..

Dev/Flutter 2022.12.23

[Flutter] Border 테두리 - 라운드 사각형 디자인

플러터로 테두리에 라인을 그리는 형태의 박스를 디자인 하기 위해서 Container 위젯을 사용해도 되고, Card 위젯을 사용해서 구현하면 됩니다. Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Colors.white, border: Border.all(color: color), ), padding: const EdgeInsets.only(left: 6, right: 6, top: 4, bottom: 4), child: item, ) Card( elevation: 0, margin: EdgeInsets.zero, shape: RoundedRectangleBorder( side: BorderSide(..

Dev/Flutter 2022.12.07

[Flutter] Mockito 를 이용한 테스트 코드 설정 방법

Mock 클래스 셋팅 방법 1. yaml 설정 dev_dependencies: flutter_test: sdk: flutter mockito: ^5.3.2 build_runner: ^2.3.2 2. 테스트 진행할 클래스 파일의 Mock 클래스 생성 class MainViewModelMock extends Mock implements MainViewModel {} 3. main() 함수 위에 Generate 선언 @GenerateMocks([MainViewModelMock]) void main() { .... } 4. 터미널에서 Mock 파일 생성 flutter pub run build_runner build 5. 테스트를 진행할 main() 함수에서 Mock 클래서 선언 및 호출 late MockMain..

Dev/Flutter 2022.11.25

[Flutter] Http 통신 @GET으로 Json 데이터 전송이 가능한가?

1. 기본적으로 HTTP 통신에서 GET 으로 JSON 데이터 전송 가능 기본적으로 HTTP 통신으로 GET 으로 JSON 데이터를 Body 에 싣어서 보내기가 가능한것 같습니다. https://stackoverflow.com/questions/978061/http-get-with-request-body HTTP GET with request body I'm developing a new RESTful webservice for our application. When doing a GET on certain entities, clients can request the contents of the entity. If they want to add some parameters (for example s.....

Dev/Flutter 2022.11.23

[Flutter] 라운드 형태 TextFiled 만드는 방법

Radius 값을 준 라운드 형태의 텍스트 필드를 구현하기 위해서 Card 위제을 사용해서 shape 에 Border 값을 주면 됩니다. Card( elevation: 0, shape: RoundedRectangleBorder( side: BorderSide( color: Theme.of(context).colorScheme.outline, ), borderRadius: const BorderRadius.all(Radius.circular(12)), ), child: const SizedBox( width: 300, height: 100, child: Center(child: Text('Outlined Card')), ), ) 여기서 기본적으로 Card 위젯은 기본 margin 값(4)을 가지고 있다는것..

Dev/Flutter 2022.11.15

Flutter - Android new GradleException 이슈

Flutter 에서 build.gradle 에서 GradleException 이 빨갛게 표시가 되어서 매우 거슬릴 수 있습니다. (저는 거슬렸습니다....) def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } 여기서 GradleException() 대신에 FileNotFoundException() 으로 수정해줘야 한다. 이유: Update GradleException() to FileNotFou..

Dev/Flutter 2022.05.10