211 lines
6.1 KiB
Dart
211 lines
6.1 KiB
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(
|
||
title: 'ЧВК Мартышки',
|
||
debugShowCheckedModeBanner: false,
|
||
theme: ThemeData(
|
||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||
useMaterial3: true,
|
||
),
|
||
home: const MyHomePage(title: 'ЧВК Мартышки'),
|
||
);
|
||
}
|
||
}
|
||
|
||
class MyHomePage extends StatefulWidget {
|
||
const MyHomePage({super.key, required this.title});
|
||
|
||
final String title;
|
||
|
||
@override
|
||
State<MyHomePage> createState() => _MyHomePageState();
|
||
}
|
||
|
||
class _MyHomePageState extends State<MyHomePage> {
|
||
final Color _color = Colors.amberAccent;
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
appBar: AppBar(
|
||
backgroundColor: _color,
|
||
title: Text(widget.title),
|
||
),
|
||
body: const MyWidget(),
|
||
);
|
||
}
|
||
}
|
||
|
||
class _CardData {
|
||
final String text;
|
||
final String descriptionText;
|
||
final IconData icon;
|
||
final String? imageUrl;
|
||
|
||
_CardData(
|
||
this.text, {
|
||
required this.descriptionText,
|
||
this.icon = Icons.abc,
|
||
this.imageUrl,
|
||
});
|
||
}
|
||
|
||
class MyWidget extends StatelessWidget {
|
||
const MyWidget({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
final data = [
|
||
_CardData(
|
||
'Мама с сыном',
|
||
descriptionText: '-Чё вылупился?',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://pic.rutubelist.ru/video/8b/31/8b31b4f162bf11007c036be6787e9bb1.jpg',
|
||
),
|
||
_CardData(
|
||
'Ярускин Салих',
|
||
descriptionText: 'я мусор',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://steamuserimages-a.akamaihd.net/ugc/2030615098399987630/EB9690C3D097504388EA8F057E48631354C05182/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false',
|
||
),
|
||
_CardData(
|
||
'Гламурная бабизяна',
|
||
descriptionText: 'сделала губки 5мл',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://avatars.dzeninfra.ru/get-zen_doc/3310860/pub_602156c24849a6360821ff59_60215909390eb32b9bb9e012/scale_1200',
|
||
),
|
||
_CardData(
|
||
'Мелкий',
|
||
descriptionText: 'невдупленыш',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://sun9-59.userapi.com/impg/DBnGgdqZnRtBw9jchGixY6rRN-zTWaAEVjLxXw/HrYCralVB-4.jpg?size=807x577&quality=96&sign=a84b4d87249b7d5ade53369663a3a9e0&c_uniq_tag=2XoQqW9aaCVDnvITURMqqPPY9yznsdCr4HWXaSv9Q_U&type=album',
|
||
),
|
||
_CardData(
|
||
'Обезьянка Олежа',
|
||
descriptionText: 'Поняла смысл жизни...',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://avatars.yandex.net/get-music-content/5417945/f468314f.a.20066160-1/m1000x1000?webp=false',
|
||
),
|
||
_CardData(
|
||
'Афанасьев Степан',
|
||
descriptionText: 'основатель ЧВК Мартышки',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://steamuserimages-a.akamaihd.net/ugc/1621850006938404146/EA72DC3C31DED440C024F0DD1D9859C44B1BBDFF/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false',
|
||
),
|
||
_CardData(
|
||
'Лобашов Иван',
|
||
descriptionText: 'вычисляет противников',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://cdn1.ozone.ru/s3/multimedia-i/6449406306.jpg',
|
||
),
|
||
_CardData(
|
||
'Коренной представитель ЧВК Мартышки',
|
||
descriptionText: 'сейчас он где-то в Камеруне проветривает свои блохи',
|
||
icon: Icons.favorite,
|
||
imageUrl:
|
||
'https://otvet.imgsmail.ru/download/306401642_9fecf789a8802c5805c4e21291cba6a6_800.jpg',
|
||
),
|
||
];
|
||
|
||
return Center(
|
||
child: SingleChildScrollView(
|
||
child: Column(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: data.map((e) => _Card.fromData(e)).toList(),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
class _Card extends StatelessWidget {
|
||
final String text;
|
||
final String descriptionText;
|
||
final IconData icon;
|
||
final String? imageUrl;
|
||
|
||
const _Card(
|
||
this.text, {
|
||
this.icon = Icons.abc,
|
||
required this.descriptionText,
|
||
this.imageUrl,
|
||
});
|
||
|
||
factory _Card.fromData(_CardData data) => _Card(
|
||
data.text,
|
||
descriptionText: data.descriptionText,
|
||
icon: data.icon,
|
||
imageUrl: data.imageUrl,
|
||
);
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Container(
|
||
margin: const EdgeInsets.all(5),
|
||
padding: const EdgeInsets.all(10),
|
||
decoration: BoxDecoration(
|
||
color: Colors.white70,
|
||
borderRadius: BorderRadius.circular(20),
|
||
border: Border.all(color: Colors.grey.shade200),
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.grey.withOpacity(.5),
|
||
spreadRadius: 4,
|
||
offset: const Offset(0, 5),
|
||
blurRadius: 8,
|
||
),
|
||
],
|
||
),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
ClipRRect(
|
||
borderRadius: BorderRadius.circular(10),
|
||
child: SizedBox(
|
||
height: 310,
|
||
width: double.infinity,
|
||
child: Image.network(
|
||
imageUrl ?? '',
|
||
fit: BoxFit.cover,
|
||
errorBuilder: (_, __, ___) => const Placeholder(),
|
||
),
|
||
),
|
||
),
|
||
const SizedBox(height: 5),
|
||
Text(
|
||
text,
|
||
style: Theme.of(context).textTheme.headlineLarge,
|
||
),
|
||
Text(
|
||
descriptionText,
|
||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||
fontSize: 20,
|
||
),
|
||
),
|
||
const SizedBox(height: 5),
|
||
Align(
|
||
alignment: Alignment.bottomRight,
|
||
child: Icon(icon),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
}
|