본문 바로가기

Flutter

(80)
[j Flutter] Getx -> 페이지 이동 1. 페이지 이동을 테스트하기위해 세 개의 페이지를 만들어 준다. -> homepage,firstpage,secendpage 2. homepage에서 firstpage로 페이지를 이동 Get.to(FirstPage()); to() 안에 페이지만 써주면 간단하게 끝난다. 다음은 Get으로 페이지 이동시, 닫았을 때 로그가 나타나는 것을 볼 수 있다. 3. secendpage에서 homepage로 이동 - 페이지 히스토리가 남지않게 한다. Get.offAll(Home()); 4. 뒤로이동 Get.back();
[j Flutter] flutter 2.0 ver - 새로운 버튼 정리 Flutter 2.0 ver 새로운 버튼 정리 1. FlatButton -> TextButton TextButton( onPressed: () {}, child: Text("Text Button"), style: TextButton.styleFrom( primary: Colors.red, //글자색 onSurface: Colors.blue, //onpressed가 null일때 색상 backgroundColor: Colors.green, shadowColor: Colors.orange, //그림자 색상 elevation: 1, // 버튼 입체감 textStyle: TextStyle(fontWeight: FontWeight.bold), padding: EdgeInsets.all(16.0), minimumSi..
[j Flutter] Button class 2021변경사항 일부 Button 클래스가 변경이 되었다. 해당 관련 문서 링크 ↓↓↓ docs.google.com/document/d/1yohSuYrvyya5V1hB6j9pJskavCdVq9sVeTqSoEPsWH0/edit Migrating to the New Material Buttons and their Themes SUMMARY A guide to migrating existing apps to the new Flutter button classes and their themes. Author: Hans Muller (@hansmuller) Go Link: flutter.dev/go/material-button-migration-guide Created: August 2020 / Last updated: Augu..
[j Flutter] Debug, Release 모드에서 Log 찍기 #로그 #debug #release Debug 모드와 Release 모드를 확인 한 후 로그 찍는 법을 구현해보자. 1. foundation.dart 를 import 해준다. import 'package:flutter/foundation.dart'; 2. if 문으로 Debug 모드와 Release 모드를 확인 한 후 print로 로그를 구현한다. if (kDebugMode) { print("디버그 모드 입니다."); }else if (kReleaseMode) { print("릴리즈 모드 입니다."); }
[j Flutter] Text 스타일 지정하기 ( 자간, 글자크기, 색상, 줄 간격) Text 스타일을 지정해보자. Text( 'TextStyle 지정.\n' 'TextStyle 설정.', style: TextStyle( fontSize: 25, letterSpacing: 1.0, wordSpacing: 2.0, height: 1.2, color: Colors.grey[600], )); - fontSize : 글자 크기 - letterSpacing : 자간 - height : 줄 간격 - color : 글자 색상
[j Flutter] A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps 에러 시 코드 수정 Flutter 에서 해당 에러가 발생했습니다. A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps. - > 해결방법 AndroidManifest.xml에서 해당 부분을 주석이나 삭제해줍니다.
[j Flutter] 사진, 아이콘 좌우반전하기 사진이나 아이콘을 좌우반전 하는 방법이다. import 'dart:math' as math; Transform( alignment: Alignment.center, transform: Matrix4.rotationY(math.pi), child: Icon(Icons.arrow_right, size: 100,), )
[j Flutter] MediaQuery.of(context).size.width 처음 사용할때 width가 0일때 처리 MediaQuery.of(context).size.width를 사용하다보면 페이지 처음 이동시 0이 나올 때 처리를 해보자. Future whenNotZero(Stream source) async { await for (double value in source) { print("Width:" + value.toString()); if (value > 0) { print("Width > 0: " + value.toString()); return value; } } // stream exited without a true value, maybe return an exception. } MediaQuery.of(context).size.width : 0보다 큰지 확인 하기 위해 50 밀리 초마다 확인한다. F..