import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Alert(),
);
}
}
class Alert extends StatefulWidget {
@override
_AlertState createState() => _AlertState();
}
class _AlertState extends State<Alert> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: RaisedButton(
child: Text("AlertButton"),
onPressed: (){
showAlertDialog(context);
},
),
),
);
}
showAlertDialog(BuildContext context) {
AlertDialog alert = AlertDialog(
title: Text("title"),
content: Text("Context"),
actions: [
],
);
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
}
);
}
}
'인프런 - 강의 > 플루터로 앱 만들기 고고(입문)' 카테고리의 다른 글
20 - Todo App - 3 (0) | 2020.05.07 |
---|---|
19 - Todo App - 2 (0) | 2020.05.07 |
17 - My 아이돌 앱 3 (0) | 2020.04.28 |
16 - My 아이돌 앱 2 (0) | 2020.04.27 |
15 - My 아이돌 앱 (0) | 2020.04.27 |