[Flutter] - 주말 과제

sang hyeok Lee·2023년 3월 26일
0
post-thumbnail

따라 만들기

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

List<Map<dynamic, String>> Infos = [
  {"name": "이테디", "phoneNumber": "010-1000-2000"},
  {"name": "이테디", "phoneNumber": "010-1000-2000"},
  {"name": "이테디", "phoneNumber": "010-1000-2000"},
  {"name": "이테디", "phoneNumber": "010-1000-2000"},
  {"name": "이테디", "phoneNumber": "010-1000-2000"},
];

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            children: [
              for (var info in Infos)
                Container(
                  padding: const EdgeInsets.symmetric(
                    horizontal: 10,
                    vertical: 10,
                  ),
                  decoration: BoxDecoration(
                      color: Colors.grey.shade200,
                      border: const Border(
                          bottom: BorderSide(
                        color: Colors.black26,
                      ))),
                  child: ListTile(
                    title: Text("${info["name"]}"),
                    subtitle: Text("${info["phoneNumber"]}"),
                    leading: Image.network("https://picsum.photos/100/100"),
                    trailing: const Icon(Icons.call),
                  ),
                )
            ],
          ),
        ),
      ),
    );
  }
}
profile
개발자 되기

0개의 댓글