플러터(Flutter)
플러터 레이아웃
xemaker
2024. 10. 23. 16:52
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.orange),
useMaterial3: true,
),
home: LayoutDemoPage(),
);
}
}
class LayoutDemoPage extends StatelessWidget {
const LayoutDemoPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
title: Text(
'Flutter Layout Demo',
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimaryContainer),
),
),
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Text(
'스위스에 멋진 캠프 그라운드',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
Text(
'캔더스태그 / 스위스',
style: TextStyle(color: Colors.grey.shade500),
),
],
),
),
Icon(
Icons.star,
color: Colors.red,
),
Text('41')
],
),
);
}
}