Revert "Rename everything filcnaplo-related to refilc"

This reverts commit d1a9625d93.
This commit is contained in:
Pearoo
2023-09-19 18:16:57 +02:00
parent d1a9625d93
commit 7b517b333a
669 changed files with 39481 additions and 39799 deletions

View File

@@ -0,0 +1,40 @@
import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class AccountTile extends StatelessWidget {
const AccountTile({Key? key, this.onTap, this.onTapMenu, this.profileImage, this.name, this.username}) : super(key: key);
final void Function()? onTap;
final void Function()? onTapMenu;
final Widget? profileImage;
final Widget? name;
final Widget? username;
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent,
child: ListTile(
visualDensity: VisualDensity.compact,
contentPadding: const EdgeInsets.only(left: 12.0),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
onTap: onTap,
onLongPress: onTapMenu,
leading: profileImage,
title: name,
subtitle: username,
trailing: onTapMenu != null
? Material(
color: Colors.transparent,
child: IconButton(
splashRadius: 24.0,
onPressed: onTapMenu,
icon: Icon(FeatherIcons.moreVertical, color: AppColors.of(context).text.withOpacity(0.8)),
),
)
: null,
),
);
}
}

View File

@@ -0,0 +1,61 @@
import 'package:filcnaplo/models/user.dart';
import 'package:filcnaplo_mobile_ui/common/bottom_card.dart';
import 'package:filcnaplo_mobile_ui/common/detail.dart';
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
import 'package:filcnaplo_mobile_ui/screens/settings/accounts/account_tile.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'account_view.i18n.dart';
class AccountView extends StatelessWidget {
const AccountView(this.user, {Key? key}) : super(key: key);
final User user;
static void show(User user, {required BuildContext context}) =>
showBottomCard(context: context, child: AccountView(user));
@override
Widget build(BuildContext context) {
List<String> _nameParts = user.name.split(" ");
String _firstName = _nameParts.length > 1 ? _nameParts[1] : _nameParts[0];
return Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AccountTile(
profileImage: ProfileImage(
name: _firstName,
backgroundColor: Theme.of(context).colorScheme.primary,
role: user.role,
),
name: SelectableText(
user.name,
style: const TextStyle(fontWeight: FontWeight.w500),
maxLines: 2,
minLines: 1,
),
username: SelectableText(user.username),
),
// User details
Detail(
title: "birthdate".i18n,
description:
DateFormat("yyyy. MM. dd.").format(user.student.birth)),
Detail(title: "school".i18n, description: user.student.school.name),
if (user.student.className != null)
Detail(title: "class".i18n, description: user.student.className!),
if (user.student.address != null)
Detail(title: "address".i18n, description: user.student.address!),
if (user.student.parents.isNotEmpty)
Detail(
title: "parents".plural(user.student.parents.length),
description: user.student.parents.join(", ")),
],
),
);
}
}

View File

@@ -0,0 +1,33 @@
import 'package:i18n_extension/i18n_extension.dart';
extension Localization on String {
static final _t = Translations.byLocale("hu_hu") +
{
"en_en": {
"birthdate": "Birth date",
"school": "School",
"class": "Class",
"address": "Home address",
"parents": "Parents".one("Parent"),
},
"hu_hu": {
"birthdate": "Születési dátum",
"school": "Iskola",
"class": "Osztály",
"address": "Lakcím",
"parents": "Szülők".one("Szülő"),
},
"de_de": {
"birthdate": "Geburtsdatum",
"school": "Schule",
"class": "Klasse",
"address": "Wohnanschrift",
"parents": "Eltern",
},
};
String get i18n => localize(this, _t);
String fill(List<Object> params) => localizeFill(this, params);
String plural(int value) => localizePlural(value, this, _t);
String version(Object modifier) => localizeVersion(modifier, this, _t);
}