ads api working
This commit is contained in:
@@ -19,8 +19,8 @@ class FilcAPI {
|
||||
static const supporters = "https://api.refilc.hu/v1/public/supporters";
|
||||
|
||||
// Private API
|
||||
static const config = "https://api.refilc.hu/v1/private/config";
|
||||
static const ads = "https://api.refilc.hu/v1/private/ads";
|
||||
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";
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:filcnaplo/api/client.dart';
|
||||
import 'package:filcnaplo/api/providers/ad_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/live_card_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/news_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||
@@ -104,6 +105,8 @@ class App extends StatelessWidget {
|
||||
create: (context) => NewsProvider(context: context)),
|
||||
ChangeNotifierProvider<UpdateProvider>(
|
||||
create: (context) => UpdateProvider(context: context)),
|
||||
ChangeNotifierProvider<AdProvider>(
|
||||
create: (context) => AdProvider(context: context)),
|
||||
|
||||
// user data (kreten) providers
|
||||
ChangeNotifierProvider<GradeProvider>(
|
||||
|
||||
@@ -5,14 +5,16 @@ class Ad {
|
||||
Uri? logoUrl;
|
||||
bool overridePremium;
|
||||
DateTime date;
|
||||
Uri launchUrl;
|
||||
|
||||
Ad({
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.author,
|
||||
required this.logoUrl,
|
||||
this.logoUrl,
|
||||
this.overridePremium = false,
|
||||
required this.date,
|
||||
required this.launchUrl,
|
||||
});
|
||||
|
||||
factory Ad.fromJson(Map json) {
|
||||
@@ -24,6 +26,7 @@ class Ad {
|
||||
overridePremium: json['override_premium'] ?? false,
|
||||
date:
|
||||
json['date'] != null ? DateTime.parse(json['date']) : DateTime.now(),
|
||||
launchUrl: Uri.parse(json['launch_url'] ?? 'https://refilc.hu'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user