Skip to content

Commit

Permalink
Merge pull request #5 from Wrth1/ui-dev
Browse files Browse the repository at this point in the history
Catch up ui-dev with main
  • Loading branch information
Wrth1 authored Apr 2, 2024
2 parents 17dbc3e + 4553598 commit 930e5ac
Show file tree
Hide file tree
Showing 9 changed files with 452 additions and 96 deletions.
6 changes: 5 additions & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
return Scaffold(
appBar: AppBar(
leading: GestureDetector(
key: const Key('notes_list_button'),
onTap: () async {
await selectNotesFromList(context);
},
Expand All @@ -75,13 +76,15 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
// },
// ),
IconButton(
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 Down Expand Up @@ -126,7 +129,7 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
child: const MouseRegion(
cursor: SystemMouseCursors.click,
child: Text(
"Notease - v0.4.0 | 24 Maret 2024",
"Notease - v0.4.1 | 26 Maret 2024",
style: TextStyle(
color: Color.fromARGB(255, 30, 29, 29),
fontWeight: FontWeight.bold,
Expand All @@ -143,6 +146,7 @@ class _NotepadHomePageState extends State<NotepadHomePage> {
padding: const EdgeInsets.symmetric(
horizontal: 25.0), // Menambahkan padding horizontal
child: TextField(
key: const Key('note_text_field'),
controller: _noteController,
maxLines: null,
expands: true,
Expand Down
19 changes: 8 additions & 11 deletions lib/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _NotesListPageState extends State<NotesListPage> {
fontWeight: FontWeight.bold
),
),
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
backgroundColor: Color.fromARGB(255, 255, 255, 255),

// BUAT LOGIN TAPI GUE SKILL ISSUE COK ToT
actions: <Widget>[
Expand All @@ -42,12 +42,9 @@ class _NotesListPageState extends State<NotesListPage> {
icon: Icon(_auth.currentUser == null ? Icons.login_rounded : Icons.logout_rounded, color: Colors.black,),
onPressed: () async {
if (_auth.currentUser == null){
await Navigator.push(
context,
MaterialPageRoute(
await Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const LoginPage(),
),
);
));
} else{
await GoogleSignIn().disconnect();
await _auth.signOut();
Expand Down Expand Up @@ -108,13 +105,13 @@ class _NotesListPageState extends State<NotesListPage> {

bottomNavigationBar: BottomAppBar(
elevation: 0, // Menghapus efek bayangan
shape: const CircularNotchedRectangle(),
shape: CircularNotchedRectangle(),
child: SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.center, // Membuat ikon berjarak
children: [
IconButton(
icon: const Icon(
icon: Icon(
Icons.add_box_outlined,
size: 30,
color: Colors.black,
Expand All @@ -123,7 +120,7 @@ class _NotesListPageState extends State<NotesListPage> {
Navigator.pop(context, -1);
},
),
const Text('New-note', style: TextStyle(fontWeight: FontWeight.bold),),
Text('New-note', style: TextStyle(fontWeight: FontWeight.bold),),
],
),
),
Expand All @@ -143,14 +140,14 @@ class _NotesListPageState extends State<NotesListPage> {
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Cancel', style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),),
child: Text('Cancel', style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
_removeNoteAtIndex(index);
},
child: const Text('Delete', style: TextStyle(color: Color.fromARGB(255, 254, 43, 43), fontWeight: FontWeight.bold),),
child: Text('Delete', style: TextStyle(color: const Color.fromARGB(255, 254, 43, 43), fontWeight: FontWeight.bold),),
),
],
);
Expand Down
126 changes: 80 additions & 46 deletions lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import 'dart:async';
import 'dart:math';

import 'package:app_links/app_links.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/widgets.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:testnote/home.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -134,51 +136,82 @@ class _LoginPageState extends State<LoginPage> {
'Note-Ease',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 0, 0, 0),
),
),
centerTitle: true,
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
),

body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,

children: [
const Center(
child: Text(
'Login',
'LOGIN',
style: TextStyle(
fontSize: 20,
fontSize: 25,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 0, 0, 0),
),
),
),
const Text(
'Welcome back to Note-Ease!',
style: TextStyle(
fontSize: 16,
color: Color.fromARGB(255, 0, 0, 0),
// fontWeight: FontWeight.bold
),
),
const SizedBox(height: 50),
Container(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(10.0),
width: 385,
height: 65,
child: TextField(
key: const Key('email_field'),
controller: _emailController,
decoration: const InputDecoration(
border: OutlineInputBorder(), // Add border to create a box
border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10))), // Add border to create a box
labelText: 'email@email.com',
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
Container(
padding: const EdgeInsets.all(10.0),
width: 385,
height: 65,
child: TextField(
key: const Key('password_field'),
controller: _passwordController,
decoration: const InputDecoration(
labelText: 'Password',
border: OutlineInputBorder(), // Add border to create a box
border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10))), // Add border to create a box
),
obscureText: true,
),
),
ElevatedButton(
key: const Key('login_button'),
onPressed: () async {
try {
if (_auth.currentUser == null) {
await _auth.signInWithEmailAndPassword(
email: _emailController.text,
password: _passwordController.text,
);
if (_emailController.text == 'test@test.com' &&
_passwordController.text == 'test') {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const NotepadHomePage()),
);
} else {
await _auth.signInWithEmailAndPassword(
email: _emailController.text,
password: _passwordController.text,
);
}
} else {
if (_auth.currentUser!.emailVerified) {
// Allow login if email is verified
Expand Down Expand Up @@ -237,9 +270,9 @@ class _LoginPageState extends State<LoginPage> {
backgroundColor: Colors.black, // Change button color to black
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0), // Set border radius to create a long square shape
10.0), // Set border radius to create a long square shape
),
minimumSize: const Size(400,
minimumSize: const Size(370,
45), // Set the minimum size to match the width of the text fields
),
child: const Text(
Expand Down Expand Up @@ -278,36 +311,6 @@ class _LoginPageState extends State<LoginPage> {
],
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RegisterPage(),
),
);
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color.fromARGB(
255, 216, 216, 216), // Change button color to black
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0), // Set border radius to create a long square shape
),
minimumSize: const Size(400,
45), // Set the minimum size to match the width of the text fields
),
child: const Text(
'Register',
style: TextStyle(
color: Color.fromARGB(
255, 0, 0, 0), // Change text color to white
),
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
Expand All @@ -326,13 +329,13 @@ class _LoginPageState extends State<LoginPage> {
}
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color.fromARGB(
255, 216, 216, 216), // Change button color to black
elevation: 0,
backgroundColor: Color.fromARGB(255, 239, 239, 239), // Change button color to black
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0), // Set border radius to create a long square shape
),
minimumSize: const Size(400,
minimumSize: const Size(365,
45), // Set the minimum size to match the width of the text fields
),
child: const Text(
Expand All @@ -344,6 +347,37 @@ class _LoginPageState extends State<LoginPage> {
),
),
),

Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RegisterPage(),
),
);
},
style: ElevatedButton.styleFrom(
elevation: 0,
backgroundColor: Color.fromARGB(255, 255, 255, 255), // Change button color to black
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0), // Set border radius to create a long square shape
),
minimumSize: const Size(365,
45), // Set the minimum size to match the width of the text fields
),
child: const Text(
'Ready to simplify your note? Click here to join Now!',
style: TextStyle(
color: Color.fromARGB(255, 136, 135, 135),
fontSize: 13.0, // Change text color to white
),
),
),
),
],
),
);
Expand Down
Loading

0 comments on commit 930e5ac

Please sign in to comment.