2024-11-12 23:23:42 +04:00
|
|
|
import 'package:flutter/material.dart';
|
2024-11-13 21:26:01 +04:00
|
|
|
import 'dart:math';
|
2024-11-12 23:23:42 +04:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
|
|
|
title: 'Flutter Demo',
|
2024-11-13 21:26:01 +04:00
|
|
|
debugShowCheckedModeBanner: false,
|
2024-11-12 23:23:42 +04:00
|
|
|
theme: ThemeData(
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
2024-11-13 21:26:01 +04:00
|
|
|
home: const MyHomePage(title: 'Бацылев Владислав Алексеевич'),
|
2024-11-12 23:23:42 +04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyHomePage extends StatefulWidget {
|
|
|
|
const MyHomePage({super.key, required this.title});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<MyHomePage> createState() => _MyHomePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
2024-11-13 21:26:01 +04:00
|
|
|
final Color _color = Colors.purple;
|
2024-11-12 23:23:42 +04:00
|
|
|
|
2024-11-13 21:26:01 +04:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
backgroundColor: _color,
|
|
|
|
title: Text(widget.title),
|
|
|
|
),
|
|
|
|
body: const MyWidget(),
|
|
|
|
);
|
2024-11-12 23:23:42 +04:00
|
|
|
}
|
2024-11-13 21:26:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _CardData{
|
|
|
|
final String text;
|
|
|
|
final String discriptionText;
|
|
|
|
final IconData icon;
|
|
|
|
final String? imageUrl;
|
|
|
|
|
|
|
|
_CardData(
|
|
|
|
this.text, {
|
|
|
|
this.icon = Icons.ac_unit_outlined,
|
|
|
|
required this.discriptionText,
|
|
|
|
this.imageUrl,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyWidget extends StatelessWidget {
|
|
|
|
const MyWidget({super.key});
|
2024-11-12 23:23:42 +04:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-11-13 21:26:01 +04:00
|
|
|
final data = [
|
|
|
|
_CardData('Arc Warden',
|
|
|
|
discriptionText: 'Ловкость',
|
|
|
|
icon: Icons.account_circle,
|
|
|
|
imageUrl: 'https://yt3.googleusercontent.com/VnqOJt9iHkwXonTzNfenydf4hTD2ilYcmiZv-RP8-3eifX16A64eZyV4z43LBL4EhPWAhTN2lJE=s900-c-k-c0x00ffffff-no-rj',
|
|
|
|
),
|
|
|
|
_CardData('Void Spirit',
|
|
|
|
discriptionText: 'Универсальный',
|
|
|
|
icon: Icons.account_circle,
|
|
|
|
imageUrl: 'https://cdna.artstation.com/p/assets/covers/images/024/245/520/large/maxime-lebled-voidspirit.jpg?1581789586',
|
|
|
|
),
|
|
|
|
_CardData('Invoker',
|
|
|
|
discriptionText: 'Универсальный',
|
|
|
|
icon: Icons.account_circle,
|
|
|
|
imageUrl: 'https://steamuserimages-a.akamaihd.net/ugc/1010400569445271177/6D5FF0CF2C48F8351C9AAC98363DEC31386678AB/?imw=5000&imh=5000&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false',
|
|
|
|
),
|
|
|
|
];
|
|
|
|
return Center(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: data.map((e) => _Card.fromData(e)).toList(),
|
2024-11-12 23:23:42 +04:00
|
|
|
),
|
2024-11-13 21:26:01 +04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _Card extends StatelessWidget {
|
|
|
|
final String text;
|
|
|
|
final String discriptionText;
|
|
|
|
final IconData icon;
|
|
|
|
final String? imageUrl;
|
|
|
|
|
|
|
|
const _Card(
|
|
|
|
this.text,{
|
|
|
|
this.icon = Icons.ice_skating_outlined,
|
|
|
|
required this.discriptionText,
|
|
|
|
this.imageUrl,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory _Card.fromData(_CardData data) => _Card(
|
|
|
|
data.text,
|
|
|
|
discriptionText: data.discriptionText,
|
|
|
|
icon: data.icon,
|
|
|
|
imageUrl: data.imageUrl,
|
|
|
|
);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
margin: const EdgeInsets.all(16),
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white70,
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
border: Border.all(color: Colors.grey),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Colors.grey.withOpacity(.5),
|
|
|
|
spreadRadius: 4,
|
|
|
|
offset: const Offset(0, 5),
|
|
|
|
blurRadius: 8,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
child: SizedBox(
|
|
|
|
height: 140,
|
|
|
|
width: 100,
|
|
|
|
child: Image.network (
|
|
|
|
imageUrl ?? '',
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
errorBuilder: (_,__,___) => const Placeholder(),
|
|
|
|
),
|
2024-11-12 23:23:42 +04:00
|
|
|
),
|
2024-11-13 21:26:01 +04:00
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 16.0),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
text,
|
|
|
|
style: Theme.of(context).textTheme.headlineLarge,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
discriptionText,
|
|
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2024-11-12 23:23:42 +04:00
|
|
|
),
|
2024-11-13 21:26:01 +04:00
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Icon(icon),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
);
|
2024-11-12 23:23:42 +04:00
|
|
|
}
|
|
|
|
}
|