Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin features frontend #629

Merged
merged 9 commits into from
Dec 19, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ class BasicUser {
String bio;
bool emailNotificationPreference;
bool showActivity;
String userType;

BasicUser({
required this.basicUserId,
required this.bio,
required this.emailNotificationPreference,
required this.showActivity,
this.basicUserId = 0,
this.bio = "",
this.emailNotificationPreference = true,
this.showActivity = true,
this.userType = "",
});
factory BasicUser.fromJson(Map<String, dynamic> jsonString) {
return BasicUser(
basicUserId: jsonString["basic_user_id"],
bio: jsonString["bio"],
emailNotificationPreference: jsonString["email_notification_preference"],
showActivity: jsonString["show_activity_preference"],
userType: jsonString["user_type"],
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import 'package:collaborative_science_platform/screens/home_page/home_page.dart';
import 'package:collaborative_science_platform/utils/colors.dart';
import 'package:collaborative_science_platform/utils/text_styles.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

class ErrorPage extends StatelessWidget {
static const routeName = '/page_not_found/';
const ErrorPage({
super.key,
});

@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const SizedBox(height: 20),
Container(
margin: const EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 0.0),
child: Text(
"404",
style: TextStyles.title4.copyWith(fontSize: 120),
),
),
Container(
margin: const EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: const Text(
"This page doesn't exist.",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: AppColors.secondaryDarkColor,
),
),
),
const SizedBox(height: 8.0), // Add space between texts
MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
context.go(HomePage.routeName);
},
child: const Text(
"Return to main page",
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 67, 85, 186),
),
),
),
),
],
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return const AlertDialog(
title: SizedBox(
width: 500,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Are you sure?', style: TextStyle(fontSize: 20.0)),
],
),
),
backgroundColor: Colors.white,
shadowColor: Colors.white,
content: null,
);
}
}
Loading