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

Sync main with customize-text branch #6

Merged
merged 20 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v1
- run: flutter build web
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NOTETESTLOL }}'
channelId: notease-preview
projectId: notetestlol
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# AOL-software-engineering
A group project for college assignment :)
A group project for college assignment
Binary file added assets/NoteEaseLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/NoteEaseLogoNoBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 29 additions & 21 deletions lib/email_verification_gate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,36 @@ class EmailVerificationGate extends StatelessWidget {
if (user != null && user.emailVerified) {
return child;
} else {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Please verify your email to access this page.',
textAlign: TextAlign.center,
),
ElevatedButton(
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const LoginPage()), // Navigate to the login page
);
},
child: Text('Go to Login'),
),
],
// Allow access if user is not logged in
if (user == null) {
return child;
} else {
// If user is logged in but email is not verified, show verification message
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Please verify your email to access this page.',
textAlign: TextAlign.center,
),
ElevatedButton(
onPressed: () {
// Redirect to login page
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const LoginPage()),
);
},
child: const Text('Go to Login'),
),
],
),
),
),
);
);
}
}
}
}

173 changes: 139 additions & 34 deletions lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:math';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:testnote/list.dart';
import 'package:testnote/login.dart';
Expand Down Expand Up @@ -48,34 +49,42 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: GestureDetector(
onTap: () {
// Open the link when the title is clicked
launchUrl(Uri(
scheme: 'https',
host: 'binusianorg-my.sharepoint.com',
path:
'/personal/bill_elim_binus_ac_id/_layouts/15/guestaccess.aspx',
queryParameters: {
'share': 'EkEQg25whCZKtZOdahpRq5kBQybA6nFJ-an02U60GhuOdg',
'e': 'pW9qBv',
},
));
leading: GestureDetector(
key: const Key('notes_list_button'),
onTap: () async {
await selectNotesFromList(context);
},
child: const MouseRegion(
cursor: SystemMouseCursors.click,
child: Text('Notease - v0.3 | 16 Maret 2024'),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Icon(
Icons.folder_copy_outlined,
color: Colors.black,
),
),
),
),
backgroundColor: const Color.fromARGB(255, 227, 179, 235),
actions: [
// IconButton(
// icon: const Icon(
// Icons.share_rounded,
// color: Colors.black,
// ),
// onPressed: () {
// // Handle Share button
// },
// ),
IconButton(
icon: const Icon(Icons.folder_open),
onPressed: () async {
await selectNotesFromList(context);
key: const Key('save_note_button'),
icon: const Icon(Icons.save_rounded, color: Colors.black),
onPressed: () {
// Handle save button press
_addNote();
},
),
IconButton(
key: const Key('log_button'),
icon: Icon(_auth.currentUser == null ? Icons.login : Icons.logout),
onPressed: () async {
if (_auth.currentUser == null) {
Expand All @@ -87,6 +96,9 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
),
);
} else {
if (GoogleSignIn().currentUser != null) {
await GoogleSignIn().disconnect();
}
await _auth.signOut();
}
},
Expand All @@ -100,31 +112,124 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
),
),
],
title: GestureDetector(
onTap: () {
// Open the link when the title is clicked
launchUrl(Uri(
scheme: 'https',
host: 'binusianorg-my.sharepoint.com',
path:
'/personal/bill_elim_binus_ac_id/_layouts/15/guestaccess.aspx',
queryParameters: {
'share': 'EkEQg25whCZKtZOdahpRq5kBQybA6nFJ-an02U60GhuOdg',
'e': 'pW9qBv',
},
));
},
child: const MouseRegion(
cursor: SystemMouseCursors.click,
child: Text(
"Notease - v0.4.1 | 26 Maret 2024",
style: TextStyle(
color: Color.fromARGB(255, 30, 29, 29),
fontWeight: FontWeight.bold,
),
),
),
),
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
),
body: Column(
children: [
Expanded(
child: TextField(
controller: _noteController,
maxLines: null,
expands: true,
decoration: const InputDecoration(
hintText: 'Enter your note',
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25.0), // Menambahkan padding horizontal
child: TextField(
key: const Key('note_text_field'),
controller: _noteController,
maxLines: null,
expands: true,
textAlignVertical:
TextAlignVertical.top, // Mengatur teks ke atas
textAlign: TextAlign.start, // Mengatur teks ke kiri
decoration: const InputDecoration(
hintText: 'Enter your note',
contentPadding: EdgeInsets.symmetric(
vertical: 30.0), // Menambahkan padding vertikal
),
onSubmitted: (note) {
_addNote();
},
),
onSubmitted: (note) {
_addNote();
},
),
),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {
_addNote();
},
child: Icon(editingIndex == -1 ? Icons.add : Icons.save),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
// bottomNavigationBar: BottomAppBar(
// elevation: 0, // Menghapus efek bayangan
// shape: const CircularNotchedRectangle(),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// IconButton(
// icon: const Icon(Icons.highlight, size: 30, color: Colors.black),
// onPressed: () {
// // Handle highlight text button press
// },
// tooltip: "Highlight",
// ),
// IconButton(
// icon: const Icon(Icons.format_italic_rounded,
// size: 30, color: Colors.black),
// onPressed: () {
// // Handle highlight text button press
// },
// tooltip: "Highlight",
// ),
// IconButton(
// icon: const Icon(Icons.format_bold_rounded,
// size: 30, color: Colors.black),
// onPressed: () {
// // Handle highlight text button press
// },
// tooltip: "Highlight",
// ),
// IconButton(
// icon: const Icon(Icons.format_underline_rounded,
// size: 30, color: Colors.black),
// onPressed: () {
// // Handle highlight text button press
// },
// tooltip: "Highlight",
// ),
// IconButton(
// icon:
// const Icon(Icons.undo_rounded, size: 30, color: Colors.black),
// onPressed: () {
// // Handle undo button press
// },
// tooltip: "Undo",
// ),
// IconButton(
// icon:
// const Icon(Icons.redo_rounded, size: 30, color: Colors.black),
// onPressed: () {
// // Handle redo button press
// },
// tooltip: "Redo",
// ),
// IconButton(
// icon: const Icon(Icons.attach_file_rounded,
// size: 30, color: Colors.black),
// onPressed: () {
// // Handle add attachment button press
// },
// tooltip: "Attach-file",
// ),
// ],
// ),
// ),
);
}

Expand Down
Loading
Loading