Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/make_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build Web Version
run: flutter build web --release --dart-define=APP_ENV=prod
- name: Accept Android SDK licenses
run: yes | sdkmanager --licenses
run: echo yes | sdkmanager --licenses

- name: Build APK
run: |
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cmake.sourceDirectory": "/home/engon/rbo/ins/windows/runner"
}
50 changes: 0 additions & 50 deletions deployfirebase.jl

This file was deleted.

3 changes: 2 additions & 1 deletion l10n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
import-line: "import 'package:flutter_gen/gen_l10n/app_localizations.dart';"
translate: false
translate: false
synthetic-package: false
32 changes: 6 additions & 26 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import './backend/sessions.dart';
import './pages/dashboard/dashboard.dart';
import './analytics.dart' as analytics;
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

class InS extends StatelessWidget {
const InS({super.key});
Expand All @@ -30,7 +29,6 @@ class InS extends StatelessWidget {
themeMode: themeManager.themeMode,
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
AppLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
Expand Down Expand Up @@ -61,10 +59,7 @@ class InS extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
ErrorPage(
title:
AppLocalizations.of(
context,
)!.errorLoadingYourSession,
title: "Error loading your session",
description: snapshot.error!.toString(),
icon: Icon(
Icons.signal_wifi_off,
Expand All @@ -87,9 +82,7 @@ class InS extends StatelessWidget {
),
),
icon: Icon(Icons.refresh),
label: Text(
AppLocalizations.of(context)!.reload,
),
label: Text("Reload"),
),
),
),
Expand All @@ -110,18 +103,14 @@ class InS extends StatelessWidget {
},
),
),
child: Text(
AppLocalizations.of(context)!.logout,
),
child: Text("logout"),
),
),
),
],
),
),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.error),
),
appBar: AppBar(title: Text("Error")),
);
} else if (!snapshot.hasData) {
return Scaffold(
Expand All @@ -133,11 +122,7 @@ class InS extends StatelessWidget {
color: Theme.of(context).primaryColor,
),
SizedBox(height: 30),
Text(
AppLocalizations.of(
context,
)!.loadingYourOnlineAccounts,
),
Text("Loading your online accounts..."),
],
),
),
Expand All @@ -151,12 +136,7 @@ class InS extends StatelessWidget {
},
);
} else {
return WelcomePage(
title:
AppLocalizations.of(
context,
)!.welcomeToTheIntranetOfSchools,
);
return WelcomePage(title: "Welcome to the Intranet of Schools");
}
},
),
Expand Down
3 changes: 3 additions & 0 deletions lib/backend/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ export './models/user.dart';
export './models/session.dart';
export './models/classroom.dart';
export './models/school.dart';
export './models/schoolapplicationform.dart';
export './models/schoolapplicationformattempt.dart';
export './models/schoolmember.dart';
33 changes: 29 additions & 4 deletions lib/backend/models/classroom.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:convert';

import '../model.dart';
import './profile.dart';

Expand All @@ -24,17 +26,36 @@ class ClassroomMember implements Model {
}
}

class ClassroomInfo implements Model {
final String name;
final String description;
const ClassroomInfo({required this.name, this.description = ""});

@override
Map<String, dynamic> toJson() {
return {'name': name, 'description': description};
}

static ClassroomInfo fromJson(Map<String, dynamic> json) {
return ClassroomInfo(name: json['name'], description: json['description']);
}
}

class Classroom implements Model {
final String id;
final String name;
final String classroomName;
final String role;
final ClassroomInfo info;
final List<String> tags;
final Profile profile;
final String schoolId;

const Classroom({
required this.id,
required this.name,
required this.classroomName,
required this.role,
required this.info,
required this.tags,
required this.profile,
required this.schoolId,
});
Expand All @@ -43,18 +64,22 @@ class Classroom implements Model {
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'classroom_name': classroomName,
'role': role,
'profile': profile.toJson(),
'school_id': schoolId,
'tags': tags,
'info': info.toJson(),
};
}

factory Classroom.fromJson(Map<String, dynamic> json) {
var cls = Classroom(
id: json['id'],
name: json['name'],
classroomName: json['classroom_name'],
role: json['role'],
info: ClassroomInfo.fromJson(json['info']),
tags: List<String>.from(json['tags'].map((tag) => tag.toString())),
profile: Profile.fromJson(json['profile']),
schoolId: json['school_id'],
);
Expand Down
Loading