profile partly done. added scrolling on login and register page
This commit is contained in:
parent
3e0f7229c4
commit
b44d180284
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ActiveDebugProfile>https</ActiveDebugProfile>
|
||||
<ActiveDebugProfile>http</ActiveDebugProfile>
|
||||
<Controller_SelectedScaffolderID>ApiControllerWithContextScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
||||
<WebStackScaffolding_ControllerDialogWidth>650</WebStackScaffolding_ControllerDialogWidth>
|
||||
|
@ -29,9 +29,9 @@ namespace API.Application.Users.Commands
|
||||
{
|
||||
return new UnauthorizedObjectResult(new { message = "Invalid email or password." });
|
||||
}
|
||||
var token = GenerateJwtToken(user);
|
||||
var jwtToken = GenerateJwtToken(user);
|
||||
|
||||
return new OkObjectResult(token);
|
||||
return new OkObjectResult(new { token = jwtToken, id = user.Id});
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
using API.Persistence.Repositories;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages.Manage;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace API.Application.Users.Queries
|
||||
{
|
||||
@ -23,14 +24,8 @@ namespace API.Application.Users.Queries
|
||||
return new ConflictObjectResult(new { message = "No user on given Id" });
|
||||
}
|
||||
|
||||
UserDTO userDTO = new UserDTO
|
||||
{
|
||||
Id = user.Id,
|
||||
Email = user.Email,
|
||||
Username = user.Username
|
||||
};
|
||||
return new OkObjectResult(new { id = user.Id, email = user.Email, username = user.Username, createdAt = user.CreatedAt });
|
||||
|
||||
return userDTO;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ class _LoginPageState extends State<LoginPage> {
|
||||
return SideMenu(
|
||||
selectedIndex: 4,
|
||||
body: Scaffold(
|
||||
body: Center(
|
||||
body: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(minWidth: 100, maxWidth: 400),
|
||||
child: Column(children: [
|
||||
@ -86,6 +87,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
@ -37,17 +37,19 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SideMenu(
|
||||
selectedIndex: 3,
|
||||
body: Scaffold(
|
||||
body: Center(
|
||||
Widget build(BuildContext context) {
|
||||
return SideMenu(
|
||||
selectedIndex: 3,
|
||||
body: Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Center( // Added SingleChildScrollView here
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(minWidth: 100, maxWidth: 400),
|
||||
child: Column(children: [
|
||||
const Image(
|
||||
image: AssetImage('assets/logo.png'),
|
||||
height: 200,
|
||||
child: Column(
|
||||
children: [
|
||||
const Image(
|
||||
image: AssetImage('assets/logo.png'),
|
||||
height: 200,
|
||||
),
|
||||
Text(
|
||||
'SkanTravels',
|
||||
@ -56,43 +58,45 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
color: Color(0xFF1862E7),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
const Text('Username'),
|
||||
TextField(controller: usernameInput),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Email'),
|
||||
TextField(controller: emailInput),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Password'),
|
||||
TextField(
|
||||
controller: passwordInput,
|
||||
obscureText: true,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Confirm Password'),
|
||||
TextField(
|
||||
controller: confirmPasswordInput,
|
||||
obscureText: true,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
ElevatedButton(
|
||||
onPressed: _register, child: const Text('Register')),
|
||||
const SizedBox(height: 10),
|
||||
const Text('or'),
|
||||
TextButton(
|
||||
child: const Text('Login'),
|
||||
onPressed: () => Navigator.pushReplacementNamed(context, '/login')),
|
||||
]),
|
||||
const SizedBox(height: 40),
|
||||
const Text('Username'),
|
||||
TextField(controller: usernameInput),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Email'),
|
||||
TextField(controller: emailInput),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Password'),
|
||||
TextField(
|
||||
controller: passwordInput,
|
||||
obscureText: true,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const Text('Confirm Password'),
|
||||
TextField(
|
||||
controller: confirmPasswordInput,
|
||||
obscureText: true,
|
||||
enableSuggestions: false,
|
||||
autocorrect: false,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
ElevatedButton(
|
||||
onPressed: _register, child: const Text('Register')),
|
||||
const SizedBox(height: 10),
|
||||
const Text('or'),
|
||||
TextButton(
|
||||
child: const Text('Login'),
|
||||
onPressed: () => Navigator.pushReplacementNamed(context, '/login')),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
Loading…
Reference in New Issue
Block a user