changed api endpoints to refilc api

This commit is contained in:
Kima 2023-05-28 17:32:38 +02:00
parent ebdac408b0
commit e75112b043
2 changed files with 8 additions and 6 deletions

View File

@ -12,13 +12,13 @@ import 'package:connectivity_plus/connectivity_plus.dart';
class FilcAPI {
// Public API
static const schoolList = "https://filcnaplo.hu/v2/school_list.json";
static const news = "https://filcnaplo.hu/v2/news.json";
static const supporters = "https://api.filcnaplo.hu/sponsors";
static const schoolList = "https://api.refilc.hu/v1/public/school-list";
static const news = "https://api.refilc.hu/v1/public/news";
static const supporters = "https://api.refilc.hu/v1/public/supporters";
// Private API
static const config = "https://api.filcnaplo.hu/config";
static const reportApi = "https://api.filcnaplo.hu/report";
static const config = "https://api.refilc.hu/v1/private/config";
static const reportApi = "https://api.refilc.hu/v1/private/crash-report";
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
// static const premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
@ -68,6 +68,7 @@ class FilcAPI {
http.Response res = await http.get(Uri.parse(config), headers: headers);
if (res.statusCode == 200) {
print(jsonDecode(res.body));
return Config.fromJson(jsonDecode(res.body));
} else if (res.statusCode == 429) {
res = await http.get(Uri.parse(config));

View File

@ -285,10 +285,11 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
.clamp(-1.0, 1.0);
} else if (notification is ScrollEndNotification) {
_tabController.index = _pageController.page!.round();
if (!_tabController.indexIsChanging)
if (!_tabController.indexIsChanging) {
_tabController.offset =
(_pageController.page! - _tabController.index)
.clamp(-1.0, 1.0);
}
}
return false;
},