전체 글
-
Flutter_11. App bar & Modal &Text Field (Input tag)> Frontend/Flutter 2023. 5. 4. 23:59
0. 배운 내용 - App Bar (상단 바) - Modal 창 - Text Field Widget (JS 의 input tag 와 비슷) 사용하여 input value 받기. 1. App Bar. (상단) @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Flutter Expense Tracker"), // 제목 actions: [ IconButton(onPressed: () { return _openAddExpenseOverlay(); }, icon: const Icon(Icons.add)), ], // actions: typically used to display butto..
-
Flutter_10. Custom List & Formatting Data> Frontend/Flutter 2023. 5. 3. 23:30
0. 공부내용 - Custom List 만들기 (Spacer 사용) - Icons 와 Date Format을 사용해 모델 업데이트 1. Custom List 만들기 import 'package:flutter/material.dart'; import 'package:flutter06_expense/models/expense.dart'; class ExpenseItem extends StatelessWidget { const ExpenseItem({super.key, required this.expense}); final Expense expense; @override Widget build(BuildContext context) { return Card( child: Padding( padding: con..
-
Flutter_09.Enums and ListView> Frontend/Flutter 2023. 5. 2. 23:50
0.금일 공부 내용. - enum - ListView - ListView 사용시, column 주의점 1. Enum: - 한 변수의 값을 몇가지 옵션으로 제한하는 기능으로, 선택지가 제한적일때 사용. import 'package:uuid/uuid.dart'; const uuid = Uuid(); enum Category { food, travel, leisure, work } // enum is used to create a fixed set of allowed values, so that we have to use one of those values when creating new expense. class Expense { Expense({ required this.title, required thi..
-
Flutter_08. making a model class> Frontend/Flutter 2023. 5. 2. 23:14
1. - flutter pub add uuid 설치 후, 아래와 같이 진행 import 'package:uuid/uuid.dart'; const uuid = Uuid(); class Expense { Expense({ required this.title, required this.amount, required this.date }): id = uuid.v4(); // in Dart, 'Initializer Lists' can be used to initialize class properties with values that are Not received as constructor function arguments // Basically, when this Expense class initialized, ..
-
Flutter_07.Quiz App04_Map & For loops (마무리)> Frontend/Flutter 2023. 4. 26. 20:43
0. - Map & Forr Loops. (Skipped to ep.80) - Type Casting. - Combining Columns and Rows. - Expanded - SingleChildScrollView를 사용해 scroll 1. For Loops. import 'package:flutter/material.dart'; import 'package:basic101_01/components/data/questions.dart'; import 'package:basic101_01/components/questions_summary.dart'; class ResultsScreen extends StatelessWidget { const ResultsScreen({ super.key, requi..
-
Flutter_06. QuizApp03_ Passing Data> Frontend/Flutter 2023. 4. 24. 19:16
0. 금일 공부한 내용 - List Elements and Mapping - Alignment, Margin & Padding - Mutating values. - Managing th Questions as State. - More Button Style (Center and Custom Font) - Passing Data via Functions across Widget 1. Spread Operator // Method 1 (Better). ...currentQuestion.answers.map((item) { return AnswerButton(item, () {}); // Iterable !== Widget => use Spread Operator }), // Method 2 // Answer..
-
Flutter_05. If-Statement & 퀴즈 데이터> Frontend/Flutter 2023. 4. 22. 19:58
1. if 문으로 삼항을 대체. Widget screenWidget = StartScreen(switchScreen); if (activeScreen == 'questions-screen') { screenWidget = const QuestionScreen(); } 2. Quiz Data 추가 Questions Page (questions_screen)에서 사용될 Quiz와 Answer 모음을 첨부 questions.dart 페이지는 아래와 같이 생겼는데, const questions = [ QuizQuestion( 'What are the main building blocks of Flutter UIs?', [ 'Widgets', 'Components', 'Blocks', 'Functions', ],..
-
Flutter_04. Rendering Contents conditionally> Frontend/Flutter 2023. 4. 19. 21:15
1. Reformat. // quiz.dart contains contents MaterialApp import 'package:basic101_01/components/questions_screen.dart'; import 'package:basic101_01/components/start_screen.dart'; import 'package:flutter/material.dart'; class Quiz extends StatefulWidget { const Quiz({super.key}); @override State createState() { return _QuizState(); } } class _QuizState extends State { Widget activeScreen = const S..