PMU_PIbd32_Kamcharova_K.A/lib/pages/CharacterDetailPage.dart
2024-12-03 16:46:17 +04:00

62 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import '../character.dart';
class CharacterDetailPage extends StatelessWidget {
final Character character;
CharacterDetailPage({required this.character});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(character.name),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Изображение персонажа
Center(
child: Image.network(
character.imageUrl,
height: 200,
width: 200,
fit: BoxFit.cover,
),
),
SizedBox(height: 20),
Text(
character.name, // Имя персонажа
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
Text(
character.typeString, // Тип персонажа (Survivor или Hunter)
style: TextStyle(fontSize: 18, color: Colors.grey[600]),
),
SizedBox(height: 20),
// Предыстория персонажа
Text(
'Полное описание:',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
// Текст предыстории
Text(
character.backstory,
style: TextStyle(fontSize: 14),
maxLines: null,
softWrap: true,
),
],
),
),
);
}
}