86 lines
2.5 KiB
Dart
86 lines
2.5 KiB
Dart
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables, file_names
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:smilet/User.dart';
|
|
import 'package:smilet/StartPage.dart';
|
|
|
|
// Map schoolDetails = {};
|
|
|
|
String file = "";
|
|
|
|
class Profile extends StatelessWidget {
|
|
final User user;
|
|
final schoolDetails;
|
|
const Profile({super.key, required this.user, required this.schoolDetails});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (schoolDetails["school"].toString().toUpperCase() == 'SU') {
|
|
file = "SULogga";
|
|
} else {
|
|
file = "smilet";
|
|
}
|
|
// checkSchool(user.getSchoolCode());
|
|
return Center(
|
|
child: Column(children: [
|
|
Text(user.getUsername(),
|
|
style: TextStyle(
|
|
fontSize: 50,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
Padding(
|
|
padding: const EdgeInsets.all(30.0),
|
|
child: SizedBox(
|
|
width: 250,
|
|
height: 250,
|
|
child: Image.asset(
|
|
'assets/images/${file}.png',
|
|
fit: BoxFit.scaleDown,
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Text('',
|
|
style: TextStyle(
|
|
fontSize: 50,
|
|
fontWeight: FontWeight.bold,
|
|
))),
|
|
Text('Universitet: ${schoolDetails["school"].toString().toUpperCase()}',
|
|
style: TextStyle(
|
|
fontSize: 40,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
Text(schoolDetails["institution"].toString().toUpperCase(),
|
|
style: TextStyle(
|
|
fontSize: 35,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
Expanded(
|
|
child: Text('',
|
|
style: TextStyle(
|
|
fontSize: 50,
|
|
fontWeight: FontWeight.bold,
|
|
))),
|
|
Padding(
|
|
padding: const EdgeInsets.only(bottom: 20.0), //the distance you want
|
|
child: ElevatedButton(
|
|
style: TextButton.styleFrom(
|
|
backgroundColor: Color.fromARGB(255, 249, 70, 11),
|
|
fixedSize: Size(130, 40),
|
|
),
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => StartPage(title: "Smilet")));
|
|
},
|
|
child: Text('Logga ut',
|
|
style: TextStyle(fontSize: 15, color: Colors.white))),
|
|
)
|
|
]),
|
|
);
|
|
}
|
|
}
|