This commit is contained in:
parent
40afd685dd
commit
fe7c5b65e8
|
@ -27,36 +27,31 @@ class _ItemPageState extends State<ItemPage> with SingleTickerProviderStateMixin
|
||||||
return FutureBuilder<Item>(
|
return FutureBuilder<Item>(
|
||||||
future: f0ck,
|
future: f0ck,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if(snapshot.hasData) {
|
if(!snapshot.hasData) {
|
||||||
return Scaffold(
|
return const Center(child: CircularProgressIndicator());
|
||||||
appBar: AppBar(
|
}
|
||||||
title: Text('f0ck $id'),
|
final deviceSize = MediaQuery.of(context).size;
|
||||||
),
|
//final aspectRatio = widget.item.width / widget.item.height;
|
||||||
body: Column(
|
//final containerHeight = deviceSize.width / aspectRatio;
|
||||||
children: [
|
|
||||||
AspectRatio(
|
return RefreshIndicator(
|
||||||
aspectRatio: 1,
|
onRefresh: () {
|
||||||
child: SizedBox(
|
return fetchItemFromApi(id);
|
||||||
width: double.infinity,
|
},
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
width: deviceSize.width,
|
||||||
|
height: 550,//containerHeight,
|
||||||
child: snapshot.data!.mime.startsWith('image') ? Image.network("https://f0ck.dev/b/${snapshot.data?.dest}") : const Text("no image"),
|
child: snapshot.data!.mime.startsWith('image') ? Image.network("https://f0ck.dev/b/${snapshot.data?.dest}") : const Text("no image"),
|
||||||
),
|
)
|
||||||
),
|
]
|
||||||
Container(
|
)
|
||||||
margin: const EdgeInsets.all(20.0),
|
)
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
"${snapshot.data?.mime}",
|
|
||||||
style: const TextStyle(fontSize: 40),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
} else if(snapshot.hasError) {
|
|
||||||
return Text("${snapshot.error}");
|
|
||||||
}
|
|
||||||
return const CircularProgressIndicator();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user