Загрузка...

Membuat halaman profile di flutter

main.dart

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(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xffdc2682), Color(0xfffda085)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
child: Center(
child: Container(
width: 350,
height: 650,
margin: const EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: const [
BoxShadow(
color: Colors.grey,
blurRadius: 10,
spreadRadius: 1,
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircleAvatar(
radius: 55,
backgroundImage: AssetImage(' jpg'),
),
const SizedBox(height: 16),
const Text(
'fairuza',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: Color(0xdd461313),
),
),
const SizedBox(height: 4),
const Text(
'Mahasiswa',
style: TextStyle(
fontSize: 19,
color: Color(0xffb41b5a),
),
),
const SizedBox(height: 16),
const Divider(thickness: 1),
const SizedBox(height: 8),
infoRow(Icons.badge, 'Nama Lengkap: '),

],
),
),
),
),
),
);
}
}

Widget infoRow(IconData icon, String text) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Icon(icon, color: Color(0xffff35a5)),
const SizedBox(width: 8),
Expanded(
child: Text(
text,
style: const TextStyle(fontSize: 14),
),
),
],
),
);
}

pubspec.yaml

name: helloworld
description: A new Flutter project.
publish_to: 'none'

version: 1.0.0+1

environment:
sdk: ^3.0.0

dependencies:
flutter:
sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0

flutter:
uses-material-design: true

assets:
-
-

Видео Membuat halaman profile di flutter канала fairuza mayla
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять