Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
feelver
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2F-ART
feelver
Commits
13c213f6
Commit
13c213f6
authored
Jul 17, 2020
by
Mobile : Jetrin Phuekkaew (N'new)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update save and get token.
parent
4f2a7a1b
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
241 additions
and
5 deletions
+241
-5
ios/Flutter/Debug.xcconfig
+1
-0
ios/Flutter/Release.xcconfig
+1
-0
ios/Podfile
+90
-0
lib/main.dart
+3
-2
lib/ui/home/home.dart
+16
-0
lib/ui/login/login_presenter.dart
+8
-3
lib/util/Accout_util.dart
+24
-0
pubspec.lock
+97
-0
pubspec.yaml
+1
-0
No files found.
ios/Flutter/Debug.xcconfig
View file @
13c213f6
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
ios/Flutter/Release.xcconfig
View file @
13c213f6
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
ios/Podfile
0 → 100644
View file @
13c213f6
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
project
'Runner'
,
{
'Debug'
=>
:debug
,
'Profile'
=>
:release
,
'Release'
=>
:release
,
}
def
parse_KV_file
(
file
,
separator
=
'='
)
file_abs_path
=
File
.
expand_path
(
file
)
if
!
File
.
exists?
file_abs_path
return
[];
end
generated_key_values
=
{}
skip_line_start_symbols
=
[
"#"
,
"/"
]
File
.
foreach
(
file_abs_path
)
do
|
line
|
next
if
skip_line_start_symbols
.
any?
{
|
symbol
|
line
=~
/^\s*
#{
symbol
}
/
}
plugin
=
line
.
split
(
pattern
=
separator
)
if
plugin
.
length
==
2
podname
=
plugin
[
0
].
strip
()
path
=
plugin
[
1
].
strip
()
podpath
=
File
.
expand_path
(
"
#{
path
}
"
,
file_abs_path
)
generated_key_values
[
podname
]
=
podpath
else
puts
"Invalid plugin specification:
#{
line
}
"
end
end
generated_key_values
end
target
'Runner'
do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir
=
File
.
join
(
__dir__
,
'Flutter'
)
copied_framework_path
=
File
.
join
(
copied_flutter_dir
,
'Flutter.framework'
)
copied_podspec_path
=
File
.
join
(
copied_flutter_dir
,
'Flutter.podspec'
)
unless
File
.
exist?
(
copied_framework_path
)
&&
File
.
exist?
(
copied_podspec_path
)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path
=
File
.
join
(
copied_flutter_dir
,
'Generated.xcconfig'
)
unless
File
.
exist?
(
generated_xcode_build_settings_path
)
raise
"Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings
=
parse_KV_file
(
generated_xcode_build_settings_path
)
cached_framework_dir
=
generated_xcode_build_settings
[
'FLUTTER_FRAMEWORK_DIR'
];
unless
File
.
exist?
(
copied_framework_path
)
FileUtils
.
cp_r
(
File
.
join
(
cached_framework_dir
,
'Flutter.framework'
),
copied_flutter_dir
)
end
unless
File
.
exist?
(
copied_podspec_path
)
FileUtils
.
cp
(
File
.
join
(
cached_framework_dir
,
'Flutter.podspec'
),
copied_flutter_dir
)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod
'Flutter'
,
:path
=>
'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system
(
'rm -rf .symlinks'
)
system
(
'mkdir -p .symlinks/plugins'
)
plugin_pods
=
parse_KV_file
(
'../.flutter-plugins'
)
plugin_pods
.
each
do
|
name
,
path
|
symlink
=
File
.
join
(
'.symlinks'
,
'plugins'
,
name
)
File
.
symlink
(
path
,
symlink
)
pod
name
,
:path
=>
File
.
join
(
symlink
,
'ios'
)
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install!
'cocoapods'
,
:disable_input_output_paths
=>
true
post_install
do
|
installer
|
installer
.
pods_project
.
targets
.
each
do
|
target
|
target
.
build_configurations
.
each
do
|
config
|
config
.
build_settings
[
'ENABLE_BITCODE'
]
=
'NO'
end
end
end
lib/main.dart
View file @
13c213f6
...
...
@@ -2,6 +2,7 @@
import
'package:feelverapp/ui/login/login.dart'
;
import
'package:feelverapp/ui/shop/shop_main.dart'
;
import
'package:feelverapp/ui/splashscreen/splash_screen_page.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -17,8 +18,8 @@ class MyApp extends StatelessWidget {
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
),
home:
MainShop
(),
//
home: SplashScreenPage(),
//
home: MainShop(),
home:
SplashScreenPage
(),
);
}
}
lib/ui/home/home.dart
View file @
13c213f6
...
...
@@ -3,6 +3,7 @@ import 'package:feelverapp/ui/menu/menu.dart';
import
'package:feelverapp/ui/nearme/near_me_list.dart'
;
import
'package:feelverapp/ui/reserve/reserve_list.dart'
;
import
'package:feelverapp/ui/shop/shop_list.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -12,8 +13,23 @@ class HomePage extends StatefulWidget {
_HomePageState
createState
()
=>
_HomePageState
();
}
class
_HomePageState
extends
State
<
HomePage
>
{
@override
void
initState
()
{
}
@override
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
...
...
lib/ui/login/login_presenter.dart
View file @
13c213f6
...
...
@@ -10,6 +10,7 @@ import 'package:feelverapp/service/api.dart';
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/login/login.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
...
...
@@ -84,7 +85,7 @@ else {
_api
=
Api
<
LoginModel
>();
var
res
=
await
_api
.
login
({
"access_type"
:
"
portal
"
,
"access_type"
:
"
mobile
"
,
"access_status"
:
"customer"
,
"email"
:
emailCtrl
.
text
,
'password'
:
passCtrl
.
text
...
...
@@ -93,6 +94,7 @@ else {
if
(
res
.
fail
==
null
)
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
...
...
@@ -114,9 +116,12 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Home
)
]).
show
();
LoginModel
model
=
res
.
success
;
await
AccountUtil
.
saveToken
(
model
.
token
);
print
(
await
AccountUtil
.
getToken
());
// print(AccountUtil.getToken().toString());
// print("Username ="+"${model.user}");
print
(
"Token ="
+
"
${model.token}
"
);
}
else
{
Alert
(
style:
AlertStyle
(
...
...
@@ -166,7 +171,7 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Home
_api
=
Api
<
LoginModel
>();
var
res
=
await
_api
.
login
({
"access_type"
:
"
portal
"
,
"access_type"
:
"
mobile
"
,
"access_status"
:
"customer"
,
"email"
:
phonenumberCtrl
.
text
,
'password'
:
passCtrl
.
text
...
...
lib/util/Accout_util.dart
0 → 100644
View file @
13c213f6
import
'package:shared_preferences/shared_preferences.dart'
;
class
AccountUtil
{
static
saveToken
(
String
token
)
async
{
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
pref
.
setString
(
'Token'
,
token
);
}
static
Future
<
String
>
getToken
()
async
{
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
String
token
=
pref
.
getString
(
'Token'
);
return
token
;
}
static
signOut
()
async
{
SharedPreferences
pref
=
await
SharedPreferences
.
getInstance
();
pref
.
remove
(
'Token'
);
}
}
\ No newline at end of file
pubspec.lock
View file @
13c213f6
...
...
@@ -64,6 +64,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
flutter:
dependency: "direct main"
description: flutter
...
...
@@ -81,6 +88,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: "direct main"
description:
...
...
@@ -102,6 +114,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
json_annotation:
dependency: "direct main"
description:
...
...
@@ -130,6 +149,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pedantic:
dependency: transitive
description:
...
...
@@ -144,6 +177,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
quiver:
dependency: transitive
description:
...
...
@@ -158,6 +212,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.8"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+1"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+10"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+7"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -219,6 +308,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
xml:
dependency: transitive
description:
...
...
@@ -228,3 +324,4 @@ packages:
version: "3.5.0"
sdks:
dart: ">=2.6.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
pubspec.yaml
View file @
13c213f6
...
...
@@ -27,6 +27,7 @@ dependencies:
http
:
^0.12.0+4
json_annotation
:
^3.0.1
rflutter_alert
:
^1.0.3
shared_preferences
:
^0.5.6+1
dev_dependencies
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment