Skip to content

Commit

Permalink
make folder structure feature oriented
Browse files Browse the repository at this point in the history
  • Loading branch information
youngbryanyu committed Feb 22, 2024
1 parent d269912 commit 45d8638
Show file tree
Hide file tree
Showing 21 changed files with 200 additions and 214 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* Authentication wrapper page that handles which page to show in the auth workflow */
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:frontend/pages/auth/login_page.dart";
import "package:frontend/pages/auth/register_page.dart";
import "package:frontend/pages/auth/forgot_password_page.dart";
import "package:frontend/pages/home/home_page.dart";
import "package:frontend/providers/auth/auth_page_provider.dart";
import "package:frontend/providers/auth/firebase_auth_state_provider.dart";
import "package:frontend/auth/pages/login_page.dart";
import "package:frontend/auth/pages/register_page.dart";
import "package:frontend/auth/pages/forgot_password_page.dart";
import "package:frontend/core/pages/home_page.dart";
import "package:frontend/auth/providers/auth_page_selector_provider.dart";
import "package:frontend/auth/providers/firebase_auth_state_provider.dart";

// -----------------------------------------------------------
// THIS SHOULD ALWAYS BE THE PAGE AT THE ROOT OF THE NAVIGATOR
// -----------------------------------------------------------

/* Wrapper class that determines which auth page to show, and whether user is logged in */
class RootPageWrapper extends ConsumerWidget {
const RootPageWrapper({super.key});
class AuthPageSelector extends ConsumerWidget {
const AuthPageSelector({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/components/auth/auth_button.dart';
import 'package:frontend/components/auth/auth_popup.dart';
import 'package:frontend/components/auth/auth_text_field.dart';
import 'package:frontend/providers/auth/auth_page_provider.dart';
import 'package:frontend/auth/components/auth_button.dart';
import 'package:frontend/auth/components/auth_popup.dart';
import 'package:frontend/auth/components/auth_text_field.dart';
import 'package:frontend/auth/providers/auth_page_selector_provider.dart';

/* Login page widget */
class ResetPasswordPage extends ConsumerStatefulWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/components/auth/auth_button.dart';
import 'package:frontend/components/auth/auth_popup.dart';
import 'package:frontend/components/auth/auth_text_field.dart';
import 'package:frontend/providers/auth/auth_page_provider.dart';
import 'package:frontend/auth/components/auth_button.dart';
import 'package:frontend/auth/components/auth_popup.dart';
import 'package:frontend/auth/components/auth_text_field.dart';
import 'package:frontend/auth/providers/auth_page_selector_provider.dart';
// import 'package:frontend/components/auth/auth_logo_tile.dart';
// import 'package:frontend/services/auth/auth_service.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:frontend/components/auth/auth_button.dart';
import 'package:frontend/components/auth/auth_popup.dart';
import 'package:frontend/components/auth/auth_text_field.dart';
import 'package:frontend/providers/auth/auth_page_provider.dart';
import 'package:frontend/auth/components/auth_button.dart';
import 'package:frontend/auth/components/auth_popup.dart';
import 'package:frontend/auth/components/auth_text_field.dart';
import 'package:frontend/auth/providers/auth_page_selector_provider.dart';
// import 'package:frontend/components/auth/auth_logo_tile.dart';
// import 'package:frontend/services/auth/auth_service.dart';

Expand Down
165 changes: 165 additions & 0 deletions frontend/lib/common/styles/themes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/* Light theme */
import 'package:flutter/material.dart';

final ThemeData lightTheme = ThemeData(
brightness: Brightness.light,
useMaterial3: true, // Opt-in to using Material 3 features
colorScheme: ColorScheme.light(
primary: Colors.grey.shade900,
onPrimary: Colors.white,
secondary: Colors.grey.shade700,
onSecondary: Colors.grey.shade200,
background: Colors.grey.shade100,
onBackground: Colors.black,
surface: Colors.grey.shade500,
onSurface: Colors.black,
error: Colors.red[700]!,
onError: Colors.white,
),
inputDecorationTheme: InputDecorationTheme(
fillColor: Colors.grey.shade300,
hintStyle: TextStyle(
color: Colors.grey.shade500,
fontSize: 16,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.shade500,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.shade700,
),
),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.black,
),
displayMedium: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.black,
),
displaySmall: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.black,
),
bodyLarge: TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black,
),
bodyMedium: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.black,
),
bodySmall: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.black,
),
labelLarge: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.white,
),
labelMedium: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white,
),
labelSmall: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
);

/* Dark theme */
final ThemeData darkTheme = ThemeData(
brightness: Brightness.dark,
useMaterial3: true,
colorScheme: ColorScheme.dark(
primary: Colors.grey.shade100,
onPrimary: Colors.black,
secondary: Colors.grey.shade300,
onSecondary: Colors.grey.shade800,
background: Colors.grey.shade900,
onBackground: Colors.white,
surface: Colors.grey.shade500,
onSurface: Colors.black,
error: Colors.red[900]!,
onError: Colors.white,
),
inputDecorationTheme: InputDecorationTheme(
fillColor: Colors.grey.shade700,
hintStyle: TextStyle(
color: Colors.grey.shade500,
fontSize: 16,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.shade500,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.shade300,
),
),
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
),
displayMedium: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
displaySmall: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
bodyLarge: TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.white,
),
bodyMedium: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.white,
),
bodySmall: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.white,
),
labelLarge: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black,
),
labelMedium: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.black,
),
labelSmall: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
);
File renamed without changes.
Loading

0 comments on commit 45d8638

Please sign in to comment.