120 lines
4.1 KiB
Dart
120 lines
4.1 KiB
Dart
|
import 'package:flutter/material.dart';
|
|||
|
import 'package:flutter_svg/svg.dart';
|
|||
|
import 'package:nekoya_flutter/constants.dart';
|
|||
|
import 'package:nekoya_flutter/screens/productcoba.dart';
|
|||
|
import 'package:nekoya_flutter/screens/products.dart';
|
|||
|
|
|||
|
import 'package:nekoya_flutter/components/color_dot.dart';
|
|||
|
|
|||
|
class DetailsScreen extends StatelessWidget {
|
|||
|
const DetailsScreen({Key? key, required this.product}) : super(key: key);
|
|||
|
|
|||
|
final Product product;
|
|||
|
|
|||
|
@override
|
|||
|
Widget build(BuildContext context) {
|
|||
|
return Scaffold(
|
|||
|
backgroundColor: const Color(0xFFEFEFF2),
|
|||
|
appBar: AppBar(
|
|||
|
leading: const BackButton(color: Colors.black),
|
|||
|
actions: [
|
|||
|
IconButton(
|
|||
|
onPressed: () {},
|
|||
|
icon: CircleAvatar(
|
|||
|
backgroundColor: Colors.white,
|
|||
|
child: SvgPicture.asset(
|
|||
|
"assets/icons/Heart.svg",
|
|||
|
height: 20,
|
|||
|
),
|
|||
|
),
|
|||
|
)
|
|||
|
],
|
|||
|
),
|
|||
|
body: Column(
|
|||
|
children: [
|
|||
|
Image.asset(
|
|||
|
product.image,
|
|||
|
height: MediaQuery.of(context).size.height * 0.4,
|
|||
|
fit: BoxFit.cover,
|
|||
|
),
|
|||
|
const SizedBox(height: defaultPadding * 1.5),
|
|||
|
Expanded(
|
|||
|
child: Container(
|
|||
|
padding: const EdgeInsets.fromLTRB(defaultPadding,
|
|||
|
defaultPadding * 2, defaultPadding, defaultPadding),
|
|||
|
decoration: const BoxDecoration(
|
|||
|
color: Colors.white,
|
|||
|
borderRadius: BorderRadius.only(
|
|||
|
topLeft: Radius.circular(defaultBorderRadius * 3),
|
|||
|
topRight: Radius.circular(defaultBorderRadius * 3),
|
|||
|
),
|
|||
|
),
|
|||
|
child: Column(
|
|||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|||
|
children: [
|
|||
|
Row(
|
|||
|
children: [
|
|||
|
Expanded(
|
|||
|
child: Text(
|
|||
|
product.title,
|
|||
|
style: Theme.of(context).textTheme.headline6,
|
|||
|
),
|
|||
|
),
|
|||
|
const SizedBox(width: defaultPadding),
|
|||
|
Text(
|
|||
|
"\$" + product.price.toString(),
|
|||
|
style: Theme.of(context).textTheme.headline6,
|
|||
|
),
|
|||
|
],
|
|||
|
),
|
|||
|
const Padding(
|
|||
|
padding: EdgeInsets.symmetric(vertical: defaultPadding),
|
|||
|
child: Text(
|
|||
|
"A Henley shirt is a collarless pullover shirt, by a round neckline and a placket about 3 to 5 inches (8 to 13 cm) long and usually having 2–5 buttons.",
|
|||
|
),
|
|||
|
),
|
|||
|
Text(
|
|||
|
"Colors",
|
|||
|
style: Theme.of(context).textTheme.subtitle2,
|
|||
|
),
|
|||
|
const SizedBox(height: defaultPadding / 2),
|
|||
|
Row(
|
|||
|
children: const [
|
|||
|
ColorDot(
|
|||
|
color: Color(0xFFBEE8EA),
|
|||
|
isActive: false,
|
|||
|
),
|
|||
|
ColorDot(
|
|||
|
color: Color(0xFF141B4A),
|
|||
|
isActive: true,
|
|||
|
),
|
|||
|
ColorDot(
|
|||
|
color: Color(0xFFF4E5C3),
|
|||
|
isActive: false,
|
|||
|
),
|
|||
|
],
|
|||
|
),
|
|||
|
const SizedBox(height: defaultPadding * 2),
|
|||
|
Center(
|
|||
|
child: SizedBox(
|
|||
|
width: 200,
|
|||
|
height: 48,
|
|||
|
child: ElevatedButton(
|
|||
|
onPressed: () {},
|
|||
|
style: ElevatedButton.styleFrom(
|
|||
|
primary: primaryColor,
|
|||
|
shape: const StadiumBorder()),
|
|||
|
child: const Text("Add to Cart"),
|
|||
|
),
|
|||
|
),
|
|||
|
)
|
|||
|
],
|
|||
|
),
|
|||
|
),
|
|||
|
)
|
|||
|
],
|
|||
|
),
|
|||
|
);
|
|||
|
}
|
|||
|
}
|