reason

add app login auth

......@@ -4,7 +4,7 @@ PODS:
- AMapFoundation (1.6.9)
- AMapLocation (2.8.0):
- AMapFoundation (~> 1.6.9)
- AMapSearch (8.1.0):
- AMapSearch (9.2.0):
- AMapFoundation (~> 1.6.9)
- BIJKPlayer (0.7.16)
- camera (0.0.1):
......@@ -22,21 +22,21 @@ PODS:
- Flutter
- flutter_native_splash (0.0.1):
- Flutter
- flutter_sound (9.1.9):
- flutter_sound (9.2.1):
- Flutter
- flutter_sound_core (= 9.1.9)
- flutter_sound_core (9.1.9)
- flutter_sound_core (= 9.2.1)
- flutter_sound_core (9.2.1)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- image_picker (0.0.1):
- image_picker_ios (0.0.1):
- Flutter
- integration_test (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- path_provider_ios (0.0.1):
- Flutter
- permission_handler_apple (9.0.2):
- permission_handler_apple (9.0.4):
- Flutter
- qr_code_scanner (0.2.0):
- Flutter
......@@ -45,6 +45,8 @@ PODS:
- Flutter
- shared_preferences_ios (0.0.1):
- Flutter
- sign_in_with_apple (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
......@@ -65,13 +67,14 @@ DEPENDENCIES:
- flutter_2d_amap (from `.symlinks/plugins/flutter_2d_amap/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- quick_actions_ios (from `.symlinks/plugins/quick_actions_ios/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`)
......@@ -104,8 +107,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_sound:
:path: ".symlinks/plugins/flutter_sound/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
path_provider_ios:
......@@ -118,6 +121,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/quick_actions_ios/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
......@@ -133,7 +138,7 @@ SPEC CHECKSUMS:
AMap2DMap: cac76bc057de18a1641f34df6b50bf5bc6b23571
AMapFoundation: 8d8ecbb0b2e9ce5487995360d26c885d94642bfd
AMapLocation: 5ef44a1117be7dc541cb7a7d43d03c5ee91e4387
AMapSearch: 5c1cc07429f04b9cc76438fcb2411c66fdbbb178
AMapSearch: b461cdf25b39cdca8957017de2f376cd1ac5da85
BIJKPlayer: 4c5d66e5cb99ae5bade6f22a4fcc031722a81c64
camera: 9993f92f2c793e87b65e35f3a23c70582afb05b1
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
......@@ -141,22 +146,23 @@ SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_2d_amap: f8ad6a1b4cf35cf9fb051a20e869e0ab1de1d250
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_sound: 6881de605c6302cfffd8fc531f37dce0d3eab238
flutter_sound_core: 34596cd952a1a6056c52fb07d2102487d2723d51
flutter_sound: 5cb54023913813abe658f7a0dcdf3740a1c0bf16
flutter_sound_core: 76ef721d6f263ebfe9ab19798d864d999c5b8942
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_picker: 541dcbb3b9cf32d87eacbd957845d8651d6c62c3
image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler_apple: d21b38e1a4b2e041c63af9568f9165e114e507a6
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
quick_actions_ios: 622e9076602c57f1f937f1c13e5c59c3379347e9
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
vibration: 1ec279c4a1a7a646627b54039d812334b3f1114a
video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff
webview_flutter_wkwebview: 005fbd90c888a42c5690919a1527ecc6649e1162
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f
PODFILE CHECKSUM: 3ed452d0a19c518c00c368fa2b2bb74430f6d271
......
......@@ -376,6 +376,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = FLS6Y2LS7Z;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -504,6 +505,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = FLS6Y2LS7Z;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -527,6 +529,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = FLS6Y2LS7Z;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
......
......@@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:yiyan.pub</string>
......
......@@ -18,8 +18,6 @@ class AccountViewProvider with ChangeNotifier {
Future<void> fetchAccountData(String value) async {
_apiResponse = ApiResponse.loading('Fetching artist data');
// TODO 不知道为啥会提前触发,先注释掉吧
DioUtils.instance.asyncRequestNetwork<UserEntity>(
Method.get,
HttpApi.user,
......
import 'dart:io';
import 'package:Parlando/login/models/auth_entity.dart';
import 'package:Parlando/net/dio_utils.dart';
import 'package:Parlando/net/http_api.dart';
......@@ -20,6 +22,7 @@ import 'package:Parlando/widgets/my_app_bar.dart';
import 'package:Parlando/widgets/my_button.dart';
import 'package:Parlando/widgets/my_scroll_view.dart';
import 'package:getwidget/getwidget.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
import '../login_router.dart';
......@@ -74,27 +77,27 @@ class _LoginPageState extends State<LoginPage>
"其他错误"
];
Future.delayed(
Duration.zero,
() {
NavigatorUtils.pushPageByFade(
context: context,
//目标页面
targetPage: PermissionRequestWidget(
//所需要申请的权限
permission: Permission.camera,
//显示关闭应用按钮
isCloseApp: true,
//提示文案
permissionList: _list,
),
//权限申请结果
dismissCallBack: (value) {
showPrivacyPage();
},
);
},
);
// Future.delayed(
// Duration.zero,
// () {
// NavigatorUtils.pushPageByFade(
// context: context,
// //目标页面
// targetPage: PermissionRequestWidget(
// //所需要申请的权限
// permission: Permission.camera,
// //显示关闭应用按钮
// isCloseApp: true,
// //提示文案
// permissionList: _list,
// ),
// //权限申请结果
// dismissCallBack: (value) {
// showPrivacyPage();
// },
// );
// },
// );
}
void showPrivacyPage() async {
......@@ -193,100 +196,120 @@ class _LoginPageState extends State<LoginPage>
);
}
List<Widget> get _buildBody => <Widget>[
Text(
ParlandoLocalizations.of(context).passwordLogin,
style: TextStyles.textBold26,
),
Gaps.vGap16,
MyTextField(
key: const Key('email'),
List<Widget> get _buildBody =>
<Widget>[
Text(
ParlandoLocalizations.of(context).passwordLogin,
style: TextStyles.textBold26,
),
Gaps.vGap16,
MyTextField(
key: const Key('email'),
focusNode: _nodeText1,
controller: _nameController,
maxLength: 100,
keyboardType: TextInputType.emailAddress,
hintText: ParlandoLocalizations.of(context).inputEmailHint,
),
Gaps.vGap8,
MyTextField(
key: const Key('password'),
keyName: 'password',
focusNode: _nodeText2,
isInputPwd: true,
controller: _passwordController,
keyboardType: TextInputType.visiblePassword,
hintText: ParlandoLocalizations.of(context).inputPasswordHint,
),
Gaps.vGap24,
Text.rich(
TextSpan(
text: '登录即代表同意并阅读',
style: const TextStyle(fontSize: 12, color: Color(0xFF999999)),
children: [
TextSpan(
text: '《用户协议》',
style: TextStyle(color: Theme.of(context).primaryColor),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return const WebViewPage(
title: '《用户协议》',
url: Constant.protocolUrl,
);
}));
},
),
const TextSpan(text: ' & '),
TextSpan(
text: '《隐私政策》',
style: TextStyle(color: Theme.of(context).primaryColor),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
Gaps.vGap8,
MyTextField(
key: const Key('password'),
keyName: 'password',
focusNode: _nodeText2,
isInputPwd: true,
controller: _passwordController,
keyboardType: TextInputType.visiblePassword,
hintText: ParlandoLocalizations.of(context).inputPasswordHint,
),
Gaps.vGap24,
Text.rich(
TextSpan(
text: '登录即代表同意并阅读',
style: const TextStyle(fontSize: 12, color: Color(0xFF999999)),
children: [
TextSpan(
text: '《用户协议》',
style: TextStyle(color: Theme.of(context).primaryColor),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return const WebViewPage(
title: '《隐私政策》',
url: Constant.privacyUrl,
title: '《用户协议》',
url: Constant.protocolUrl,
);
},
),
);
},
),
]),
),
Gaps.vGap16,
MyButton(
key: const Key('login'),
onPressed: _clickable ? _login : null,
text: ParlandoLocalizations.of(context).login,
),
Container(
height: 40.px,
alignment: Alignment.centerRight,
child: GestureDetector(
child: Text(
ParlandoLocalizations.of(context).forgotPasswordLink,
key: const Key('forgotPassword'),
style: Theme.of(context).textTheme.subtitle2,
}));
},
),
const TextSpan(text: ' & '),
TextSpan(
text: '《隐私政策》',
style: TextStyle(color: Theme.of(context).primaryColor),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return const WebViewPage(
title: '《隐私政策》',
url: Constant.privacyUrl,
);
},
),
);
},
),
]),
),
onTap: () =>
NavigatorUtils.push(context, LoginRouter.resetPasswordPage),
),
),
Gaps.vGap16,
Container(
alignment: Alignment.center,
child: GestureDetector(
child: Text(
ParlandoLocalizations.of(context).noAccountRegisterLink,
key: const Key('noAccountRegister'),
style: TextStyle(color: Theme.of(context).primaryColor),
Gaps.vGap16,
MyButton(
key: const Key('login'),
onPressed: _clickable ? _login : null,
text: ParlandoLocalizations.of(context).login,
),
Container(
height: 40.px,
alignment: Alignment.centerRight,
child: GestureDetector(
child: Text(
ParlandoLocalizations.of(context).forgotPasswordLink,
key: const Key('forgotPassword'),
style: Theme.of(context).textTheme.subtitle2,
),
onTap: () =>
NavigatorUtils.push(context, LoginRouter.resetPasswordPage),
),
onTap: () =>
NavigatorUtils.push(context, LoginRouter.registerPage),
))
];
),
Gaps.vGap16,
Container(
alignment: Alignment.center,
child: GestureDetector(
child: Text(
ParlandoLocalizations.of(context).noAccountRegisterLink,
key: const Key('noAccountRegister'),
style: TextStyle(color: Theme.of(context).primaryColor),
),
onTap: () =>
NavigatorUtils.push(context, LoginRouter.registerPage),
)),
Gaps.vGap16,
Platform.isIOS
? Center(
child: SignInWithAppleButton(
onPressed: () async {
final credential =
await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
print(credential);
},
),
)
: const Center(
child: Text(""),
),
];
}
......
This diff is collapsed. Click to expand it.
......@@ -109,6 +109,7 @@ dependencies:
email_validator: ^2.0.1
getwidget: ^2.0.5
sign_in_with_apple: ^3.3.0
dependency_overrides:
decimal: 1.5.0
......