upodate for login system and app name, icon

This commit is contained in:
Mohamed Nouffer
2022-09-14 19:51:50 +05:30
parent b5932f2578
commit e0c33435ef
105 changed files with 325 additions and 146 deletions

View File

@ -65,12 +65,12 @@ class _DestinationPageState extends State<DestinationPage> {
return false;
},
child: Scaffold(
drawer: const DrawerPage(),
drawer: DrawerPage(),
bottomNavigationBar: BottomAppBar(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),),
Expanded(child: Container(width: 0, height: 0,),),
const Expanded(child: Text('')),
Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){
indexController.switchPage(AppPages.INITIAL);

View File

@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
class DrawerPage extends StatelessWidget {
const DrawerPage({ Key? key }) : super(key: key);
DrawerPage({ Key? key }) : super(key: key);
final IndexController indexController = Get.find<IndexController>();
@override
Widget build(BuildContext context) {
@ -19,49 +21,86 @@ class DrawerPage extends StatelessWidget {
Container(
height: 100,
color: Colors.amber,
child: Obx(() =>
Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child:
indexController.currentUser.length == 0 ?
Flexible(child: Text("drawer_title".tr, style: TextStyle(color: Colors.black, fontSize: 20),))
:
Text(indexController.currentUser[0]['user']['email'], style: TextStyle(color: Colors.black, fontSize: 20),),
),
)
),
),
ListTile(
leading: const Icon(Icons.login),
title: Text("login".tr),
onTap: (){
Get.toNamed(AppPages.LANDING);
},
Obx(() =>
indexController.currentUser.length == 0 ?
ListTile(
leading: const Icon(Icons.login),
title: Text("login".tr),
onTap: (){
Get.toNamed(AppPages.LOGIN);
},
) :
ListTile(
leading: const Icon(Icons.login),
title: Text("logout".tr),
onTap: (){
indexController.currentUser.clear();
Get.toNamed(AppPages.TRAVEL);
},
)
),
indexController.currentUser.length > 0 ?
ListTile(
leading: const Icon(Icons.password),
title: Text("change_password".tr),
onTap: (){},
),
) :
Container(width: 0, height: 0,),
indexController.currentUser.length == 0 ?
ListTile(
leading: const Icon(Icons.person),
title: Text("profile".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.route),
title: Text("recommended_route".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.favorite_rounded),
title: Text("point_rank".tr),
onTap: (){},
),
title: Text("sign_up".tr),
onTap: (){
Get.toNamed(AppPages.REGISTER);
},
) :
Container(width: 0, height: 0,),
// ListTile(
// leading: const Icon(Icons.person),
// title: Text("profile".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.route),
// title: Text("recommended_route".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.favorite_rounded),
// title: Text("point_rank".tr),
// onTap: (){},
// ),
indexController.currentUser.length > 0 ?
ListTile(
leading: const Icon(Icons.featured_video),
title: Text("game_rank".tr),
title: Text("rog_web".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.router),
title: Text("my_route".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.history_sharp),
title: Text("visit_history".tr),
onTap: (){},
),
) :
Container(width: 0, height: 0,),
// ListTile(
// leading: const Icon(Icons.router),
// title: Text("my_route".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.history_sharp),
// title: Text("visit_history".tr),
// onTap: (){},
// ),
],
),
),

View File

@ -37,7 +37,7 @@ class IndexPage extends GetView<IndexController> {
},
),
//automaticallyImplyLeading: false,
title: Text("Add locations"),
title: Text("add_location".tr),
actions: [
InkWell(
onTap: (){
@ -61,7 +61,7 @@ class IndexPage extends GetView<IndexController> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),),
Expanded(child: Container(width: 0, height: 0,),),
const Expanded(child: Text('')),
Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){
indexController.switchPage(AppPages.TRAVEL);

View File

@ -28,25 +28,22 @@ class LoginPage extends StatelessWidget {
body:
indexController.currentUser.length == 0 ?
Container(
height: MediaQuery.of(context).size.height,
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
children: [
Column(
children: [
Text ("ログイン", style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
),),
SizedBox(height: 20,),
Text("お帰りなさい !資格情報を使用してログインします",style: TextStyle(
fontSize: 15,
color: Colors.grey[700],
),),
SizedBox(height: 30,)
Container(
height: MediaQuery.of(context).size.height/5,
decoration: BoxDecoration(
image:DecorationImage(image: AssetImage('assets/images/login_image.jpg'))
),
),
SizedBox(height: 5,),
],
),
Padding(
@ -55,8 +52,8 @@ class LoginPage extends StatelessWidget {
),
child: Column(
children: [
makeInput(label: "Eメール", controller: emailController),
makeInput(label: "パスワード", controller: passwordController, obsureText: true),
makeInput(label: "email".tr, controller: emailController),
makeInput(label: "password".tr, controller: passwordController, obsureText: true),
],
),
),
@ -86,14 +83,16 @@ class LoginPage extends StatelessWidget {
),
child: CircularProgressIndicator(),
) :
MaterialButton(
Column(
children: [
MaterialButton(
minWidth: double.infinity,
height:60,
onPressed: (){
if(emailController.text.isEmpty || passwordController.text.isEmpty){
Get.snackbar(
"No values",
"Email and password required",
"no_values".tr,
"email_and_password_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
@ -113,7 +112,25 @@ class LoginPage extends StatelessWidget {
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
)
),
SizedBox(height: 10.0,),
MaterialButton(
minWidth: double.infinity,
height:60,
onPressed: (){
Get.toNamed(AppPages.REGISTER);
},
color: Colors.redAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("sign_up".tr,style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
)
],
)
),
),
)
@ -123,18 +140,12 @@ class LoginPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: Text("アカウントをお持ちではありませんか?", style: TextStyle(
overflow: TextOverflow.ellipsis,
),),
),
TextButton(
onPressed: (){
Get.toNamed(AppPages.REGISTER);
},
child: Text("サインアップ",style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18
),),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("rogaining_user_need_tosign_up".tr, style: TextStyle(
overflow: TextOverflow.ellipsis,
),),
),
),
],
)

View File

@ -94,8 +94,8 @@ class RegisterPage extends StatelessWidget {
}
if(emailController.text.isEmpty || passwordController.text.isEmpty){
Get.snackbar(
"No values",
"Email and password required",
"no_values".tr,
"email_and_password_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
@ -111,7 +111,7 @@ class RegisterPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("サインアップ",style: TextStyle(
child: Text("sign_up".tr,style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,
),),