Skip to content

Commit

Permalink
Merge pull request #26 from p-society/dev/app
Browse files Browse the repository at this point in the history
created login page for player
  • Loading branch information
zakhaev26 authored Jan 15, 2024
2 parents 6b12b68 + 9824f2e commit df9b0d0
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 55 deletions.
87 changes: 49 additions & 38 deletions apps/admin/lib/login.dart → apps/admin/lib/login_admin.dart
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
import 'package:admin/textfield_login.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

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

// void _onButtonPressed() {
// // Add your button press logic here
// print('TextButton pressed');
// }
class LoginPageAdmin extends StatelessWidget {
const LoginPageAdmin({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Expanded(
child: Container(
//width: double.infinity,
// width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height,
// height: double.infinity,
color: const Color.fromRGBO(20, 22, 42, 1),
decoration: const BoxDecoration(
gradient: LinearGradient(
//aplying gradient
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF111114),
Color(0xFF161A3A),
Color(0xFF171D45),
],
),
),
height: double.infinity,
child: Padding(
padding: const EdgeInsets.fromLTRB(40.0, 0, 40, 57.0),
padding: const EdgeInsets.fromLTRB(40.0, 0, 40, 0.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -61,14 +67,19 @@ class LoginPage extends StatelessWidget {
),
const SizedBox(height: 20),
const TextfieldLogin(
aboveText: 'Name', hintText: 'Enter your Name'),
aboveText: 'Name',
hintText: 'Enter your Name'), //TextField for name
const TextfieldLogin(
aboveText: 'E-mail', hintText: 'Enter your E-mail'),
aboveText: 'E-mail',
hintText: 'Enter your E-mail'), //TextField for email
const TextfieldLogin(
aboveText: 'Phone Number',
hintText: 'Enter your phone number'),
hintText:
'Enter your phone number'), //TextField for phone number
const TextfieldLogin(
aboveText: 'Password', hintText: 'Enter your password'),
aboveText: 'Password',
hintText:
'Enter your password'), //TextField for password
const SizedBox(
height: 20,
),
Expand All @@ -94,22 +105,26 @@ class LoginPage extends StatelessWidget {
const SizedBox(
height: 15,
),
const Center(
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: 'Already have an account? ',
style: TextStyle(
color: Colors.white,
fontSize: 15,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w500,
height: 0,
),
Center(
child: Row(
children: [
const Text(
'Already have an account? ',
style: TextStyle(
color: Colors.white,
fontSize: 15,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w500,
height: 0,
),
TextSpan(
text: 'Sign Up',
),
GestureDetector(
//making signup text clickable
onTap: () {
print('signup clicked');
},
child: const Text(
'Sign Up',
style: TextStyle(
color: Color(0xFFC01A60),
fontSize: 15,
Expand All @@ -118,14 +133,10 @@ class LoginPage extends StatelessWidget {
height: 0,
),
),
],
),
textAlign: TextAlign.center,
)
],
),
),
// const SizedBox(
// height: 56,
// )
],
),
),
Expand Down
141 changes: 141 additions & 0 deletions apps/admin/lib/login_player.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import 'package:admin/textfield_login.dart';
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
//aplying gradient
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF111114),
Color(0xFF161A3A),
Color(0xFF171D45),
],
),
),
height: double.infinity,
child: Padding(
padding: const EdgeInsets.fromLTRB(40.0, 0, 40, 0.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 70,
),
const Text(
'Create your Account',
style: TextStyle(
color: Color(0xFFE0DADD),
fontSize: 28,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w800,
height: 0,
),
),
const Text(
'Fill in the details to create your account',
style: TextStyle(
color: Color(0xFFBAAFBB),
fontSize: 16,
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
height: 0,
),
),
const SizedBox(
height: 18,
),
const Padding(
padding: EdgeInsets.fromLTRB(50, 8, 50, 8),
child: Image(
image: AssetImage(
'assets/images/sports_illustration_gCSB.png')), //sports image
),
const SizedBox(height: 20),
const TextfieldLogin(
aboveText: 'E-mail',
hintText: 'Enter your E-mail'), //TextField for email
const TextfieldLogin(
aboveText: 'Password',
hintText:
'Enter your password'), //TextField for password
const SizedBox(
height: 20,
),
SizedBox(
width: 320,
child: TextButton(
//Register button
onPressed: () {
// _onButtonPressed();
print('Register button clicked');
},
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10.0), // Adjust the radius as needed
),
backgroundColor:
const Color.fromRGBO(225, 25, 109, 1)),
child: const Text(
'Register',
style: TextStyle(color: Colors.white),
),
),
),
const SizedBox(
height: 20,
),
Center(
child: Row(
children: [
const Text(
'Already have an account? ',
style: TextStyle(
color: Colors.white,
fontSize: 15,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w500,
height: 0,
),
),
GestureDetector(
//making signup text clickabe
onTap: () {
print('signup clicked');
},
child: const Text(
'Sign Up',
style: TextStyle(
color: Color(0xFFC01A60),
fontSize: 15,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w500,
height: 0,
),
),
)
],
),
),
],
),
),
),
),
),
),
);
}
}
20 changes: 3 additions & 17 deletions apps/admin/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:admin/login.dart';
import 'package:admin/login_admin.dart';
import 'package:admin/login_player.dart';
import 'package:flutter/material.dart';

void main() {
Expand All @@ -14,25 +15,10 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// TRY THIS: Try running your application with "flutter run". You'll see
// the application has a purple toolbar. Then, without quitting the app,
// try changing the seedColor in the colorScheme below to Colors.green
// and then invoke "hot reload" (save your changes or press the "hot
// reload" button in a Flutter-supported IDE, or press "r" if you used
// the command line to start the app).
//
// Notice that the counter didn't reset back to zero; the application
// state is not lost during the reload. To reset the state, use hot
// restart instead.
//
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const LoginPage(),
home: const LoginPagePlayer(),
);
}
}

0 comments on commit df9b0d0

Please sign in to comment.