Last active
February 4, 2024 11:52
-
-
Save nabe33/3e4d604ddd229b0a8839200e1006a04c to your computer and use it in GitHub Desktop.
StatelessWidgetの例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | |
// MaterialAppウィジェットはアプリ全体のルックアンドフィールを定義します。 | |
home: Scaffold( | |
// Scaffoldウィジェットはアプリの基本的なビジュアルレイアウト構造を提供します。 | |
appBar: AppBar( | |
// AppBarウィジェットはアプリの上部にあるバーで、タイトルやナビゲーションアイコンなどを含めることができます。 | |
title: Text('My App Title'), | |
), | |
body: Center( | |
// Centerウィジェットはその子ウィジェットを中央に配置します。 | |
child: Text('Hello, World!'), | |
// Textウィジェットはテキストを表示します。 | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment