1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import 'package:flutter/material.dart';
- import 'package:fooddeliveryapp/constants.dart';
- import 'package:fooddeliveryapp/model/product.dart';
- class ProductTitleWithImage extends StatelessWidget {
- const ProductTitleWithImage({
- Key key,
- @required this.product,
- }) : super(key: key);
- final Product product;
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: kDefaultPaddin),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "最最美味的菜品来自海底捞",
- style: TextStyle(color: Colors.white),
- ),
- Text(
- product.title,
- style: Theme.of(context)
- .textTheme
- .headline4
- .copyWith(color: Colors.white, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: kDefaultPaddin),
- Row(
- children: [
- RichText(
- text: TextSpan(
- children: [
- TextSpan(text: "价格\n"),
- TextSpan(
- text: "${product.price}元",
- style: Theme.of(context).textTheme.headline4.copyWith(
- color: Colors.white, fontWeight: FontWeight.bold),
- ),
- ],
- ),
- ),
- SizedBox(width: kDefaultPaddin),
- Expanded(
- child: Hero(
- tag: "${product.id}",
- child: Image.asset(
- product.image,
- fit: BoxFit.fill,
- ),
- ),
- )
- ],
- )
- ],
- ),
- );
- }
- }
|