added internet permission in manifest added unique app bar titles for each section fixed card layout fixed card details page layout added appbar button for toggling dark mode
40 lines
1.3 KiB
Dart
40 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_android_app/components/extensions/context_x.dart';
|
|
import 'package:flutter_android_app/domain/models/card.dart';
|
|
|
|
class DetailsPage extends StatelessWidget {
|
|
final CardData data;
|
|
|
|
const DetailsPage(this.data, {super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(context.locale.detailsPageAppBarTitle),
|
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.only(left: 20, right: 20, top: 30),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(bottom: 40),
|
|
child: Image.network(data.imageUrl ?? ''),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(bottom: 8),
|
|
child: Text(data.title, style: Theme.of(context).textTheme.headlineLarge),
|
|
),
|
|
Text(data.currentPrice, style: Theme.of(context).textTheme.bodyLarge),
|
|
Text(data.priceChange, style: Theme.of(context).textTheme.labelLarge),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|