class App extends StatelessWidget{
Widget build(BuildContext context) {
// TODO: implement build
throw UnimplementedError();
}
}
class App extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Hello flutter'),
),
body: Center(
child: Text('Hello world'),
),
),
);
}
}
/widgets/button.dart
// Flutter Stateless Widget
import 'package:flutter/cupertino.dart';
class Button extends StatelessWidget {
final String text;
final Color bgColor;
final Color textColor;
Button({
super.key,
required this.text,
required this.bgColor,
required this.textColor,
});
Widget build(BuildContext context) {
return 재사용할 코드;
}
}