Skip to content

Commit

Permalink
♻️: refactor profil page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuta1409 committed Mar 15, 2024
1 parent 3455eae commit 00fe001
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 43 deletions.
47 changes: 4 additions & 43 deletions frontend/app_student/lib/profils/views/profil_page.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:app_student/class_groups/views/widgets/header/header_text.dart';
import 'package:app_student/menu/menu_view.dart';
import 'package:app_student/profils/views/widgets/class_group_button.dart';
import 'package:app_student/profils/views/widgets/user_class_card.dart';
import 'package:app_student/profils/views/widgets/user_info_card.dart';
import 'package:flutter/material.dart';
import 'package:app_student/login/widgets/header/header_logo.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:intl/intl.dart';

Expand Down Expand Up @@ -42,48 +43,8 @@ class ProfilPage extends StatelessWidget {
'${AppLocalizations.of(context)!.profilMessageTitle} $firstName',
),
),
Padding(
padding: const EdgeInsets.all(30.0),
child: Card(
child: ListTile(
leading: SizedBox(
width: 50,
child: ColorFiltered(
colorFilter: const ColorFilter.mode(
Color(0xFF005067), BlendMode.srcIn),
child: SvgPicture.asset(
'assets/images/user.svg',
width: 30,
height: 30,
),
),
),
title: Text(className),
subtitle: Text(firstName),
),
),
),
Padding(
padding: const EdgeInsets.all(30.0),
child: Card(
child: ListTile(
leading: SizedBox(
width: 50,
child: ColorFiltered(
colorFilter: const ColorFilter.mode(
Color(0xFF005067), BlendMode.srcIn),
child: SvgPicture.asset(
'assets/images/student-info.svg',
width: 30,
height: 30,
),
),
),
title: Text(ine),
subtitle: Text(birthDateString),
),
),
),
UserClassCard(className: className, firstName: firstName),
UserInfoCard(ine: ine, birthDate: birthDateString),
const ClassGroupButton(),
],
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class UserClassCard extends StatelessWidget {
final String className;
final String firstName;

UserClassCard({required this.className, required this.firstName});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(30.0),
child: Card(
child: ListTile(
leading: SizedBox(
width: 50,
child: ColorFiltered(
colorFilter: const ColorFilter.mode(
Color(0xFF005067), BlendMode.srcIn),
child: SvgPicture.asset(
'assets/images/user.svg',
width: 30,
height: 30,
),
),
),
title: Text(className),
subtitle: Text(firstName),
),
),
);
}
}
35 changes: 35 additions & 0 deletions frontend/app_student/lib/profils/views/widgets/user_info_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class UserInfoCard extends StatelessWidget {
final String ine;
final String birthDate;

UserInfoCard({required this.ine, required this.birthDate});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(30.0),
child: Card(
child: ListTile(
leading: SizedBox(
width: 50,
child: ColorFiltered(
colorFilter: const ColorFilter.mode(
Color(0xFF005067), BlendMode.srcIn),
child: SvgPicture.asset(
'assets/images/student-info.svg',
width: 30,
height: 30,
),
),
),
title: Text(ine),
subtitle: Text(birthDate),
),
),
);
}
}

0 comments on commit 00fe001

Please sign in to comment.