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
3 changes: 3 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
2 changes: 1 addition & 1 deletion lib/animations/page/slide.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SlidePageRoute extends PageRouteBuilder {
SlidePageRoute({
super.settings,
required this.child,
this.duration = const Duration(milliseconds: 400),
this.duration = const Duration(milliseconds: 100),
this.direction = AxisDirection.left,
}) : super(
pageBuilder:
Expand Down
58 changes: 48 additions & 10 deletions lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,59 @@
import 'package:flutter/material.dart';
import 'package:ins/theme.dart';
import 'package:ins/pages/home.dart' as home;
import 'package:ins/pages/home.dart'
as home; // Ensure home.getPage() returns a Widget
import 'package:ins/l10n/app_localizations.dart';
import 'package:ins/locale.dart' as locale_manager; // Aliased
import 'package:provider/provider.dart';
import 'package:ins/widgets/loading.dart';

class ISApp extends StatelessWidget {
const ISApp({super.key});

@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: themeManager,
builder: (_, _) {
return MaterialApp(
title: 'IS',
theme: themeManager.getTheme(),
home: home.getPage(),
);
},
return ChangeNotifierProvider<locale_manager.LocaleProvider>(
create: (_) => locale_manager.getProvider(),
child: Consumer<locale_manager.LocaleProvider>(
builder: (context, localeProvider, child) {
return AnimatedBuilder(
animation: themeManager,
builder: (context, _) {
if (localeProvider.isLoading) {
return MaterialApp(
home: Scaffold(
body: LoadingWidget(messages: ["Loading your locale..."]),
),
);
}
return MaterialApp(
title: 'IS',
locale: localeProvider.locale,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
localeResolutionCallback: (deviceLocale, supportedLocales) {
if (localeProvider.locale != null) {
return localeProvider.locale;
}
if (deviceLocale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode ==
deviceLocale.languageCode) {
// You might want to check countryCode as well if it's important:
// && (deviceLocale.countryCode == null || supportedLocale.countryCode == deviceLocale.countryCode)
return supportedLocale;
}
}
}
return supportedLocales.first;
},
theme: themeManager.getTheme(),
home: home.getPage(),
);
},
);
},
),
);
}
}
1 change: 0 additions & 1 deletion lib/appstate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class AppState {
models.User? user;
AppState({this.session, this.user});
static Future<AppState> load() async {
await Future.delayed(Duration(seconds: 5));
final prefs = await SharedPreferences.getInstance();
final appStateJson = prefs.getString(appStateKey);
if (appStateJson != null) {
Expand Down
30 changes: 30 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"homeLoadingMessages": "Loading app state...|Verifying user details...|Getting permissions from your schools..|Verifying the age on your birth certificate...|Please wait...|Almost there...",
"welcomeExcl": "Welcome!",
"welcomeToIS": "Welcome to IS",
"welcomeConnectOrCreateAccount": "Connect an existing account or create a new one to embark on your journey with us",
"connectAccount": "Connect account",
"createAccount": "Create an account",
"sloganShort": "Empowering connections, empowering futures",
"optionalInformations": "Optional information",
"emailAddress": "Email address",
"phoneNumber": "Phone number",
"signupAssistant_phoneNumberError": "Phone number should be 9 digits long (without country code)",
"addEmailaoPhoneNumber": "Add email and/or phone number",
"fullName": "Full name",
"username": "Username",
"usernameDesc": "A short public name visible by others",
"password": "Password",
"reenterPassword": "Reenter password",
"loginInformations": "Login information",
"passwordsDoNotMatch": "Password do not match",
"passwordShouldHaveAtleast8Characters": "Password should have atleast 8 characters length",
"usernameMustHaveBetween4And20Characters": "Username must have between 3 and 20 characters",
"thisUsernameIsAlreadyTaken": "This username is already taken",
"creatingYourAccount": "Creating you account",
"retry": "Retry",
"accountCreatedSuccesfuly": "Account created succesfuly",
"openDashboard": "Open dashboard",
"waitingMessages": "We're getting this done...|Please wait a little more...|Things are going as expected...|...|Wait once more...|A few moments...",
"continueGt": "Continue >"
}
30 changes: 30 additions & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"homeLoadingMessages": "Verification des details d'utilisateur...|Acquisition de permission de votre ecole..|Veuillez patienter...|Nous y sommes presque...",
"welcomeExcl": "Bienvenue!",
"welcomeToIS": "Bienvenue sur IS",
"welcomeConnectOrCreateAccount": "Connectez un compte existant ou creez en un nouveau pour utiliser IS",
"connectAccount": "Connectez votre compte",
"createAccount": "Creez un compte",
"sloganShort": "Construire des liens puissants, bâtir des avenirs prometteurs",
"optionalInformations": "Informations optionelles",
"emailAddress": "Addresse email",
"phoneNumber": "Numero de telephone",
"signupAssistant_phoneNumberError": "Le numero devrais faire 9 chiffres de long (Sans code iso)",
"addEmailaoPhoneNumber": "Renseigner une addresse email et/ou numero de telephone",
"fullName": "Nom complet",
"username": "Nom d'utilisateur",
"usernameDesc": "Un surnom court, et visible des autres",
"password": "Mot de passe",
"reenterPassword": "Re-entrez votre mot de passe",
"loginInformations": "Informations de connection",
"passwordsDoNotMatch": "Les mot-de-passe ne coincident pas",
"passwordShouldHaveAtleast8Characters": "Le mot-de-passe doit faire au moins 8 characteres de long",
"usernameMustHaveBetween4And20Characters": "Le nom d'utilisateur doit faire entre 3 et 20 characteres de long",
"thisUsernameIsAlreadyTaken": "Ce nom d'utilisateur est deja prit",
"creatingYourAccount": "Nous creons votre compte",
"retry": "Reessayer",
"accountCreatedSuccesfuly": "Compte cree avec succes",
"openDashboard": "Ouvrir le tableaux de bord",
"waitingMessages": "Nous ourons bientot fini...|Attendez encore un peu...|Tout ce passe bien...|...|Un peu plus de temps...|Quelques instants d'attente...",
"continueGt": "Continuer >"
}
Loading