53 lines
1.8 KiB
Dart
53 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_project/components/locale/l10n/app_localizations.dart';
|
|
|
|
import '../../domain/models/card.dart';
|
|
|
|
class DetailsPage extends StatelessWidget {
|
|
final AppLocale locale;
|
|
final CardData data;
|
|
|
|
const DetailsPage(this.locale, this.data, {super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
color: Theme.of(context).colorScheme.inversePrimary,
|
|
child: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(top: 10, bottom: 10),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
child: Image.network(data.imageUrl)),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(10),
|
|
child: Text(
|
|
data.name,
|
|
style: Theme.of(context).textTheme.headlineLarge,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(10),
|
|
child: Text(
|
|
'${locale.apiYear}: ${data.year ?? locale.unknown}, ${locale.apiType}: ${data.type ?? locale.unknown}, ${locale.apiRating}: ${data.rating ?? locale.unknown}\n${locale.apiDesc != "" ? "\n${locale.apiDesc}\n" : ""}\n${data.descr ?? locale.apiNoDesc}',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|