Flutter(17)
-
Flutter - InkWell 과 GestureDetector
글자와 그림 같이 이벤트 프로퍼티( onTap , onPressed) 가 없는 어떠한 위젯에 이벤트를 적용하고 싶을 때 사용하는 위젯입니다. GestureDetector GestureDetector는 사용하기 아주 간편한 위젯 중 하나 입니다. GestureDetector의 child에 클릭 효과를 주고 싶은 Text, image 등 어떠한 위젯이 와도 넣을수있다 . 또 GestureDetector의 크기는 기본적으로 child를 참조합니다. lnkWell Inkwell은 사용자 터치에 반응하는 위젯입니다. 터치를 하면 터치 한 부분을 중심으로 물결 효과 가 일어납니다. GestrueDectecotor처럼 child 프로퍼티를 참조한다. InkWell
2023.03.07 -
Flutter - WebView Widget
먼저 프로젝트에 패키지를 추가하도록합니다. 출처:https://pub.dev/packages/webview_flutter webview_flutter | Flutter Package A Flutter plugin that provides a WebView widget on Android and iOS. pub.dev 1. home_screen.dart controller: 위젯의 동작을 사용자 정의할수있다. 예를들어 PageView의 첫 번째 페이지로 자동으로 이동하려는 앱에서 문제가 발생할 수 있습니다. 연결된 PageController를 사용하여 호출하여 컨트롤러의 사용자 지정 구현을 전달 할수있다. 2.main.dart 3.http 통신 하는법 (Android) 1.결과물
2023.03.06 -
Flutter - StatelessWidget, StatefulWidget이란?
1.Widget 이란? - Widget은 모두 "불변"의 법칙을 갖고있다. -하지만 위젯의 값을 변경해야할때가있다. (색 변경등) -변경이 필요하면 기존 위젯을 삭제해버리고 완전 새로운 위젯으로 대체한다. 1.Stateless Widget - 상태가 없는 위젯(= 변경 가능한 상태가 필요하지 않은 위젯) - 변화가 필요없는 화면을 구성할 때 사용하는 위젯 클래스 2.Stateful Widget - 2개의 클래스로 구성됨(StatefulWidget, State) -상태를 변화 할수있는 위젯 -setstate를 사용해 상태를 변경시킬수있다. 1.stateless widget 2.statefulwidget을 이용해 setstate 상태변화 해보기.
2023.03.05 -
Flutter - 입력용 위젯
TextField -Textfield는 글자를 받는 입력용 위젯입니다. -InputDecoration 클래스와 함께 사용하면 힌트 메세지나 외곽선등의 꾸밈 효과를 간단히 추가할수있다. 1. 로그인 화면 구현해보기. import 'dart:ffi'; import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( t..
2023.03.04 -
Flutter - Button 위젯
ElevatedButton -배경색을 가진 일반적인 버튼 -onPressed() 하수에 원하는 액션 지정 가능 OutlinedButton -배경이 투명하고 외곽선을 가진 버튼 TextButton -텍스트를 사용한 심플한 버튼 import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return const MaterialApp( title: '..
2023.03.04 -
Flutter - AppBar, TabBar, TabBarView, BottomNavigationBar
AppBar.TabBar.Tabarview import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( ), home: const MyHomePage(title: 'Flutter'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, ..
2023.03.04