forked from firka/student-legacy
changed api endpoints to refilc api
This commit is contained in:
parent
ebdac408b0
commit
e75112b043
@ -12,13 +12,13 @@ import 'package:connectivity_plus/connectivity_plus.dart';
|
|||||||
|
|
||||||
class FilcAPI {
|
class FilcAPI {
|
||||||
// Public API
|
// Public API
|
||||||
static const schoolList = "https://filcnaplo.hu/v2/school_list.json";
|
static const schoolList = "https://api.refilc.hu/v1/public/school-list";
|
||||||
static const news = "https://filcnaplo.hu/v2/news.json";
|
static const news = "https://api.refilc.hu/v1/public/news";
|
||||||
static const supporters = "https://api.filcnaplo.hu/sponsors";
|
static const supporters = "https://api.refilc.hu/v1/public/supporters";
|
||||||
|
|
||||||
// Private API
|
// Private API
|
||||||
static const config = "https://api.filcnaplo.hu/config";
|
static const config = "https://api.refilc.hu/v1/private/config";
|
||||||
static const reportApi = "https://api.filcnaplo.hu/report";
|
static const reportApi = "https://api.refilc.hu/v1/private/crash-report";
|
||||||
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
|
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
|
||||||
// static const premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
|
// 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);
|
http.Response res = await http.get(Uri.parse(config), headers: headers);
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
|
print(jsonDecode(res.body));
|
||||||
return Config.fromJson(jsonDecode(res.body));
|
return Config.fromJson(jsonDecode(res.body));
|
||||||
} else if (res.statusCode == 429) {
|
} else if (res.statusCode == 429) {
|
||||||
res = await http.get(Uri.parse(config));
|
res = await http.get(Uri.parse(config));
|
||||||
|
@ -285,11 +285,12 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
.clamp(-1.0, 1.0);
|
.clamp(-1.0, 1.0);
|
||||||
} else if (notification is ScrollEndNotification) {
|
} else if (notification is ScrollEndNotification) {
|
||||||
_tabController.index = _pageController.page!.round();
|
_tabController.index = _pageController.page!.round();
|
||||||
if (!_tabController.indexIsChanging)
|
if (!_tabController.indexIsChanging) {
|
||||||
_tabController.offset =
|
_tabController.offset =
|
||||||
(_pageController.page! - _tabController.index)
|
(_pageController.page! - _tabController.index)
|
||||||
.clamp(-1.0, 1.0);
|
.clamp(-1.0, 1.0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: PageView.custom(
|
child: PageView.custom(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user