Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe7c5b65e8 | |||
40afd685dd | |||
dd9a61bcca |
@ -12,6 +12,7 @@ steps:
|
||||
api_key:
|
||||
from_secret: gitea_api_key
|
||||
base_url: https://git.lat
|
||||
draft: true
|
||||
files: build/app/outputs/apk/release/app-release.apk
|
||||
when:
|
||||
event:
|
||||
|
@ -20,6 +20,13 @@ class _HomeState extends State<Home> {
|
||||
f0cks = fetchDataFromApi();
|
||||
}
|
||||
|
||||
Future loadf0cks() {
|
||||
setState(() {
|
||||
f0cks = fetchDataFromApi();
|
||||
});
|
||||
return f0cks;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -32,8 +39,14 @@ class _HomeState extends State<Home> {
|
||||
body: FutureBuilder<List<Item>>(
|
||||
future: f0cks,
|
||||
builder: (context, snapshot) {
|
||||
if(snapshot.hasData) {
|
||||
return CustomScrollView(
|
||||
if(!snapshot.hasData) {
|
||||
return Text("${snapshot.error}");
|
||||
}
|
||||
return RefreshIndicator(
|
||||
onRefresh: () {
|
||||
return loadf0cks();
|
||||
},
|
||||
child: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
slivers: <Widget>[
|
||||
SliverGrid(
|
||||
@ -83,11 +96,8 @@ class _HomeState extends State<Home> {
|
||||
)
|
||||
),
|
||||
]
|
||||
);
|
||||
} else if(snapshot.hasError) {
|
||||
return Text("${snapshot.error}");
|
||||
}
|
||||
return const CircularProgressIndicator();
|
||||
)
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
@ -27,36 +27,31 @@ class _ItemPageState extends State<ItemPage> with SingleTickerProviderStateMixin
|
||||
return FutureBuilder<Item>(
|
||||
future: f0ck,
|
||||
builder: (context, snapshot) {
|
||||
if(snapshot.hasData) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('f0ck $id'),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
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}");
|
||||
if(!snapshot.hasData) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
return const CircularProgressIndicator();
|
||||
final deviceSize = MediaQuery.of(context).size;
|
||||
//final aspectRatio = widget.item.width / widget.item.height;
|
||||
//final containerHeight = deviceSize.width / aspectRatio;
|
||||
|
||||
return RefreshIndicator(
|
||||
onRefresh: () {
|
||||
return fetchItemFromApi(id);
|
||||
},
|
||||
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"),
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user