add some properties to YahooAuctionsItem, show images in home view

This commit is contained in:
Lynne Megido 2020-09-30 21:38:07 +10:00
parent 2ff6324a69
commit 0c2d9e20eb
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
3 changed files with 19 additions and 5 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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(