add some properties to YahooAuctionsItem, show images in home view
This commit is contained in:
parent
2ff6324a69
commit
0c2d9e20eb
3 changed files with 19 additions and 5 deletions
|
@ -2,7 +2,12 @@ import 'package:flutter/foundation.dart';
|
|||
|
||||
class YahooAuctionsItem {
|
||||
String name;
|
||||
String imageUrl = "https://lynnesbian.space/res/ceres/lesbun_full.jpg";
|
||||
int price;
|
||||
int bids;
|
||||
// ending time
|
||||
bool buyItNow;
|
||||
bool autoExtension;
|
||||
|
||||
YahooAuctionsItem({
|
||||
@required this.name,
|
||||
|
|
|
@ -5,6 +5,8 @@ import 'package:sprintf/sprintf.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:transparent_image/transparent_image.dart';
|
||||
|
||||
class RouteHome extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
|
@ -56,10 +58,17 @@ class _MainPageState extends State<MainPage> {
|
|||
String key = listings.items.keys.elementAt(i);
|
||||
return ListTile(
|
||||
title: Text(listings.items[key].name),
|
||||
subtitle: Text(sprintf(
|
||||
"¥%d (≈\$%2.2f)",
|
||||
[listings.items[key].price, listings.items[key].getLocalPrice()]
|
||||
)),
|
||||
subtitle: Text(
|
||||
sprintf(
|
||||
"¥%d (≈\$%2.2f)",
|
||||
[listings.items[key].price, listings.items[key].getLocalPrice()]
|
||||
)
|
||||
),
|
||||
leading: FadeInImage.memoryNetwork(
|
||||
placeholder: kTransparentImage,
|
||||
image: listings.items[key].imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
|
|
|
@ -63,7 +63,7 @@ class _RouteViewListingState extends State<RouteViewListing> {
|
|||
children: [
|
||||
FadeInImage.memoryNetwork(
|
||||
placeholder: kTransparentImage,
|
||||
image: 'https://lynnesbian.space/res/ceres/lesbun_full.jpg',
|
||||
image: thisListing.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
const DecoratedBox(
|
||||
|
|
Loading…
Reference in a new issue