change readme
This commit is contained in:
parent
cfb4611ec5
commit
3f068f246e
17
README.md
17
README.md
|
@ -1,16 +1,3 @@
|
|||
# slothmu
|
||||
# loris
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
the best fedi client for gotosocial and mastodon (soon)(i promise)
|
||||
|
|
|
@ -1,20 +1,32 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../settings.dart' as settings;
|
||||
import '../../global.dart' as global;
|
||||
|
||||
class Timeline {}
|
||||
|
||||
Future<http.Response> getTimelineFromServer() async {
|
||||
const limit = 4;
|
||||
final token = await settings.loadToken();
|
||||
final baseUrl = await settings.loadInstanceUrl();
|
||||
final url = Uri(
|
||||
scheme: "https",
|
||||
host: baseUrl,
|
||||
path: "/api/v1/timelines/home",
|
||||
queryParameters: {"limit": limit.toString()},
|
||||
);
|
||||
|
||||
Map<String, String> headers = {"Authorization": "Bearer $token"};
|
||||
headers.addAll(global.defaultHeaders);
|
||||
|
||||
final response = await http.get(url, headers: headers);
|
||||
final json = jsonDecode(response.body);
|
||||
|
||||
int i = 0;
|
||||
while (i < limit) {
|
||||
print(json[i]["id"]);
|
||||
i ++;
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@ class _TimelineState extends State<Timeline> {
|
|||
Future fetchMore() async {
|
||||
loading = true;
|
||||
final response = await tl.getTimelineFromServer();
|
||||
print(response.body);
|
||||
print(response.statusCode);
|
||||
setState(() {
|
||||
if (children.isNotEmpty) {
|
||||
children.removeAt(children.length - 1);
|
||||
|
|
Loading…
Reference in New Issue