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

Home Page #12

Merged
merged 3 commits into from
Jul 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 49 additions & 0 deletions viteed_app/lib/information.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
List trending = [
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
{
"imagePath": "",
"title": "",
},
];

List topics = [
{"name": "Trending"},
{"name": "Recommendation"},
{"name": "Flutter"},
{"name": "Figma"},
{"name": "Literature"},
{"name": "Chemistry"},
{"name": "Education"},
{"name": "Science"},
];
3 changes: 3 additions & 0 deletions viteed_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:viteed_app/constants/color.dart';
import 'package:viteed_app/screens/home.dart';
import 'package:viteed_app/screens/login.dart';
import 'package:viteed_app/screens/signup.dart';
import 'package:viteed_app/screens/forgotpassword.dart';

void main() {
runApp(
Expand Down Expand Up @@ -33,7 +34,9 @@ class MyApp extends StatelessWidget {
'/': (context) => const Login(),
'/login': (context) => const Login(),
'/home': (context) => const Home(),
'/forgotPassword': (context) => const forgotPassword(),
'/signUp': (context) => const SignUp()

},
debugShowCheckedModeBanner: false,
);
Expand Down
161 changes: 161 additions & 0 deletions viteed_app/lib/screens/forgotpassword.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import 'package:flutter/material.dart';
import 'package:viteed_app/screens/passwordReset.dart';

class forgotPassword extends StatelessWidget {
final TextEditingController _emailTextController = TextEditingController();
final TextEditingController _passwordTextController = TextEditingController();
final _formKey = GlobalKey<FormState>();

forgotPassword({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Color.fromARGB(255, 255, 255, 255),
Color.fromARGB(1, 162, 156, 244),
],
),
),
),
Scaffold(
backgroundColor: Colors.transparent,
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(0.8),
child: Center(
child: Form(
key: _formKey,
child: Column(
children: [
const SizedBox(height: 50),
const Padding(
padding: EdgeInsets.all(8.0),
child: Image(
image: AssetImage("images/ViteEDLogo.png"),
width: 400,
height: 250,
),
),
const Text(
"Forgot Password \n",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
width: 350.0,
height: 60.0,
child: TextFormField(
controller: _emailTextController,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.white, width: 2.0),
borderRadius:
BorderRadius.circular(20.0)),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
),
fillColor: Colors.white.withOpacity(0.8),
filled: true,
labelText: 'Email',
labelStyle: const TextStyle(
color: Colors.black,
),
hintText: "abc@xyz.com"),
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
width: 350.0,
height: 60.0,
child: TextFormField(
controller: _passwordTextController,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.white, width: 2.0),
borderRadius:
BorderRadius.circular(20.0)),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
),
fillColor: Colors.white.withOpacity(0.8),
filled: true,
labelText: 'OTP',
labelStyle: const TextStyle(
color: Colors.black,
),
hintText: "856904"),
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: SizedBox(
width: 300.0,
height: 50.0,
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: ((context) =>
passwordReset())));
},
style: ButtonStyle(
foregroundColor:
MaterialStateProperty.all<Color>(
Colors.white),
backgroundColor:
MaterialStateProperty.all<Color>(
const Color.fromRGBO(162, 156, 244, 1)),
shape: MaterialStateProperty.all<
RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: const BorderSide(
color: Color.fromARGB(1, 162, 156, 244),
),
),
),
),
child: const Text(
"Set Password",
style: TextStyle(fontSize: 22),
),
),
),
),
TextButton(
onPressed: () {
Navigator.pushNamed(context, '/login');
},
child: const Text(
"Already have an account? Login",
style: TextStyle(
fontSize: 15,
color: Color.fromARGB(255, 87, 87, 87)),
)),
],
),
),
),
),
),
),
],
),
);
}
}
5 changes: 5 additions & 0 deletions viteed_app/lib/screens/home.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:viteed_app/information.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:viteed_app/auth/authenticaton.dart';
import '../providers/provider.dart';


class Home extends ConsumerWidget {
const Home({Key? key}) : super(key: key);

@override

Widget build(BuildContext context, WidgetRef ref) {
final session = ref.watch(sessionProvider);
return Scaffold(
Expand Down Expand Up @@ -51,5 +55,6 @@ class Home extends ConsumerWidget {
child: const Icon(Icons.exit_to_app),
),
);

}
}
12 changes: 11 additions & 1 deletion viteed_app/lib/screens/login.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import 'package:flutter/material.dart';
import 'package:viteed_app/screens/forgotpassword.dart';
import 'package:viteed_app/screens/home.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:viteed_app/auth/authenticaton.dart';
import '../constants/validators.dart';


class Login extends StatefulWidget {
const Login({Key? key}) : super(key: key);

Expand Down Expand Up @@ -150,6 +153,7 @@ class _LoginState extends State<Login> {
child: SizedBox(
width: 300.0,
height: 50.0,

child: Consumer(
builder: (context, ref, child) => ElevatedButton(
onPressed: () {
Expand All @@ -171,6 +175,7 @@ class _LoginState extends State<Login> {
side: const BorderSide(
color: Color.fromARGB(1, 162, 156, 244),
),

),
),
),
Expand All @@ -183,7 +188,12 @@ class _LoginState extends State<Login> {
),
),
TextButton(
onPressed: () {},
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => forgotPassword()));
},
child: const Text(
"Forgot Password?",
style: TextStyle(
Expand Down