Application/Flutter
-
[ Flutter ] Bottom Modal Keyboard AvoiderApplication/Flutter 2024. 12. 8. 17:45
Bottom Modal을 사용할 때 안에 textField를 누르면 키보드가 생성되면서 modal이 가려지는 문제가 발생https://pub.dev/packages/keyboard_avoider keyboard_avoider | Flutter packageA lightweight alternative to the Scaffold widget for avoiding the on-screen software keyboard. Automatically scrolls obscured TextField child widgets into view on focus.pub.dev keyboard_avioder를 사용하면 키보드가 열릴때 알아서 해당 widget을 맞춰 올려준다. Dependenciesyaml 파일에 k..
-
[ Flutter ] Blurry TextApplication/Flutter 2024. 11. 17. 17:33
텍스트를 상황에 맞게 보여주고 안보여주고 처리를 위해 blur 처리를 이용 금액을 보여주는 부분을 만들면서 blur처리를 하며 보이고 안보이고를 선택할 수 있도록 기능을 처리 BackdropFilterbackdropFilter를 사용하면 backdropFilter위에 작성한 내용들을 blur처리를 한다background의 배경을 blur처리 하는 것이므로 child안에는 blur처리를 안하는 내용들이 들어간다. 텍스트 하나만 blur처리를 하고자 child에는 빈 영역을 넣어주어 blur처리가 되는 영역을 잡아준다.child: BackdropFilter( filter: ImageFilter.blur( sigmaX: 5.0sigmaY: 5.0), child: Con..
-
[ Flutter ] Horizontal Scroll ListView, Global KeyApplication/Flutter 2024. 9. 8. 05:52
OnBoarding에서 초기 설정을 처리하기 위해서요일과 금액을 세팅해야 화면을 넘어가게 처리 그 과정에서 요일 선택에서 datePicker를 사용할까 하다가 요일만 필요하기에 새로운 방법을 고민하다가Scroll ListView를 사용하기로 결정 그러면 ListView를 가로로 스크롤이 가능하여 선택 할 있다.Scroll ListViewListView에서 보여줄 리스트 초기화 및 선택값 초기화final List list = List.generate(31, (index) => (index + 1).toString()); String selectedValue = "1"; ListView 에 Scroll기능을 추가할려면scrollDirection을 추가해서 방향을 설정해주면 된다. 이후 Getstu..
-
[ Flutter ] OnBoardingApplication/Flutter 2024. 9. 8. 05:02
처음 앱이 실행되었을때 설명하는 화면이 나오는 것을 처리하고 싶어서 OnBoarding을 사용https://pub.dev/packages/introduction_screen introduction_screen | Flutter packageIntroduction/Onboarding package for flutter app with some customizations possibilitiespub.dev flutter에서 introduction_screen을 활용하여 onBoarding을 구현Dependenciesintroduction_screen 의존성 추가introduction_screen: ^3.1.14 OnBoardingOnBoarding 화면을 만들기 위해 메인 컴포넌트를 제작이후 세부 페이지..
-
[ Flutter ] Hive ( NoSql ) 추가, 수정, 삭제Application/Flutter 2024. 9. 1. 16:23
Addhive box에 데이터를 추가할 경우 단순하게 add를 통해 데이터를 추가 할 수 있다. 처음엔 기존 index값을 현재 _costBox의 length를 기준으로 해서 했지만수정 삭제 기능이 들어가면서 index값이 계속 꼬여 수정이나 삭제가 다른 데이터에 적용되서 방식을 변경 void add(String title, String pay) { Cost cost = Cost(id: getNextId(_costBox), title: title, pay: pay); _costBox.add(cost); } box가 비어있다면 0을 return하고그 외는 현재 박스의 마지막 값의 id에서 +1 을 해주는 방식으로 index를 설정 int getNextId(Box box) { if (bo..
-
[ Flutter ] Alert DialogApplication/Flutter 2024. 9. 1. 16:09
삭제 기능을 구현하기 위해 alert을 사용AlertDialogalertDialog는 다른 삭제 부분에서 사용 가능성을 고려하여 컴포넌트화 시킴class CustomAlertDialog extends StatelessWidget { const CustomAlertDialog({super.key}); @override Widget build(BuildContext context) { return AlertDialog( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), backgroundColor: boxColor, title: Text( '정말루?!', style..
-
[ Flutter ] Slidable CustomApplication/Flutter 2024. 8. 29. 00:36
이전에 Hive를 활용하여 저장 기능을 구현하였기에 이제 수정과 삭제 기능을 구현하기 위해서 Slidable을 활용https://pub.dev/packages/flutter_slidable flutter_slidable | Flutter packageA Flutter implementation of slidable list item with directional slide actions that can be dismissed.pub.devSlidable은 리스트를 옆으로 넘겨 삭제 혹은 버튼을 선택할 수 있도록 해준다.DependenciesSlidable을 사용하기 위해 yaml파일에 의존성 추가dependencies: flutter: sdk: flutter # list Slider fl..
-
[ Flutter ] Hive ( NoSql ) 데이터 저장Application/Flutter 2024. 8. 24. 17:11
이전 hive 세팅이 끝났으므로실제 데이터를 추가 기능을 구현 Box Add이전 모달창에서 리스트에 추가하는 방식에서 hive에 데이터 추가 로직을 추가버튼쪽에서는 이전 구현에서 바뀐점 없이 그대로 진행하며 addFixList함수에 로직을 추가Container SaveChildButton(BuildContext context) { final fixSaveProvider = Provider.of(context, listen: false); return Container( margin: const EdgeInsets.fromLTRB(0, 0, 16.0, 0), alignment: Alignment.centerRight, child: ElevatedButton..