본문 바로가기

반응형

Flutter-플러터

resizeToAvoidBottomInset: false, 키보드 위치 텍스트 필드를 입력 할 때 입력칸을 클릭하면 오버 플로우가 생김 그러한 오버플로우를 없애기 위한 방법 중 하나 더보기
ngredient.gramPrice, ingredient.price, ingredient.weight변수 double 타입이야 ingredient.gramPrice = ingredient.price! / ingredient.weight!;위코드에 소수점을 모두 없애는 코드를 다트 언어로 .. ingredient.gramPrice = (ingredient.price! / ingredient.weight!).truncate(); ingredient.gramPrice = (ingredient.price! / ingredient.weight!).round(); ingredient.gramPrice = (ingredient.price! / ingredient.weight!).round(); 코드에서 모든 소수점을 제거하려면 ingredient.gramPrice = ingredients.price! / ingredients.weight!인 경우 truncate() 메서드를 사용하여 결과 값의 소수 부분을 자를 수 있습니다. 예를 들면 다음과 같습니다. truncate()를 사용하면 값이 가장 가까운 정.. 더보기
flutter form 위젯을 사용할 때 하위에 있는 텍스트폼필드 위젯에 값을 저장하려고해 하지만 아무 값도 입력하지 않고 저장하면 오류가 생기네 ? 어떻게 해야 할까 class MyForm extends StatefulWidget { @override _MyFormState createState() => _MyFormState(); } class _MyFormState extends State { final _formKey = GlobalKey(); String _text; @override Widget build(BuildContext context) { return Form( key: _formKey, autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ TextFormField( validator: (value) { if (value.isEmpty) { return 'Pl.. 더보기
TextFormFiled 에서 initalValue 와 Controller 결론 : intitalvalue 와 contrller는 같이 못쓴다!!!! The error message "AssertionError ('package:flutter/src/material/text_form_field.dart': Failed assertion: line 157 pos 15: 'initialValue == null || controller == null': is not true.)" indicates that you are using a TextFormField widget in your Flutter application, and you have provided both initialValue and controller properties to the widget, which is n.. 더보기
Flutter 데이터 베이스 선택? Sqllite, hive, getstorage 결론 : 간단한 테스트용은 getstorage 정식 출시는 hive 하지만 더 큰 데이터를 다루기 위해서는 sqllite 선택! GetStorage and Hive are both key-value storage solutions for Flutter. They both allow you to store data locally on the device, but they have different strengths and weaknesses. GetStorage is a lightweight solution that is easy to use. It is a good choice for storing small amounts of data, such as user preferences or session .. 더보기
Flutter - Getstorage code Getstorage 가벼운 데이터 베이스 GPT와 함께 하니 정말 금방 배우고 있다..;; 처음에는 어렵게 생각했던 데이터 베이스.... 그래도 이제는 뭣인지 감이라도 잡히는 중이다 힘내자!!! // class IngredientController extends GetxController { RxList ingredients = [].obs; @override void onInit() { var box = GetStorage(); if (box.read('ingredients') != null) { var list = box.read('ingredients'); for (var item in list) { ingredients.add(Ingredient.fromJson(item)); } } ever(in.. 더보기
Getx controller : onInit - ever, everall, once Can you tell me when to write it? onInit() { ever(counter, (value) { // Callback function that will be executed whenever `counter` changes print('Counter changed: $value'); }); } onInit() { everAll([counter1, counter2], (values) { // Callback function that will be executed whenever `counter1` or `counter2` changes print('Counter1 changed: ${values[0]}, Counter2 changed: ${values[1]}'); }); } onI.. 더보기
Vscode 만세 - flutter bricks Vs Code에 있는 extension 중 하나이다. 잘 만든 flutter ui를 갖다가 바로 쓸 수 있다. 무료 버전도 있고, 유료 버전도 있다. 유료 버전이 좀 비싸다.......... 간단한 어플을 만들 때는 유용할 듯! 더보기

반응형