Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe7c5b65e8 | |||
40afd685dd | |||
dd9a61bcca |
@ -12,6 +12,7 @@ steps:
|
|||||||
api_key:
|
api_key:
|
||||||
from_secret: gitea_api_key
|
from_secret: gitea_api_key
|
||||||
base_url: https://git.lat
|
base_url: https://git.lat
|
||||||
|
draft: true
|
||||||
files: build/app/outputs/apk/release/app-release.apk
|
files: build/app/outputs/apk/release/app-release.apk
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
|
@ -20,6 +20,13 @@ class _HomeState extends State<Home> {
|
|||||||
f0cks = fetchDataFromApi();
|
f0cks = fetchDataFromApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future loadf0cks() {
|
||||||
|
setState(() {
|
||||||
|
f0cks = fetchDataFromApi();
|
||||||
|
});
|
||||||
|
return f0cks;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -32,8 +39,14 @@ class _HomeState extends State<Home> {
|
|||||||
body: FutureBuilder<List<Item>>(
|
body: FutureBuilder<List<Item>>(
|
||||||
future: f0cks,
|
future: f0cks,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if(snapshot.hasData) {
|
if(!snapshot.hasData) {
|
||||||
return CustomScrollView(
|
return Text("${snapshot.error}");
|
||||||
|
}
|
||||||
|
return RefreshIndicator(
|
||||||
|
onRefresh: () {
|
||||||
|
return loadf0cks();
|
||||||
|
},
|
||||||
|
child: CustomScrollView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
SliverGrid(
|
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>(
|
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();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user