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,
),),

View File

@ -4,9 +4,9 @@
class ConstValues{
static const server_uri = "http://container.intranet.sumasen.net:8100";
static const dev_server = "http://localhost:8100";
static const dev_ip_server = "http://192.168.8.100:8100";
static const dev_ip_server = "http://192.168.8.103:8100";
static String currentServer(){
return server_uri;
return dev_ip_server;
}
}

View File

@ -4,9 +4,11 @@ class StringValues extends Translations{
@override
Map<String, Map<String, String>> get keys => {
'en_US': {
'drawer_title':'Rogaining participants can view checkpoints by logging in',
'app_title': '- Rogaining -',
'address':'address',
'email':'Email',
'password':'Password',
'web':'Web',
'wikipedia':'Wikipedia',
'video':'video',
@ -16,18 +18,27 @@ class StringValues extends Translations{
'want_to_go': "Want to Go",
'schedule_point': "Schedule point",
'login': 'Login',
'logout':'Logout',
'sign_up':'Sign up',
'change_password': 'Change Password',
'profile': 'Profile',
'recommended_route': 'Recommended Route',
'point_rank': 'Point Rank',
'game_rank': 'Game Rank',
'my_route': 'My Route',
'visit_history': 'Visit History'
'visit_history': 'Visit History',
'rog_web': 'rog website',
'no_values': 'No Values',
'email_and_password_required': 'Email and password required',
'rogaining_user_need_tosign_up': "Rogaining participants do need to sign up.",
'add_location': 'Add Location'
},
'ja_JP': {
'drawer_title':'ロゲイニング参加者はログイン するとチェックポイントが参照 できます',
'app_title': '旅行工程表',
'address':'住所',
'email':'Eメール',
'email':'Eメール(ロゲではゼッケン番号)',
'password':'パスワード',
'web':'ウェブ',
'wikipedia':'ウィキペディア',
'video':'ビデオ',
@ -38,14 +49,21 @@ class StringValues extends Translations{
'like': 'お気に入り',
'checkin': 'チェックイン',
'schedule_point': '予定地点',
'login': 'ログインする',
'login': 'ログイン',
'logout':'ログアウト',
'sign_up': 'サインアップ',
'change_password': 'パスワード変更',
'profile': 'プロフィール',
'recommended_route': '推奨ルート',
'point_rank': '地点ランキング',
'game_rank': 'ゲームランキング',
'my_route': 'マイルート',
'visit_history': '訪問履歴'
'visit_history': '訪問履歴',
'rog_web': 'ロゲイニングウェブサイト',
'no_values': '値なし',
'email_and_password_required': 'メールとパスワードが必要です',
'rogaining_user_need_tosign_up': "ロゲイニング参加者はサインアップの必要はありません。",
'add_location': '目的地選択'
},
};
}