129 lines
3.0 KiB
Dart
129 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
void main() => runApp(const MyApp());
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// TODO: implement build
|
|
// throw UnimplementedError();
|
|
return MaterialApp(
|
|
home: Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('My Home Page'),
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
TitleSection(name: 'hhh', location: 'shskjd'),
|
|
ButtonSection(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ButtonSection extends StatelessWidget {
|
|
const ButtonSection({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// TODO: implement build
|
|
final Color color = Theme.of(context).primaryColor;
|
|
return SizedBox(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
ButtonWithText(color: color, icon: Icons.call, label: 'CALL'),
|
|
ButtonWithText(color: color, icon: Icons.near_me, label: 'ROUTE'),
|
|
ButtonWithText(color: color, icon: Icons.near_me, label: 'ROUTE'),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ButtonWithText extends StatelessWidget {
|
|
const ButtonWithText({
|
|
super.key,
|
|
required this.color,
|
|
required this.icon,
|
|
required this.label,
|
|
});
|
|
|
|
final Color color;
|
|
final IconData icon;
|
|
final String label;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// TODO: implement build
|
|
// throw UnimplementedError();
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(icon, color: color),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 8),
|
|
child: Text(
|
|
label,
|
|
style: TextStyle(
|
|
fontSize: 12, fontWeight: FontWeight.w400, color: color),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class TitleSection extends StatelessWidget {
|
|
const TitleSection({
|
|
super.key,
|
|
required this.name,
|
|
required this.location,
|
|
});
|
|
|
|
final String name;
|
|
final String location;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// TODO: implement build
|
|
return Padding(
|
|
padding: const EdgeInsets.all(32),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.only(bottom: 8),
|
|
child: Text(
|
|
name,
|
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
Text(
|
|
location,
|
|
style: TextStyle(color: Colors.grey[500]),
|
|
)
|
|
],
|
|
)),
|
|
Icon(
|
|
Icons.star,
|
|
color: Colors.red[500],
|
|
),
|
|
const Text('41'),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|