import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: SimpleApp()
);
}
}
class SimpleApp extends StatefulWidget {
@override
_SimpleAppState createState() => _SimpleAppState();
}
class _SimpleAppState extends State<SimpleApp> {
String box_text = "테스트 텍스트";
void _updateText() {
setState(() {
print("여기는 포인트 영ㅇ역입니다.");
box_text = "박스가 변경되었습니다.";
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("this is title"),
),
body: Center(
child: Text(box_text),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.create),
onPressed: _updateText,
),
);
}
}

'인프런 - 강의 > 플루터로 앱 만들기 고고(입문)' 카테고리의 다른 글
8 - 369 게임 (0) | 2020.04.20 |
---|---|
7 - Image insert (0) | 2020.04.20 |
6 - show hide (0) | 2020.04.20 |
5 - 기본 위젯 알아보기 (0) | 2020.04.20 |
3 - 가장 기초 알아보기 (0) | 2020.04.19 |