Compare commits
17 Commits
3.0.0-beta
...
3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ffe4b6c33 | ||
|
|
7bd5d8bd5a | ||
|
|
c0ffa5d726 | ||
|
|
befb107183 | ||
|
|
e56488094e | ||
|
|
74831c3e56 | ||
|
|
9d3347d680 | ||
|
|
25100ab7d9 | ||
|
|
b509adcbc9 | ||
|
|
d421ae9031 | ||
|
|
c3b79fcb3f | ||
|
|
3cf57ac6d4 | ||
|
|
d72bf84a36 | ||
|
|
638b8c9413 | ||
|
|
d5bdca698b | ||
|
|
ea6b2ec73d | ||
|
|
7ffb58c9ac |
1
filcnaplo/android/.gitignore
vendored
1
filcnaplo/android/.gitignore
vendored
@@ -9,3 +9,4 @@ GeneratedPluginRegistrant.java
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
.project
|
||||
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import 'package:filcnaplo/models/config.dart';
|
||||
import 'package:filcnaplo/models/news.dart';
|
||||
import 'package:filcnaplo/models/release.dart';
|
||||
import 'package:filcnaplo/models/supporter.dart';
|
||||
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -10,6 +11,7 @@ class FilcAPI {
|
||||
static const SCHOOL_LIST = "https://filcnaplo.hu/v2/school_list.json";
|
||||
static const CONFIG = "https://filcnaplo.hu/v2/config.json";
|
||||
static const NEWS = "https://filcnaplo.hu/v2/news.json";
|
||||
static const SUPPORTERS = "https://filcnaplo.hu/v2/supporters.json";
|
||||
static const REPO = "filc/naplo";
|
||||
static const RELEASES = "https://api.github.com/repos/$REPO/releases";
|
||||
|
||||
@@ -18,7 +20,13 @@ class FilcAPI {
|
||||
http.Response res = await http.get(Uri.parse(SCHOOL_LIST));
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
return (jsonDecode(res.body) as List).cast<Map>().map((json) => School.fromJson(json)).toList();
|
||||
List<School> schools = (jsonDecode(res.body) as List).cast<Map>().map((json) => School.fromJson(json)).toList();
|
||||
schools.add(School(
|
||||
city: "Tiszabura",
|
||||
instituteCode: "supporttest-reni-tiszabura-teszt01",
|
||||
name: "FILC Éles Reni tiszabura-teszt",
|
||||
));
|
||||
return schools;
|
||||
} else {
|
||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||
}
|
||||
@@ -55,6 +63,20 @@ class FilcAPI {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Supporters?> getSupporters() async {
|
||||
try {
|
||||
http.Response res = await http.get(Uri.parse(SUPPORTERS));
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
return Supporters.fromJson(jsonDecode(res.body));
|
||||
} else {
|
||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||
}
|
||||
} catch (error) {
|
||||
print("ERROR: FilcAPI.getSupporters: $error");
|
||||
}
|
||||
}
|
||||
|
||||
static Future<List<Release>?> getReleases() async {
|
||||
try {
|
||||
http.Response res = await http.get(Uri.parse(RELEASES));
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:filcnaplo/api/client.dart';
|
||||
import 'package:filcnaplo/api/providers/news_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||
@@ -77,8 +79,11 @@ class App extends StatelessWidget {
|
||||
builder: (context, themeMode, child) {
|
||||
return MaterialApp(
|
||||
builder: (context, child) {
|
||||
// Limit font size scaling to 1.0
|
||||
double textScaleFactor = min(MediaQuery.of(context).textScaleFactor, 1.0);
|
||||
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
|
||||
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
|
||||
child: child ?? Container(),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -14,9 +14,9 @@ class SubjectIcon {
|
||||
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") return Icons.calculate_outlined;
|
||||
if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) return Icons.spellcheck_outlined;
|
||||
if (RegExp("irodalom").hasMatch(name)) return Icons.menu_book_outlined;
|
||||
if (RegExp("rajz|muvtori|muveszet|kultura").hasMatch(name)) return Icons.palette_outlined;
|
||||
if (RegExp("tor(i|tenelem)").hasMatch(name)) return Icons.hourglass_empty_outlined;
|
||||
if (RegExp("foldrajz").hasMatch(name)) return Icons.public_outlined;
|
||||
if (RegExp("rajz|muvtori|muveszet|kultura").hasMatch(name)) return Icons.palette_outlined;
|
||||
if (RegExp("fizika").hasMatch(name)) return Icons.emoji_objects_outlined;
|
||||
if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) return Icons.music_note_outlined;
|
||||
if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) return Icons.sports_soccer_outlined;
|
||||
|
||||
38
filcnaplo/lib/models/supporter.dart
Normal file
38
filcnaplo/lib/models/supporter.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
class Supporter {
|
||||
String name;
|
||||
String amount;
|
||||
String platform;
|
||||
|
||||
Supporter(this.name, this.amount, this.platform);
|
||||
|
||||
factory Supporter.fromJson(Map json) {
|
||||
return Supporter(
|
||||
json["name"] ?? "",
|
||||
json["amount"] ?? "",
|
||||
json["platform"] ?? "",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Supporters {
|
||||
List<Supporter> top;
|
||||
List<Supporter> all;
|
||||
int progress;
|
||||
int max;
|
||||
|
||||
Supporters({
|
||||
required this.top,
|
||||
required this.all,
|
||||
required this.progress,
|
||||
required this.max,
|
||||
});
|
||||
|
||||
factory Supporters.fromJson(Map json) {
|
||||
return Supporters(
|
||||
max: (json["progress"] ?? {})["max"] ?? 1,
|
||||
progress: (json["progress"] ?? {})["value"] ?? 0,
|
||||
all: ((json["all"] ?? []) as List).cast<Map>().map((e) => Supporter.fromJson(e)).toList(),
|
||||
top: ((json["top"] ?? []) as List).cast<Map>().map((e) => Supporter.fromJson(e)).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ extension StringFormatUtils on String {
|
||||
|
||||
String capital() => this.length > 0 ? this[0].toUpperCase() + this.substring(1) : "";
|
||||
|
||||
String capitalize() => this.split(" ").map((w) => this.capital()).join(" ");
|
||||
String capitalize() => this.split(" ").map((w) => w.capital()).join(" ");
|
||||
|
||||
String escapeHtml() {
|
||||
String htmlString = this;
|
||||
@@ -37,11 +37,11 @@ extension DateFormatUtils on DateTime {
|
||||
if (timeOnly) return DateFormat("HH:mm").format(this);
|
||||
|
||||
DateTime now = DateTime.now();
|
||||
if (this.difference(now).inDays == 0) {
|
||||
if (now.year == this.year && now.month == this.month && now.day == this.day) {
|
||||
if (this.hour == 0 && this.minute == 0 && this.second == 0) return "Today".i18n;
|
||||
return DateFormat("HH:mm").format(this);
|
||||
}
|
||||
if (this.difference(now).inDays == 1) return "Yesterday".i18n;
|
||||
if (now.year == this.year && now.month == this.month && now.subtract(Duration(days: 1)).day == this.day) return "Yesterday".i18n;
|
||||
|
||||
String formatString;
|
||||
if (this.year == now.year)
|
||||
|
||||
@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
|
||||
homepage: https://filcnaplo.hu
|
||||
publish_to: "none"
|
||||
|
||||
version: 3.0.0-beta.3+125
|
||||
version: 3.0.0+128
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
|
||||
Submodule filcnaplo_kreta_api updated: 9d09624313...3799d50fdd
Submodule filcnaplo_mobile_ui updated: 51578dd62a...e23ffd7fb7
Reference in New Issue
Block a user