본문 바로가기

전체 글

(146)
[백준/14888/파이썬] 연산자 끼워넣기 소스코드 from itertools import permutations N = int(input()) num = list(map(int,input().split())) operator = list(map(int,input().split())) operstr = ['+', '-', '*', '//'] max_ans = -999999999 min_ans = 999999999 # + - * / oplist = [] for i,op in enumerate(operator): for j in range(op): oplist.append(operstr[i]) many = list(permutations(oplist,len(oplist))) def cal(num1,num2, operate): if operate ==..
Navigator Navigator는 페이지 간의 연결을 하는 함수이다. 자료구조상 stack으로 되어 있으며 push와 pop연산을 통해 구현할 수 있다. FirstPage class FirstPage extends StatelessWidget { const FirstPage({Key? key}) : super(key: key); @override Widget build(BuildContext context2) { return Scaffold( appBar: AppBar( title: Text('firstpage'), ), body: Center( child: ElevatedButton( child: Text("다음 페이지로"), onPressed: (){ Navigator.push(context2, MaterialPa..
Build Context와 snackbar 이거 전 강의에서 Bulid Context에 대해 설명해주셨는데 아직 느낌이 와닿진 않는다. 그래서 추후 다시 복습할때를 위해 링크를 남겨놓을게요 코딩 셰프 : https://youtu.be/o-HpnWhI70U
Drawer ListView flutter의 ListView에는 ListTile이라는 위젯을 제공해줘서 margin이나 padding이 필요없다. Drawer drawer: Drawer( child: ListView( padding: EdgeInsets.zero, children: [ UserAccountsDrawerHeader( currentAccountPicture: CircleAvatar( //유저 프로필 원형 설정 backgroundImage: AssetImage("assets/cocktail1.png"), //프로필 사진 설정 backgroundColor: Colors.white, //프로필 배경화면 설정 ), accountName: Text("code"), //사용자 이름 accountEmail: Text..
Text style, Image 업로드 Text style crossAxisAlignment : 왼쪽 정렬 letterSpacing : 자간 SizedBox() : 텍스트 사이에 공간 설정 Icon 설정 Image 업로드 1. asset 폴더를 만들고 그 안에 사진을 넣는다 2. pubspec.yaml 파일로가서 이 부분을 수정해주고 저장해주면 exit code 0이 나오면 저장이 된 것이다. assets: - assets/cocktail1.png 여기서 PNG 파일로 설정하면 안나오고 png로 고치니까 그림이 나왔는데, 이 점을 주의해야한다. 다시 main.dart파일로 돌아와서 CircleAvatar( backgroundImage: AssetImage('assets/cocktail1.png'), radius: 60.0,), 사진이 업로드 ..
위젯정리 AppBar appBar: AppBar( title: Text(widget.title), centerTitle: true, backgroundColor: Colors.redAccent, elevation: 0.0, ), title : 제목 centerTitle : 글자 위치를 center로 지정 (boolean) backgroundColor : app바의 색깔 elevation : appbar가 뜨는 정도 (소숫점 단위로도 설정가능) Body Padding(padding: EdgeInsets.fromLTRB(left, top, right, bottom),) 내부 영역의 공간 설정 : 상하좌우를 숫자로 설정가능 child: Column( mainAxisAlignment: MainAxisAlignment.c..
플러터 프로젝트 폴더와 기본 코드 이해하기 pubspec.yaml : 앱을 만들때 필요한 여러가지 중요한 내용을 등록하는 파일 (getx나 image파일 등) lib : 앱 만들때 주로 사용하는 폴더 main.dart import 'package:flutter/material.dart'; material 파일에 있는 모든 것을 사용할 수 있음 앞으로 무조건 import void main() { runApp(const MyApp()); } 앱의 시작점 클래스명 => 대문자 (MyApp()) 함수명 => 소문자 main() MaterialApp() class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @o..
Widget 1. Flutter 상에서의 위젯 - UI를 만들고 구성하는 모든 기본 단위 요소 - 눈에 보이지 않는 요소들까지 위젯 (center, columnm, padding 등) - 즉 모든 것이 위젯이다. 2. Stateless widgets VS Stateful widgets - Stateless : 이전 상호작용의 어떠한 값도 저장하지 않음 (상태가 없는 정적인 위젯) 1. 스크린 상에 존재만 할 뿐 아무것도 하지 않음 2. 어떠한 실시간 데이터도 저장하지 않음 3. 어떤 변화(모양,상태)를 유발하는 value값을 가지지 않음 - Stateful : Value 값을 지속적으로 추적 보존 (계속 움직이나 변화가 있는 위젯) 1. 사용자의 interaction에 따라 모양이 바뀜 2. 데이터를 받게 되었을 때..