Zebra pattern in skills and project page and a little delay in init to show off the init view

This commit is contained in:
2025-05-16 00:04:23 +02:00
parent ebd5b994de
commit 6641254a5f
2 changed files with 30 additions and 18 deletions

View File

@@ -6,6 +6,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
Future<bool> initApp() async {
await dotenv.load();
await Future.delayed(const Duration(seconds : 2));
return await checkToken();
}
class InitScreen extends StatelessWidget {

View File

@@ -107,13 +107,19 @@ class ProfileScreen extends StatelessWidget {
itemCount: skills.length,
itemBuilder: (context, index) {
final skill = skills[index] as Map<String, dynamic>;
return ListTile(
title: Text(skill['name']),
trailing: Text(
skill['level'].toStringAsFixed(2),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,),
final isEven = index % 2 == 0;
return Container(
color: isEven ? Colors.white70 : Colors.grey[200], // alternate row colors
child: ListTile(
title: Text(skill['name']),
trailing: Text(
skill['level'].toStringAsFixed(2),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
);
},
@@ -122,31 +128,36 @@ class ProfileScreen extends StatelessWidget {
itemCount: projects.length,
itemBuilder: (context, index) {
final project = projects[index] as Map<String, dynamic>;
final isEven = index % 2 == 0;
Text project_grade;
if (project['final_mark'] == null) {
project_grade = const Text(
'pending',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black38,
fontSize: 18
fontWeight: FontWeight.bold,
color: Colors.black38,
fontSize: 18,
),
);
}
else {
} else {
var color = (project['validated?']) ? Colors.green : Colors.red;
project_grade = Text(
project['final_mark'].toStringAsFixed(2),
style: TextStyle(
fontWeight: FontWeight.bold,
color: color,
fontSize: 18
fontWeight: FontWeight.bold,
color: color,
fontSize: 18,
),
);
}
return ListTile(
title: Text(project['project']['name']),
trailing: project_grade
return Container(
color: isEven ? Colors.white70 : Colors.grey[200],
child: ListTile(
title: Text(project['project']['name']),
trailing: project_grade,
),
);
},
),