Commit 146a15d2 authored by 关振斌's avatar 关振斌

update

parent c7740f49
assets/images/2.0x/logo.png

3.29 KB | W: | H:

assets/images/2.0x/logo.png

27.9 KB | W: | H:

assets/images/2.0x/logo.png
assets/images/2.0x/logo.png
assets/images/2.0x/logo.png
assets/images/2.0x/logo.png
  • 2-up
  • Swipe
  • Onion skin
assets/images/3.0x/logo.png

4.98 KB | W: | H:

assets/images/3.0x/logo.png

27.9 KB | W: | H:

assets/images/3.0x/logo.png
assets/images/3.0x/logo.png
assets/images/3.0x/logo.png
assets/images/3.0x/logo.png
  • 2-up
  • Swipe
  • Onion skin
assets/images/logo.png

68.9 KB | W: | H:

assets/images/logo.png

24.6 KB | W: | H:

assets/images/logo.png
assets/images/logo.png
assets/images/logo.png
assets/images/logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -73,6 +73,8 @@ PODS: ...@@ -73,6 +73,8 @@ PODS:
- flutter_inappwebview/Core (0.0.1): - flutter_inappwebview/Core (0.0.1):
- Flutter - Flutter
- OrderedSet (~> 5.0) - OrderedSet (~> 5.0)
- flutter_vibrate (0.0.1):
- Flutter
- fluttercontactpicker (4.6.0): - fluttercontactpicker (4.6.0):
- Flutter - Flutter
- fluttertoast (0.0.2): - fluttertoast (0.0.2):
...@@ -117,6 +119,8 @@ PODS: ...@@ -117,6 +119,8 @@ PODS:
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- sign_in_with_apple (0.0.1):
- Flutter
- smart_auth (0.0.1): - smart_auth (0.0.1):
- Flutter - Flutter
- sqflite (0.0.2): - sqflite (0.0.2):
...@@ -143,6 +147,7 @@ DEPENDENCIES: ...@@ -143,6 +147,7 @@ DEPENDENCIES:
- flutter_icmp_ping (from `.symlinks/plugins/flutter_icmp_ping/ios`) - flutter_icmp_ping (from `.symlinks/plugins/flutter_icmp_ping/ios`)
- flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`) - flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`)
- fluttercontactpicker (from `.symlinks/plugins/fluttercontactpicker/ios`) - fluttercontactpicker (from `.symlinks/plugins/fluttercontactpicker/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
...@@ -151,6 +156,7 @@ DEPENDENCIES: ...@@ -151,6 +156,7 @@ DEPENDENCIES:
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
- smart_auth (from `.symlinks/plugins/smart_auth/ios`) - smart_auth (from `.symlinks/plugins/smart_auth/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
...@@ -195,6 +201,8 @@ EXTERNAL SOURCES: ...@@ -195,6 +201,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inapp_purchase/ios" :path: ".symlinks/plugins/flutter_inapp_purchase/ios"
flutter_inappwebview: flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios" :path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_vibrate:
:path: ".symlinks/plugins/flutter_vibrate/ios"
fluttercontactpicker: fluttercontactpicker:
:path: ".symlinks/plugins/fluttercontactpicker/ios" :path: ".symlinks/plugins/fluttercontactpicker/ios"
fluttertoast: fluttertoast:
...@@ -211,6 +219,8 @@ EXTERNAL SOURCES: ...@@ -211,6 +219,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios" :path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios" :path: ".symlinks/plugins/shared_preferences_foundation/ios"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
smart_auth: smart_auth:
:path: ".symlinks/plugins/smart_auth/ios" :path: ".symlinks/plugins/smart_auth/ios"
sqflite: sqflite:
...@@ -240,6 +250,7 @@ SPEC CHECKSUMS: ...@@ -240,6 +250,7 @@ SPEC CHECKSUMS:
flutter_icmp_ping: 2b159955eee0c487c766ad83fec224ae35e7c935 flutter_icmp_ping: 2b159955eee0c487c766ad83fec224ae35e7c935
flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8 flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801
fluttercontactpicker: d582836dea6b5d489f3d259f35d7817ae82ee5e6 fluttercontactpicker: d582836dea6b5d489f3d259f35d7817ae82ee5e6
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0 fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
...@@ -255,6 +266,7 @@ SPEC CHECKSUMS: ...@@ -255,6 +266,7 @@ SPEC CHECKSUMS:
SDWebImage: 8ab87d4b3e5cc4927bd47f78db6ceb0b94442577 SDWebImage: 8ab87d4b3e5cc4927bd47f78db6ceb0b94442577
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
smart_auth: 4bedbc118723912d0e45a07e8ab34039c19e04f2 smart_auth: 4bedbc118723912d0e45a07e8ab34039c19e04f2
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C08A8E50299A2161008F4DB8 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; }; C08A8E50299A2161008F4DB8 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
C0C4655B29A3007E00C47A11 /* RunnerProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerProfile.entitlements; sourceTree = "<group>"; };
D2718D25F9034030E31B924F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; D2718D25F9034030E31B924F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C0C4655B29A3007E00C47A11 /* RunnerProfile.entitlements */,
C08A8E50299A2161008F4DB8 /* Runner.entitlements */, C08A8E50299A2161008F4DB8 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
...@@ -356,7 +358,7 @@ ...@@ -356,7 +358,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
......
...@@ -2,22 +2,19 @@ ...@@ -2,22 +2,19 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
"info" : { "info" : {
"version" : 1, "author" : "xcode",
"author" : "xcode" "version" : 1
} }
} }
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:www.fusiontech.cn/</string> <string>applinks:www.fusiontech.cn/</string>
......
<?xml version="1.0" encoding="UTF-8"?>
<!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>applinks:www.fusiontech.cn/</string>
</array>
<key>com.apple.developer.in-app-payments</key>
<array/>
</dict>
</plist>
...@@ -57,6 +57,16 @@ class UserAPI { ...@@ -57,6 +57,16 @@ class UserAPI {
return MsmEntity.fromMap(response); return MsmEntity.fromMap(response);
} }
static Future<dynamic> appLogin(
Map<String, dynamic>? params,
) async {
var response = await HttpUtil().post(
'/apple/checkAppleToken',
data: params,
);
return LoginEntity.fromMap(response['data']);
}
// /sms/sendSms // /sms/sendSms
/// 注册 /// 注册
static Future<UserRegisterRequestEntity> register({ static Future<UserRegisterRequestEntity> register({
...@@ -80,7 +90,7 @@ class UserAPI { ...@@ -80,7 +90,7 @@ class UserAPI {
/// Logout /// Logout
static Future logout() async { static Future logout() async {
return await HttpUtil().post( return await HttpUtil().post(
'/user/logout', '/logout',
); );
} }
} }
...@@ -10,4 +10,8 @@ class AppRoutes { ...@@ -10,4 +10,8 @@ class AppRoutes {
static const PRODUCT_PAGE = '/product'; static const PRODUCT_PAGE = '/product';
static const TEMPLATE_PAGE = '/template'; static const TEMPLATE_PAGE = '/template';
static const PAY_LIST = '/pay'; static const PAY_LIST = '/pay';
static const PRIVACT = '/privacy';
static const USER_PRIVACT = '/user_privacy';
static const WILL_COME = '/will_come';
// UserPrivacyPage
} }
import 'package:chart/pages/chat/view.dart'; import 'package:chart/pages/chat/view.dart';
import 'package:chart/pages/frame/notfound/index.dart'; import 'package:chart/pages/frame/notfound/index.dart';
import 'package:chart/pages/frame/pay_list/view.dart'; import 'package:chart/pages/frame/pay_list/view.dart';
import 'package:chart/pages/privacy/index.dart';
import 'package:chart/pages/template/index.dart'; import 'package:chart/pages/template/index.dart';
import 'package:chart/pages/user_privacy/index.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/middlewares/middlewares.dart'; import 'package:chart/common/middlewares/middlewares.dart';
import 'package:chart/pages/application/index.dart'; import 'package:chart/pages/application/index.dart';
...@@ -25,22 +27,33 @@ class AppPages { ...@@ -25,22 +27,33 @@ class AppPages {
static final List<GetPage> routes = [ static final List<GetPage> routes = [
// // 免登陆 // // 免登陆
GetPage(
name: AppRoutes.INITIAL,
page: () => WelcomePage(),
binding: WelcomeBinding(),
middlewares: [
RouteWelcomeMiddleware(priority: 1),
],
),
// 需要登录
// 分类列表
// GetPage( // GetPage(
// name: AppRoutes.INITIAL, // name: AppRoutes.INITIAL,
// page: () => WelcomePage(), // page: () => WelcomePage(), //ApplicationPage(),
// binding: WelcomeBinding(), // binding: WelcomeBinding(), // ApplicationBinding(),
// middlewares: [ // middlewares: [
// RouteWelcomeMiddleware(priority: 1), // // RouteAuthMiddleware(priority: 1),
// ], // ],
// ), // // children: [
// 需要登录
// 分类列表
// // ]
// ),
GetPage( GetPage(
name: AppRoutes.INITIAL, name: AppRoutes.USER_PRIVACT,
page: () => WelcomePage(), //ApplicationPage(), page: () => UserPrivacyPage(), //ApplicationPage(),
binding: WelcomeBinding(), // ApplicationBinding(), binding: UserPrivacyBinding(), // ApplicationBinding(),
middlewares: [ middlewares: [
// RouteAuthMiddleware(priority: 1), // RouteAuthMiddleware(priority: 1),
], ],
...@@ -48,7 +61,18 @@ class AppPages { ...@@ -48,7 +61,18 @@ class AppPages {
// ] // ]
), ),
// USER_PRIVACT
GetPage(
name: AppRoutes.PRIVACT,
page: () => PrivacyPage(), //ApplicationPage(),
binding: PrivacyBinding(), // ApplicationBinding(),
middlewares: [
// RouteAuthMiddleware(priority: 1),
],
// children: [
// ]
),
GetPage( GetPage(
name: AppRoutes.SIGN_IN, name: AppRoutes.SIGN_IN,
page: () => SignInPage(), page: () => SignInPage(),
......
...@@ -6,6 +6,7 @@ import 'package:chart/common/routers/routes.dart'; ...@@ -6,6 +6,7 @@ import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/services/services.dart'; import 'package:chart/common/services/services.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:chart/entity/login_entity.dart'; import 'package:chart/entity/login_entity.dart';
import 'package:chart/pages/application/index.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../entity/user_entity.dart'; import '../../entity/user_entity.dart';
...@@ -34,25 +35,31 @@ class UserStore extends GetxController { ...@@ -34,25 +35,31 @@ class UserStore extends GetxController {
if (profileOffline.isNotEmpty) { if (profileOffline.isNotEmpty) {
var l = jsonDecode(profileOffline); var l = jsonDecode(profileOffline);
Map<String, dynamic> map = json.decode(l); Map<String, dynamic> map = json.decode(l);
_profile(IntegralEntity.fromMap(map)); _profile.value = _profile(IntegralEntity.fromMap(map));
if (profile.id != '') {
_isLogin.value = true;
}
// _profile(IntegralEntity.fromMap(); // _profile(IntegralEntity.fromMap();
// IntegralEntity.fromMap(result['data']); // IntegralEntity.fromMap(result['data']);
// _profile(UserLoginResponseEntity.fromJson(jsonDecode(profileOffline))); // _profile(UserLoginResponseEntity.fromJson(jsonDecode(profileOffline)));
} }
} }
handleLogin(LoginEntity res) async { handleLogin(IntegralEntity res) async {
await setToken(res.token); await setToken(res.token);
IntegralEntity userInfo = await UserAPI.getUserIntegral(); // IntegralEntity userInfo = await UserAPI.getUserIntegral();
await UserStore.to.getUserInfo(userInfo); await getUserInfo(
IntegralEntity(id: res.id, username: res.username, token: res.token));
_isLogin.value = true; _isLogin.value = true;
Get.offAndToNamed(AppRoutes.Application); Get.offAndToNamed(AppRoutes.Application);
Get.put(ApplicationController());
} }
getUserInfo(IntegralEntity userInfo) async { getUserInfo(IntegralEntity userInfo) async {
await setToken(userInfo.token); await setToken(userInfo.token);
_profile.value = userInfo;
await saveProfile(userInfo); await saveProfile(userInfo);
// token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY); // token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
...@@ -102,5 +109,9 @@ class UserStore extends GetxController { ...@@ -102,5 +109,9 @@ class UserStore extends GetxController {
await StorageService.to.remove(STORAGE_USER_TOKEN_KEY); await StorageService.to.remove(STORAGE_USER_TOKEN_KEY);
_isLogin.value = false; _isLogin.value = false;
token = ''; token = '';
_profile.value = IntegralEntity(id: '', username: '', token: '');
saveProfile(IntegralEntity(id: '', username: '', token: ''));
Get.offAllNamed(AppRoutes.SIGN_IN);
} }
} }
// baidu yapi // baidu yapi
// const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008'; // const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008';
// const SERVER_API_URL = 'https://yapi.ducafecat.tech/mock/11'; // const SERVER_API_URL = 'https://yapi.ducafecat.tech/mock/11';
// const SERVER_API_URL = 'http://101.34.153.228:8083/api'; const SERVER_API_URL = 'http://101.34.153.228:8083/api';
const SERVER_API_URL = 'http://192.168.2.178:8083/api'; // const SERVER_API_URL = 'http://192.168.2.178:8083/api';
// const SERVER_API_URL = 'http://192.168.110.57:8083/api';
//
// AppRoutes.PRODUCT_PAGE // const SERVER_API_URL = 'http://192.168.110.163:8083/api';
// const SERVER_API_URL = 'http://192.168.110.170:8083/api';
// const SERVER_API_URL = 'http://192.168.110.199:8083/api';
// http://192.168.110.199:8083/api/doc.html
// AppRoutes.PRODUCT_PAGE
//http://192.168.2.178:8083/api/doc.html //http://192.168.2.178:8083/api/doc.html
// static const String baseUrl = 'http://101.34.153.228:8083'; // 基础接口地址 // static const String baseUrl = 'http://101.34.153.228:8083'; // 基础接口地址
// static const String baseApiUrl = '${baseUrl}/api'; // 基础接口地址 // static const String baseApiUrl = '${baseUrl}/api'; // 基础接口地址
// http://101.34.153.228:8083/api/doc.html // http://101.34.153.228:8083/api/doc.html
......
...@@ -20,7 +20,7 @@ Widget btnFlatButtonWidget({ ...@@ -20,7 +20,7 @@ Widget btnFlatButtonWidget({
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
textStyle: MaterialStateProperty.all(TextStyle( textStyle: MaterialStateProperty.all(TextStyle(
fontSize: 16.sp, fontSize: 16,
)), )),
foregroundColor: MaterialStateProperty.resolveWith( foregroundColor: MaterialStateProperty.resolveWith(
(states) { (states) {
......
...@@ -32,7 +32,7 @@ Widget inputTextEdit({ ...@@ -32,7 +32,7 @@ Widget inputTextEdit({
color: AppColors.primaryText, color: AppColors.primaryText,
fontFamily: "Avenir", fontFamily: "Avenir",
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 18.sp, fontSize: 18,
), ),
maxLines: 1, maxLines: 1,
autocorrect: false, // 自动纠正 autocorrect: false, // 自动纠正
...@@ -81,7 +81,7 @@ Widget inputEmailEdit({ ...@@ -81,7 +81,7 @@ Widget inputEmailEdit({
color: AppColors.primaryText, color: AppColors.primaryText,
fontFamily: "Avenir", fontFamily: "Avenir",
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 18.sp, fontSize: 18,
), ),
maxLines: 1, maxLines: 1,
autocorrect: false, // 自动纠正 autocorrect: false, // 自动纠正
......
...@@ -90,8 +90,9 @@ class DefaultMessageText extends StatelessWidget { ...@@ -90,8 +90,9 @@ class DefaultMessageText extends StatelessWidget {
Widget getPostMessageBuild( Widget getPostMessageBuild(
String text, List<ChatMessage> messageLength, bool isOwnMessage) { String text, List<ChatMessage> messageLength, bool isOwnMessage) {
var lastMessage = messageLength.last; var lastMessage = messageLength.first;
print(lastMessage.text);
// if(lastMessage.) { // if(lastMessage.) {
// } // }
...@@ -99,21 +100,23 @@ class DefaultMessageText extends StatelessWidget { ...@@ -99,21 +100,23 @@ class DefaultMessageText extends StatelessWidget {
// if(a.is) // if(a.is)
// if() // if()
return AnimatedTextKit( return lastMessage.text == text
animatedTexts: [ ? AnimatedTextKit(
TypewriterAnimatedText( animatedTexts: [
text, TypewriterAnimatedText(
textStyle: const TextStyle( text,
// fontSize: 32.0, textStyle: const TextStyle(
// fontWeight: FontWeight.bold, // fontSize: 32.0,
), // fontWeight: FontWeight.bold,
speed: const Duration(milliseconds: 100), ),
) speed: const Duration(milliseconds: 100),
], )
totalRepeatCount: 1, ],
// displayFullTextOnTap: true, totalRepeatCount: 1,
// stopPauseOnTap: true, // displayFullTextOnTap: true,
); // stopPauseOnTap: true,
)
: Text(text);
} }
// {buildPostMessage = getPostMessageBuild} // {buildPostMessage = getPostMessageBuild}
......
import 'package:chart/pages/category/index.dart'; import 'package:chart/pages/category/index.dart';
import 'package:chart/pages/frame/pay_list/index.dart';
import 'package:chart/pages/main/index.dart'; import 'package:chart/pages/main/index.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
...@@ -11,6 +12,7 @@ class ApplicationBinding implements Bindings { ...@@ -11,6 +12,7 @@ class ApplicationBinding implements Bindings {
Get.lazyPut<ApplicationController>(() => ApplicationController()); Get.lazyPut<ApplicationController>(() => ApplicationController());
Get.lazyPut<MainController>(() => MainController()); Get.lazyPut<MainController>(() => MainController());
Get.lazyPut<CategoryController>(() => CategoryController()); Get.lazyPut<CategoryController>(() => CategoryController());
Get.lazyPut<PayListController>(() => PayListController());
// Get.lazyPut<ChatPageController>(() => ChatPageController()); // Get.lazyPut<ChatPageController>(() => ChatPageController());
} }
} }
import 'dart:async'; import 'dart:async';
import 'package:vibration/vibration.dart'; // import 'package:vibration/vibration.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -7,11 +8,23 @@ import 'package:chart/common/routers/routes.dart'; ...@@ -7,11 +8,23 @@ import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/utils/utils.dart'; import 'package:chart/common/utils/utils.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
// import 'package:vibrate/vibrate.dart';
// import 'package:uni_links/uni_links.dart'; // import 'package:uni_links/uni_links.dart';
import '../../common/store/config.dart'; import '../../common/store/config.dart';
import 'index.dart'; import 'index.dart';
// enum FeedbackType {
// success,
// error,
// warning,
// selection,
// impact,
// heavy,
// medium,
// light
// }
class ApplicationController extends GetxController { class ApplicationController extends GetxController {
ApplicationController(); ApplicationController();
...@@ -37,8 +50,13 @@ class ApplicationController extends GetxController { ...@@ -37,8 +50,13 @@ class ApplicationController extends GetxController {
// if (await Vibration.hasVibrator() != null) { // if (await Vibration.hasVibrator() != null) {
// Vibration.vibrate(duration: 10, amplitude: 128); // Vibration.vibrate(duration: 10, amplitude: 128);
// } // }
pageController.animateToPage(index, Vibrate.feedback(FeedbackType.impact);
duration: const Duration(milliseconds: 200), curve: Curves.ease); try {
pageController.animateToPage(index,
duration: const Duration(milliseconds: 200), curve: Curves.ease);
} catch (e) {
print(e);
}
} }
// tab栏页码切换 // tab栏页码切换
...@@ -90,6 +108,7 @@ class ApplicationController extends GetxController { ...@@ -90,6 +108,7 @@ class ApplicationController extends GetxController {
// 跳转 注册界面 // 跳转 注册界面
handleChat() async { handleChat() async {
Vibrate.feedback(FeedbackType.impact);
Get.toNamed(AppRoutes.CHAT_PAGE); Get.toNamed(AppRoutes.CHAT_PAGE);
// await ConfigStore.to.saveAlreadyOpen(); // await ConfigStore.to.saveAlreadyOpen();
// Get.offAndToNamed(AppRoutes.CHAT_PAGE); // Get.offAndToNamed(AppRoutes.CHAT_PAGE);
...@@ -116,7 +135,7 @@ class ApplicationController extends GetxController { ...@@ -116,7 +135,7 @@ class ApplicationController extends GetxController {
Iconfont.home, Iconfont.home,
color: AppColors.secondaryElementText, color: AppColors.secondaryElementText,
), ),
label: 'main', label: '首页',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
new BottomNavigationBarItem( new BottomNavigationBarItem(
...@@ -128,7 +147,7 @@ class ApplicationController extends GetxController { ...@@ -128,7 +147,7 @@ class ApplicationController extends GetxController {
Iconfont.grid, Iconfont.grid,
color: AppColors.secondaryElementText, color: AppColors.secondaryElementText,
), ),
label: 'category', label: '信息广场',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
// new BottomNavigationBarItem( // new BottomNavigationBarItem(
...@@ -152,7 +171,7 @@ class ApplicationController extends GetxController { ...@@ -152,7 +171,7 @@ class ApplicationController extends GetxController {
Iconfont.me, Iconfont.me,
color: AppColors.secondaryElementText, color: AppColors.secondaryElementText,
), ),
label: 'my', label: '个人中心',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
]; ];
......
...@@ -18,7 +18,7 @@ class ApplicationPage extends GetView<ApplicationController> { ...@@ -18,7 +18,7 @@ class ApplicationPage extends GetView<ApplicationController> {
style: TextStyle( style: TextStyle(
color: AppColors.primaryElementText, color: AppColors.primaryElementText,
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontSize: 18.sp, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
)), )),
......
...@@ -28,7 +28,7 @@ class ChatPage extends GetView<ChatPageController> { ...@@ -28,7 +28,7 @@ class ChatPage extends GetView<ChatPageController> {
style: TextStyle( style: TextStyle(
color: AppColors.primaryElementText, color: AppColors.primaryElementText,
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontSize: 18.sp, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
......
...@@ -2,6 +2,7 @@ import 'package:chart/common/apis/apis.dart'; ...@@ -2,6 +2,7 @@ import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/store/store.dart'; import 'package:chart/common/store/store.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat; import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types; import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
...@@ -30,8 +31,8 @@ class ChatNewController extends GetxController { ...@@ -30,8 +31,8 @@ class ChatNewController extends GetxController {
final receiveUser = Chat.ChatUser( final receiveUser = Chat.ChatUser(
id: '82091008-a484-4a89-ae75-a22bf8d6f3aa', id: '82091008-a484-4a89-ae75-a22bf8d6f3aa',
firstName: "GPT", firstName: "A",
lastName: '大师', lastName: 'I',
// imageUrl: // imageUrl:
// "https://imgb15.photophoto.cn/20201124/jiqirentupian-39852917_3.jpg" // "https://imgb15.photophoto.cn/20201124/jiqirentupian-39852917_3.jpg"
// // imageUrl: "assets/images/300.jpg", // // imageUrl: "assets/images/300.jpg",
...@@ -40,6 +41,7 @@ class ChatNewController extends GetxController { ...@@ -40,6 +41,7 @@ class ChatNewController extends GetxController {
/// 事件 /// 事件
void sendMessage(Chat.ChatMessage message) async { void sendMessage(Chat.ChatMessage message) async {
Vibrate.feedback(FeedbackType.impact);
// if (state.messageList.isNotEmpty) { // if (state.messageList.isNotEmpty) {
// // data = !_messages.every((element) => element.status != Status.sending); // // data = !_messages.every((element) => element.status != Status.sending);
// } // }
...@@ -90,6 +92,7 @@ class ChatNewController extends GetxController { ...@@ -90,6 +92,7 @@ class ChatNewController extends GetxController {
); );
_addMessage(receiveMessage); _addMessage(receiveMessage);
EasyLoading.dismiss(); EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.success);
} catch (e) { } catch (e) {
print("eeeeeeee$e"); print("eeeeeeee$e");
// _cancelLoading(); // _cancelLoading();
...@@ -102,6 +105,7 @@ class ChatNewController extends GetxController { ...@@ -102,6 +105,7 @@ class ChatNewController extends GetxController {
_addMessage(receiveErrorMessage); _addMessage(receiveErrorMessage);
EasyLoading.dismiss(); EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.error);
} }
} }
......
...@@ -10,7 +10,7 @@ class ChatPageState { ...@@ -10,7 +10,7 @@ class ChatPageState {
RxList<Chat.ChatMessage> messageList = <Chat.ChatMessage>[].obs; RxList<Chat.ChatMessage> messageList = <Chat.ChatMessage>[].obs;
// get _messageList => // get _messageList =>
final _page = "与人工智能机器人的对话".obs; final _page = "AI写作大师".obs;
set page(value) => this._page.value = value; set page(value) => this._page.value = value;
get page => this._page.value; get page => this._page.value;
// RxList<NewsItem> newsList = <NewsItem>[].obs; // RxList<NewsItem> newsList = <NewsItem>[].obs;
......
...@@ -21,19 +21,32 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -21,19 +21,32 @@ class ChatNewPage extends GetView<ChatNewController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final c = Get.put(ChatPageController()); // final c = Get.put(ChatPageController());
// Text(
// "${controller.state.page}",
// style: TextStyle(
// color: AppColors.primaryElementText,
// fontFamily: 'Montserrat',
// fontSize: 18,
// fontWeight: FontWeight.w600,
// ),
// )
// final c = Get.put(ChatNewController()); // final c = Get.put(ChatNewController());
return Obx(() => Scaffold( return Obx(() => Scaffold(
appBar: transparentAppBar( appBar: transparentAppBar(
title: Text( title: RichText(
"${controller.state.page}${controller.state.messageList.length}", text: TextSpan(children: [
style: TextStyle( TextSpan(
color: AppColors.primaryElementText, text: "${controller.state.page}",
fontFamily: 'Montserrat', style: TextStyle(
fontSize: 18.sp, color: AppColors.primaryElementText,
fontWeight: FontWeight.w600, fontFamily: 'Montserrat',
), fontSize: 18,
), fontWeight: FontWeight.w600,
)),
TextSpan(
text: "${controller.state.messageList.length}",
style: TextStyle(fontSize: 0)),
])),
leading: IconButton( leading: IconButton(
tooltip: '返回上一页', tooltip: '返回上一页',
icon: const Icon( icon: const Icon(
...@@ -124,6 +137,7 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -124,6 +137,7 @@ class ChatNewPage extends GetView<ChatNewController> {
// // ), // // ),
// ), // ),
), ),
// ${controller.state.messageList.length}条消息
currentUser: _user, currentUser: _user,
onSend: controller.sendMessage, onSend: controller.sendMessage,
// messageListOptions: // messageListOptions:
......
import 'dart:async'; import 'dart:async';
import 'package:chart/common/apis/apis.dart'; import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/store.dart'; import 'package:chart/common/store/store.dart';
import 'package:chart/entity/user_entity.dart'; import 'package:chart/entity/user_entity.dart';
import 'package:chart/pages/application/index.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart'; import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart';
import 'package:flutter_inapp_purchase/modules.dart'; import 'package:flutter_inapp_purchase/modules.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'index.dart'; import 'index.dart';
...@@ -19,14 +22,21 @@ class PayListController extends GetxController { ...@@ -19,14 +22,21 @@ class PayListController extends GetxController {
"com.wudi.app.weekly_pass", "com.wudi.app.weekly_pass",
"com.wudi.app.monthly_pass", "com.wudi.app.monthly_pass",
"com.wudi.app.60stars" "com.wudi.app.60stars"
// "com.wudi.app.prod_id_002",
// "com.wudi.app.prod_id_003",
// "com.wudi.app.prod_id_004"
]; ];
var _conectionSubscription; final List<dynamic> _mapData = [
var _purchaseUpdatedSubscription; {"id": "com.wudi.app.weekly_pass", "name": "周卡"},
var _purchaseErrorSubscription; {"id": "com.wudi.app.monthly_pass", "name": "月卡"},
{"id": "com.wudi.app.60stars", "name": "30次问答卡"}
];
late StreamSubscription _purchaseUpdatedSubscription;
late StreamSubscription _purchaseErrorSubscription;
late StreamSubscription _conectionSubscription;
// Platform messages may fail, so we use a try/catch PlatformException.
// prepare
/// 成员变量 /// 成员变量
...@@ -47,7 +57,7 @@ class PayListController extends GetxController { ...@@ -47,7 +57,7 @@ class PayListController extends GetxController {
@override @override
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
await initializedPlugins();
await _getProduct(); await _getProduct();
// await initializedPlugins(); // await initializedPlugins();
...@@ -55,6 +65,53 @@ class PayListController extends GetxController { ...@@ -55,6 +65,53 @@ class PayListController extends GetxController {
// 初始静态数据 // 初始静态数据
} }
Future initializedPlugins() async {
var result = await FlutterInappPurchase.instance.initialize();
print('result: $result');
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
_conectionSubscription =
FlutterInappPurchase.connectionUpdated.listen((connected) {
print('connected: $connected');
});
_purchaseUpdatedSubscription =
FlutterInappPurchase.purchaseUpdated.listen((productItem) async {
print("支付1次");
ApplePayEntity? res = await UserAPI.notifyApplePay({
'receipt': productItem?.transactionReceipt,
'userId': UserStore.to.profile.id,
'productId': productItem!.productId,
"chooseEnv": false
});
if (res?.status == 200) {
EasyLoading.showSuccess('${res?.message}');
Vibrate.feedback(FeedbackType.success);
EasyLoading.dismiss();
Get.back();
// Get.offAndToNamed(AppRoutes.Application);
// Get.put(ApplicationController());
} else {
await FlutterInappPurchase.instance.clearTransactionIOS();
EasyLoading.showError("${res?.message}}");
EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.error);
}
});
_purchaseErrorSubscription =
FlutterInappPurchase.purchaseError.listen((purchaseError) {
// print('purchase-error: $purchaseError');
Vibrate.feedback(FeedbackType.error);
EasyLoading.showError('支付订单失败');
EasyLoading.dismiss();
});
}
Future _getProduct() async { Future _getProduct() async {
try { try {
List<IAPItem> items = List<IAPItem> items =
...@@ -71,8 +128,12 @@ class PayListController extends GetxController { ...@@ -71,8 +128,12 @@ class PayListController extends GetxController {
} }
} }
void requestPurchase(IAPItem item) { void requestPurchase() {
FlutterInappPurchase.instance.requestPurchase(item.productId!); Vibrate.feedback(FeedbackType.selection);
// print("${item.productId}");
EasyLoading.show(status: '支付中...');
// IAPItem item
FlutterInappPurchase.instance.requestPurchase(state.selected);
} }
///在 onInit() 之后调用 1 帧。这是进入的理想场所 ///在 onInit() 之后调用 1 帧。这是进入的理想场所
...@@ -100,9 +161,9 @@ class PayListController extends GetxController { ...@@ -100,9 +161,9 @@ class PayListController extends GetxController {
///dispose 释放内存 ///dispose 释放内存
@override @override
void dispose() { void dispose() {
// _purchaseUpdatedSubscription.cancel(); _purchaseUpdatedSubscription.cancel();
// _purchaseErrorSubscription.cancel(); _purchaseErrorSubscription.cancel();
// _conectionSubscription.cancel(); _conectionSubscription.cancel();
super.dispose(); super.dispose();
// dispose 释放对象 // dispose 释放对象
} }
......
...@@ -7,5 +7,9 @@ class PayListState { ...@@ -7,5 +7,9 @@ class PayListState {
set title(value) => this._title.value = value; set title(value) => this._title.value = value;
get title => this._title.value; get title => this._title.value;
final _selected = "com.wudi.app.60stars".obs;
set selected(value) => _selected.value = value;
get selected => _selected.value;
RxList<IAPItem> items = <IAPItem>[].obs; RxList<IAPItem> items = <IAPItem>[].obs;
} }
...@@ -11,6 +11,8 @@ import 'widgets/widgets.dart'; ...@@ -11,6 +11,8 @@ import 'widgets/widgets.dart';
class PayListPage extends GetView<PayListController> { class PayListPage extends GetView<PayListController> {
// 内容页 // 内容页
Widget _buildView() { Widget _buildView() {
// return PayItemWidget();
return PayItemWidget(); return PayItemWidget();
} }
...@@ -18,56 +20,46 @@ class PayListPage extends GetView<PayListController> { ...@@ -18,56 +20,46 @@ class PayListPage extends GetView<PayListController> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final c = Get.put(PayListController()); final c = Get.put(PayListController());
return Scaffold( return Scaffold(
appBar: transparentAppBar( // appBar: transparentAppBar(
title: Text( // title: Text(
"套餐选择", // "套餐选择",
style: TextStyle( // style: TextStyle(
color: AppColors.primaryElementText, // color: AppColors.primaryElementText,
fontFamily: 'Montserrat', // fontFamily: 'Montserrat',
fontSize: 18.sp, // fontSize: 18,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
), // ),
), // ),
leading: IconButton( // leading: IconButton(
tooltip: '返回上一页', // tooltip: '返回上一页',
icon: const Icon( // icon: const Icon(
Icons.arrow_back, // Icons.arrow_back,
color: AppColors.primaryElementText, // color: AppColors.primaryElementText,
), // ),
onPressed: () async { // onPressed: () async {
// Get.back(); // // Get.back();
// Get.offAll(ApplicationPage()); // // Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage()); // // await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application); // // Get.toNamed(AppRoutes.Application);
Get.back(); // Get.back();
// await Get.toNamed(); // // await Get.toNamed();
// Navigator.of(context).pop(); // // Navigator.of(context).pop();
//_nextPage(-1); // //_nextPage(-1);
}, // },
), // ),
), // ),
// _buildView // _buildView
body: Container( body: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 20), // padding: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: Image.asset("assets/images/bg.png").image, image: Image.asset("assets/images/bg1.png").image,
fit: BoxFit.cover), fit: BoxFit.cover),
), ),
child: SingleChildScrollView( child: _buildView()),
child: Obx(() => Column(
children: [
Text(
c.state.items.length.toString(),
style: TextStyle(color: Color.fromRGBO(0, 0, 0, 0)),
),
Container(child: PayItemWidget())
],
)),
)),
); );
} }
} }
import 'dart:async';
import 'package:chart/common/store/store.dart';
import 'package:chart/entity/user_entity.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import '../../../../common/apis/apis.dart';
import '../index.dart';
class PayItemWidget extends StatefulWidget {
const PayItemWidget({Key? key}) : super(key: key);
@override
GoodsPageState createState() => GoodsPageState();
}
class GoodsPageState extends State<PayItemWidget> {
late StreamSubscription _purchaseUpdatedSubscription;
late StreamSubscription _purchaseErrorSubscription;
late StreamSubscription _conectionSubscription;
@override
void initState() {
initializedPlugins();
// TODO: implement initState
super.initState();
}
initializedPlugins() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
// prepare
var result = await FlutterInappPurchase.instance.initialize();
print('result: $result');
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
_conectionSubscription =
FlutterInappPurchase.connectionUpdated.listen((connected) {
print('connected: $connected');
});
_purchaseUpdatedSubscription =
FlutterInappPurchase.purchaseUpdated.listen((productItem) async {
// print(a);
ApplePayEntity? res = await UserAPI.notifyApplePay({
'receipt': productItem?.transactionReceipt,
'userId': UserStore.to.profile.id,
"chooseEnv": false
});
print(
"productItemproductItemproductItemproductItemproductItemproductItemproductItemproductItem");
if (res?.status == 200) {
await FlutterInappPurchase.instance.clearTransactionIOS();
EasyLoading.showSuccess('${res?.message}');
EasyLoading.dismiss();
} else {
EasyLoading.showError("${res?.message}}");
EasyLoading.dismiss();
}
});
_purchaseErrorSubscription =
FlutterInappPurchase.purchaseError.listen((purchaseError) {
// print('purchase-error: $purchaseError');
EasyLoading.showError('支付订单失败');
EasyLoading.dismiss();
});
}
@override
dispose() {
_purchaseUpdatedSubscription.cancel();
_purchaseErrorSubscription.cancel();
_conectionSubscription.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
var count = 0.obs;
// ProductController c = Get.put(ProductController());
// ProductController c = Get.put(ProductController());
PayListController c = Get.find();
// initDataList
return Column(
children: c.state.items
.map((item) => GlassmorphicContainer(
borderRadius: 16,
margin: EdgeInsets.only(top: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
const Color(0xFF0FFFF).withOpacity(0.2),
const Color(0xFF0FFFF).withOpacity(0.2),
],
),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
const Color(0xFF0FFFF).withOpacity(1),
const Color(0xFFFFFFF),
const Color(0xFF0FFFF).withOpacity(1),
],
),
height: 173,
width: double.infinity,
// margin: EdgeInsets.symmetric(vertical: 10.0),
child: Container(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(16.0),
width: double.infinity,
// height: 200,
child: Column(children: [
Row(
children: [
const Text(
"项目名称:",
style: TextStyle(color: Colors.white),
),
SizedBox(
width: 10,
),
Text(
item.title!,
style: TextStyle(color: Colors.white),
)
],
),
Row(
children: [
const Text(
"项目价格:",
style: TextStyle(color: Colors.white),
),
SizedBox(
width: 10,
),
Text(
item.localizedPrice!,
style: TextStyle(color: Colors.white),
)
],
),
Row(
children: [
const Text(
"项目描述:",
style: TextStyle(color: Colors.white),
),
SizedBox(
width: 10,
),
Expanded(
child: Text(
maxLines: 3,
item.description!,
style: TextStyle(
color: Colors.white,
),
))
],
),
Row(children: [
ElevatedButton(
// color: Colors.orange,
onPressed: () {
EasyLoading.show(status: '提交订单中...');
c.requestPurchase(item);
// c()
},
child: Text('购买套餐'),
),
])
]),
// child: ,
),
],
),
),
))
.toList());
}
}
import 'dart:async';
import 'package:chart/common/store/store.dart';
import 'package:chart/entity/user_entity.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart'; import 'package:glassy/glassy_button.dart';
import 'package:glassy/glassy_card.dart';
import 'package:glassy/glassy_config.dart';
import 'package:gradient_widgets/gradient_widgets.dart';
import '../../../../common/apis/apis.dart';
import '../index.dart'; import '../index.dart';
class PayItemWidget extends StatefulWidget { const color = Color(0xff8AFBFF);
const PayItemWidget({Key? key}) : super(key: key);
@override
GoodsPageState createState() => GoodsPageState();
}
class GoodsPageState extends State<PayItemWidget> {
late StreamSubscription _purchaseUpdatedSubscription;
late StreamSubscription _purchaseErrorSubscription;
late StreamSubscription _conectionSubscription;
@override
void initState() {
initializedPlugins();
// TODO: implement initState
super.initState();
}
initializedPlugins() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
// prepare
var result = await FlutterInappPurchase.instance.initialize();
print('result: $result');
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
_conectionSubscription =
FlutterInappPurchase.connectionUpdated.listen((connected) {
print('connected: $connected');
});
_purchaseUpdatedSubscription =
FlutterInappPurchase.purchaseUpdated.listen((productItem) async {
// print(a);
ApplePayEntity? res = await UserAPI.notifyApplePay({
'receipt': productItem?.transactionReceipt,
'userId': UserStore.to.profile.id,
"chooseEnv": false
});
print(
"productItemproductItemproductItemproductItemproductItemproductItemproductItemproductItem");
if (res?.status == 200) {
await FlutterInappPurchase.instance.clearTransactionIOS();
EasyLoading.showSuccess('${res?.message}');
EasyLoading.dismiss();
} else {
EasyLoading.showError("${res?.message}}");
EasyLoading.dismiss();
}
});
_purchaseErrorSubscription =
FlutterInappPurchase.purchaseError.listen((purchaseError) {
// print('purchase-error: $purchaseError');
EasyLoading.showError('支付订单失败');
EasyLoading.dismiss();
});
}
@override
dispose() {
_purchaseUpdatedSubscription.cancel();
_purchaseErrorSubscription.cancel();
_conectionSubscription.cancel();
super.dispose();
}
/// hellowrod
class PayItemWidget extends GetView<PayListController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var count = 0.obs; return Container(
// ProductController c = Get.put(ProductController()); padding: EdgeInsets.only(top: 40, bottom: 40),
// ProductController c = Get.put(ProductController()); child: Column(
PayListController c = Get.find(); children: [
Container(
// padding: EdgeInsets.all(0),
// color: Colors.red,
height: Get.mediaQuery.size.height * 0.35,
child: Stack(
// ignore: prefer_const_literals_to_create_immutables
children: [
Align(
alignment: Alignment.topRight,
child: InkWell(
onTap: () => Get.back(),
child: Container(
// color: Colors.amber,
padding: EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
child: Icon(
Icons.close_outlined,
color: Colors.white,
),
)),
),
// ignore: prefer_const_constructors
Align(
alignment: Alignment.centerLeft,
child: Image(
image: AssetImage("assets/images/left.png"),
width: Get.mediaQuery.size.height * 0.17,
),
// initDataList // child: Container(
return Column( // width: getRelativeHeight(0.13),
children: c.state.items // height: getRelativeHeight(0.13),
.map((item) => GlassmorphicContainer( // decoration: BoxDecoration(
borderRadius: 16, // border:
margin: EdgeInsets.only(top: 16), // Border.all(width: 15, color: circleColor.withOpacity(0.6)),
blur: 14, // shape: BoxShape.circle,
alignment: Alignment.bottomCenter, // ),
border: 2, // ),
linearGradient: LinearGradient( ),
begin: Alignment.topLeft, Align(
end: Alignment.bottomRight, alignment: Alignment.center,
colors: [ child: Image(
const Color(0xFF0FFFF).withOpacity(0.2), image: AssetImage("assets/images/center.png"),
const Color(0xFF0FFFF).withOpacity(0.2), width: Get.mediaQuery.size.height * 0.21,
], ),
// child: Container(
// width: getRelativeHeight(0.11),
// height: getRelativeHeight(0.11),
// decoration: BoxDecoration(
// border:
// Border.all(width: 15, color: circleColor.withOpacity(0.25)),
// shape: BoxShape.circle,
// ),
// ),
), ),
borderGradient: LinearGradient( Align(
begin: Alignment.topLeft, alignment: Alignment.centerRight,
end: Alignment.bottomRight, child: Image(
colors: [ image: AssetImage("assets/images/you.png"),
const Color(0xFF0FFFF).withOpacity(1), width: Get.mediaQuery.size.height * 0.17,
const Color(0xFFFFFFF), ),
const Color(0xFF0FFFF).withOpacity(1), // child: Container(
// width: getRelativeHeight(0.11),
// height: getRelativeHeight(0.11),
// decoration: BoxDecoration(
// border:
// Border.all(width: 15, color: circleColor.withOpacity(0.17)),
// shape: BoxShape.circle,
// ),
// ),
),
],
)),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.send, color: color),
Text("升级 AI写作大师 Premium",
style: TextStyle(color: color, fontSize: 20))
], ],
), ),
height: 173, Container(
width: double.infinity, margin: EdgeInsets.only(top: 20),
// margin: EdgeInsets.symmetric(vertical: 10.0), padding: EdgeInsets.only(left: 10),
child: Container( height: Get.mediaQuery.size.height * 0.14,
child: Column( child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( children: [
padding: EdgeInsets.all(16.0), Column(
width: double.infinity, crossAxisAlignment: CrossAxisAlignment.start,
// height: 200, mainAxisAlignment: MainAxisAlignment.spaceAround,
child: Column(children: [ children: [
Row( Row(
// crossAxisAlignment
children: [ children: [
const Text( Icon(Icons.check, color: color),
"项目名称:", Text("无限聊天",
style: TextStyle(color: Colors.white), style:
), TextStyle(color: color, fontSize: 16))
SizedBox(
width: 10,
),
Text(
item.title!,
style: TextStyle(color: Colors.white),
)
], ],
), ),
Row( Row(
children: [ children: [
const Text( Icon(Icons.check, color: color),
"项目价格:", Text("无广告",
style: TextStyle(color: Colors.white), style:
), TextStyle(color: color, fontSize: 16))
SizedBox(
width: 10,
),
Text(
item.localizedPrice!,
style: TextStyle(color: Colors.white),
)
], ],
), ),
Row( Row(
children: [ children: [
const Text( Icon(Icons.check, color: color),
"项目描述:", Text("解锁所有高级功能",
style: TextStyle(color: Colors.white), style:
), TextStyle(color: color, fontSize: 16))
SizedBox(
width: 10,
),
Expanded(
child: Text(
maxLines: 3,
item.description!,
style: TextStyle(
color: Colors.white,
),
))
], ],
), )
Row(children: [ ],
ElevatedButton( ),
// color: Colors.orange, Image(
onPressed: () { image: AssetImage("assets/images/center-1.png"),
EasyLoading.show(status: '提交订单中...'); width: Get.mediaQuery.size.height * 0.17,
c.requestPurchase(item);
// c()
},
child: Text('购买套餐'),
),
])
]),
// child: ,
), ),
], ],
), ),
), ),
)) Obx(() => Container(
.toList()); margin: EdgeInsets.only(top: 20),
child: Row(
// final String? productId;
// final String? price;
// final String? currency;
// final String? localizedPrice;
// final String? title;
// final String? description;
// final String? introductoryPrice;
children: controller.state.items
.asMap()
.keys
.map(
(item) => Expanded(
child: InkWell(
onTap: () {
Vibrate.feedback(
FeedbackType.selection);
controller.state.selected = controller
.state.items[item].productId!;
//
// c.requestPurchase(item);
},
child: GlassyCard(
config: GlassyConfig(
backgroundColor: controller
.state
.items[item]
.productId! ==
controller.state.selected
? color
: Colors.grey),
child: Container(
height: 100,
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 16),
// color: Colors.pink,
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: [
Text(
'${controller.state.items[item].localizedPrice!}',
style: TextStyle(
color: Colors.white),
),
Text(
"${item == 0 ? '30次提问卡' : item == 1 ? '月卡' : '周卡'}",
maxLines: 2,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.white),
)
],
)),
))),
)
.toList(),
),
)),
// GlassyButton(onPressed: () {}, child: Text("GradientButton"))
Expanded(
child: Container(
margin: EdgeInsets.only(top: 20),
child: GradientButton(
child: Text('订阅'),
increaseHeightBy: 15.00,
increaseWidthBy: 200.00,
callback: controller.requestPurchase,
gradient: Gradients.cosmicFusion,
shadowColor:
Gradients.backToFuture.colors.last.withOpacity(0.25),
),
))
// Container(
// padding: EdgeInsets.symmetric(horizontal: 40, vertical: 20),
// width: double.infinity,
// child:
// )
],
),
),
)
],
),
);
// Center(
// child:
// Obx(() => Text(
// "${controller.state.items.length}",
// style: TextStyle(color: Colors.amber, fontSize: 40),
// )),
// );
} }
} }
library widgets; library widgets;
export './helloword.dart'; export 'helloword.dart';
...@@ -129,6 +129,7 @@ class ProductController extends GetxController { ...@@ -129,6 +129,7 @@ class ProductController extends GetxController {
EasyLoading.dismiss(); EasyLoading.dismiss();
} catch (e) { } catch (e) {
state.loading = false; state.loading = false;
EasyLoading.dismiss();
} }
print("$str"); print("$str");
......
...@@ -43,7 +43,7 @@ class ProductPage extends GetView<ProductController> { ...@@ -43,7 +43,7 @@ class ProductPage extends GetView<ProductController> {
style: TextStyle( style: TextStyle(
color: AppColors.primaryElementText, color: AppColors.primaryElementText,
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontSize: 18.sp, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
......
import 'dart:async'; import 'dart:async';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/apis/apis.dart'; import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/entities.dart'; import 'package:chart/common/entities/entities.dart';
...@@ -8,7 +9,7 @@ import 'package:chart/common/store/store.dart'; ...@@ -8,7 +9,7 @@ import 'package:chart/common/store/store.dart';
import 'package:chart/common/utils/utils.dart'; import 'package:chart/common/utils/utils.dart';
import 'package:chart/common/widgets/widgets.dart'; import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
// import 'package:fluttertoast/fluttertoast.dart'; import 'package:social_login_buttons/social_login_buttons.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../entity/login_entity.dart'; import '../../../entity/login_entity.dart';
...@@ -77,7 +78,7 @@ class SignInController extends GetxController { ...@@ -77,7 +78,7 @@ class SignInController extends GetxController {
}); });
if (res?.token != null) { if (res?.token != null) {
UserStore.to.handleLogin(res); // UserStore.to.handleLogin(res);
EasyLoading.showSuccess("登录成功!"); EasyLoading.showSuccess("登录成功!");
// Navigator.of(context).pushNamed('/'); // Navigator.of(context).pushNamed('/');
} else { } else {
...@@ -207,6 +208,42 @@ class SignInController extends GetxController { ...@@ -207,6 +208,42 @@ class SignInController extends GetxController {
} }
} }
signInWithApple() async {
Vibrate.feedback(FeedbackType.selection);
try {
final credential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
EasyLoading.show(status: "登录中...");
LoginEntity res = await UserAPI.appLogin({
"authorizationCode": credential?.authorizationCode,
"email": credential?.email,
"familyName": credential?.familyName,
"givenName": credential?.givenName,
"hashCode": credential?.hashCode,
"identityToken": credential?.identityToken,
"userIdentifier": credential?.userIdentifier
});
Vibrate.feedback(FeedbackType.success);
EasyLoading.showSuccess("登录成功");
EasyLoading.dismiss();
UserStore.to.handleLogin(
IntegralEntity(id: res.id, username: res.username, token: res.token));
// appLogin
} catch (e) {
Vibrate.feedback(FeedbackType.error);
EasyLoading.showError("登录失败");
EasyLoading.dismiss();
}
;
}
@override @override
void onReady() { void onReady() {
super.onReady(); super.onReady();
......
import 'package:chart/common/routers/routes.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart'; import 'package:chart/common/widgets/widgets.dart';
...@@ -5,6 +7,7 @@ import 'package:flutter/services.dart'; ...@@ -5,6 +7,7 @@ import 'package:flutter/services.dart';
// import 'package:flutter_icons/flutter_icons.dart'; // import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:social_login_buttons/social_login_buttons.dart';
import 'index.dart'; import 'index.dart';
...@@ -12,70 +15,79 @@ class SignInPage extends GetView<SignInController> { ...@@ -12,70 +15,79 @@ class SignInPage extends GetView<SignInController> {
// logo // logo
Widget _buildLogo() { Widget _buildLogo() {
return Container( return Container(
width: 110.w, // width: 110.w,
margin: EdgeInsets.only(top: (40 + 44.0).h), // 顶部系统栏 44px // color: Colors.amber,
// margin:
// EdgeInsets.only(top: Get.mediaQuery.size.height * 0.35), // 顶部系统栏 44px
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Container( Container(
height: 76.w, height: 76,
width: 76.w, width: 76,
margin: EdgeInsets.symmetric(horizontal: 15.w), margin: EdgeInsets.symmetric(horizontal: 15.w),
child: Stack(
alignment: Alignment.center, child: Image.asset("assets/images/logo.png",
children: [ fit: BoxFit.fitHeight, width: 30, height: 30),
Positioned(
left: 0, // child: Stack(
top: 0, // alignment: Alignment.center,
right: 0, // children: [
child: Container( // Container(
height: 76.w, // width: 76,
decoration: BoxDecoration( // height: 76,
color: AppColors.primaryBackground, // // width: 76.w,
boxShadow: [ // // height: 76.w,
Shadows.primaryShadow, // decoration: BoxDecoration(
], // color: AppColors.primaryBackground,
borderRadius: BorderRadius.all( // boxShadow: [
Radius.circular((76 * 0.5).w)), // 父容器的50% // Shadows.primaryShadow,
), // ],
child: Container(), // borderRadius: BorderRadius.all(
), // Radius.circular((76 * 0.5))), // 父容器的50%
), // ),
Positioned( // child: Image.asset("assets/images/logo.png",
top: 13.w, // fit: BoxFit.fitHeight, width: 30, height: 30),
child: Image.asset( // )
"assets/images/logo.png", // // Positioned(
fit: BoxFit.none, // // left: 0,
), // // top: 0,
), // // right: 0,
], // // child:,
), // // ),
// // Positioned(
// // top: 13.w,
// // child:
// // ),
// ],
// ),
), ),
Container( Container(
// width: 600,
margin: EdgeInsets.only(top: 15.h), margin: EdgeInsets.only(top: 15.h),
child: Text( child: Text(
"AI助理", "AI写作大师",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: AppColors.primaryText, color: AppColors.primaryBackground,
fontFamily: "Montserrat", fontFamily: "Montserrat",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 24.sp, fontSize: 24,
height: 1, height: 1,
), ),
), ),
), ),
Text( // Text(
"AI助理", // "AI助理",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
color: AppColors.primaryText, // color: AppColors.primaryText,
fontFamily: "Avenir", // fontFamily: "Avenir",
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
fontSize: 16.sp, // fontSize: 16.sp,
height: 1, // height: 1,
), // ),
), // ),
], ],
), ),
); );
...@@ -148,16 +160,29 @@ class SignInPage extends GetView<SignInController> { ...@@ -148,16 +160,29 @@ class SignInPage extends GetView<SignInController> {
// ), // ),
// onPressed: controller.clearField))))), // onPressed: controller.clearField))))),
// SocialLoginButton(
// backgroundColor: Colors.amber,
// height: 50,
// text: 'SignIn',
// borderRadius: 20,
// fontSize: 25,
// buttonType: SocialLoginButtonType.generalLogin,
// imageWidth: 20,
// // imagepath: "assets/file.png",
// imageURL: "URL",
// onPressed: () {},
// ),
// 注册、登录 横向布局 // 注册、登录 横向布局
Container( // Container(
height: 44.h, // height: 44.h,
margin: EdgeInsets.only(top: 15.h), // margin: EdgeInsets.only(top: 15.h),
child: btnFlatButtonWidget( // child: btnFlatButtonWidget(
onPressed: controller.handleSignIn, // onPressed: controller.signInWithApple,
gbColor: AppColors.primaryElement, // // controller.handleSignIn,
title: "登录", // gbColor: AppColors.primaryElement,
), // title: "登录",
), // ),
// ),
// Spacer(), // Spacer(),
// Fogot password // Fogot password
...@@ -206,11 +231,11 @@ class SignInPage extends GetView<SignInController> { ...@@ -206,11 +231,11 @@ class SignInPage extends GetView<SignInController> {
padding: EdgeInsets.only(top: 20.h), padding: EdgeInsets.only(top: 20.h),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
btnFlatButtonBorderOnlyWidget( // btnFlatButtonBorderOnlyWidget(
onPressed: () {}, // onPressed: controller.signInWithApple,
width: 88, // width: 88,
iconFileName: "twitter", // iconFileName: "apple",
), // ),
Spacer(), Spacer(),
btnFlatButtonBorderOnlyWidget( btnFlatButtonBorderOnlyWidget(
onPressed: () {}, onPressed: () {},
...@@ -250,18 +275,125 @@ class SignInPage extends GetView<SignInController> { ...@@ -250,18 +275,125 @@ class SignInPage extends GetView<SignInController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Center( body: Container(
child: Column( width: double.infinity,
children: <Widget>[ height: double.infinity,
_buildLogo(), // ignore: sort_child_properties_last
_buildInputForm(), child: Column(
Spacer(), children: [
_buildThirdPartyLogin(), Expanded(
// _buildSignupButton(), child: Column(
], mainAxisAlignment: MainAxisAlignment.end,
), children: [
), _buildLogo(),
); ],
)),
Expanded(
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 90),
child: SocialLoginButton(
text: "通过 Apple 登录",
buttonType: SocialLoginButtonType.apple,
onPressed: () {
Get.bottomSheet(
Container(
padding: EdgeInsets.all(14),
decoration: BoxDecoration(
// topLeft: Radius.circular(30), topRight: Radius.circular(30)))
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15)),
color: Colors.white,
),
height: 230,
child: Column(children: [
Text(
"请阅读并同意以下条款",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 20),
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: [
TextSpan(
text: '《用户协议》',
recognizer: TapGestureRecognizer()
..onTap = () {
Get.toNamed(
AppRoutes.USER_PRIVACT);
},
style: TextStyle(
fontWeight: FontWeight.bold,
color:
AppColors.primaryElement)),
TextSpan(
text: '《隐私权限》',
recognizer: TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes.PRIVACT);
},
style: TextStyle(
fontWeight: FontWeight.bold,
color:
AppColors.primaryElement)),
],
),
),
),
btnFlatButtonWidget(
onPressed: () {
Get.back();
controller.signInWithApple();
},
width: 294,
gbColor: AppColors.primaryElement,
fontColor: AppColors.primaryBackground,
title: "同意并继续",
fontWeight: FontWeight.w500,
fontSize: 16,
)
// Text(
// "请阅读并同意以下条款",
// style: TextStyle(
// fontSize: 16,
// color: Colors.blue[900],
// fontWeight: FontWeight.bold),
// ),
]),
),
// backgroundColor: Colors.white,
);
// controller.signInWithApple
},
),
),
),
)
],
),
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
))
// child: Column(
// children: <Widget>[
// _buildLogo(),
// _buildInputForm(),
// Spacer(),
// _buildThirdPartyLogin(),
// // _buildSignupButton(),
// ],
// ),
);
} }
} }
...@@ -48,13 +48,13 @@ class MainController extends GetxController { ...@@ -48,13 +48,13 @@ class MainController extends GetxController {
} }
asyncLoadBannerData() async { asyncLoadBannerData() async {
final token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY); // final token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
// await UserStore.to.setToken(''); // await UserStore.to.setToken('');
// (res.token); // (res.token);
if (token.isEmpty) { // if (token.isEmpty) {
IntegralEntity userInfo = await UserAPI.getUserIntegral(); // IntegralEntity userInfo = await UserAPI.getUserIntegral();
await UserStore.to.getUserInfo(userInfo); // await UserStore.to.getUserInfo(userInfo);
} // }
List<MessageEntity>? list = await NewsAPI.bannerList(); List<MessageEntity>? list = await NewsAPI.bannerList();
......
...@@ -29,8 +29,8 @@ class AdWidget extends GetView<MainController> { ...@@ -29,8 +29,8 @@ class AdWidget extends GetView<MainController> {
color: AppColors.primaryText, color: AppColors.primaryText,
fontFamily: "Avenir", fontFamily: "Avenir",
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 18.sp, fontSize: 18,
height: 18.sp / 18, height: 18 / 18,
), ),
), ),
], ],
......
...@@ -3,6 +3,7 @@ import 'package:chart/entity/plan_entity.dart'; ...@@ -3,6 +3,7 @@ import 'package:chart/entity/plan_entity.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:card_swiper/card_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
import '../index.dart'; import '../index.dart';
...@@ -37,153 +38,168 @@ class BannerPageWidget extends GetView<MainController> { ...@@ -37,153 +38,168 @@ class BannerPageWidget extends GetView<MainController> {
itemCount: controller.state.bannerPage!.length, itemCount: controller.state.bannerPage!.length,
itemBuilder: (_, index) { itemBuilder: (_, index) {
return InkWell( return InkWell(
onTap: () => { onTap: () {
Vibrate.feedback(FeedbackType.impact);
controller.handleToTemplate( controller.handleToTemplate(
controller.state.bannerPage![index].id) controller.state.bannerPage![index].id);
}, },
child: Container( child: Container(
width: double.infinity,
// color: Colors.red,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
margin: margin:
EdgeInsets.symmetric(horizontal: 10, vertical: 4), EdgeInsets.symmetric(horizontal: 10, vertical: 4),
child: GlassmorphicContainer( child: GlassmorphicContainer(
borderRadius: 16, borderRadius: 16,
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16),
blur: 14, blur: 14,
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
border: 2, border: 2,
linearGradient: LinearGradient( linearGradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFF0FFFF).withOpacity(0.2), Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2), Color(0xFF0FFFF).withOpacity(0.2),
], ],
), ),
borderGradient: LinearGradient( borderGradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFF0FFFF).withOpacity(1), Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF), Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1), Color(0xFF0FFFF).withOpacity(1),
], ],
), ),
height: 270, height: 270,
width: double.infinity, width: double.infinity,
child: Column( child: Center(
children: [ child: Column(
Row(
children: [ children: [
Expanded( Row(
// width: double.infinity, children: [
// height: 400, Expanded(
child: Stack( // width: double.infinity,
children: [ // height: 400,
Container( child: Stack(
width: 300,
height: 130,
padding: EdgeInsets.only(top: 16),
child: Image.network(
'${controller.state.bannerPage![index].icon}',
fit: BoxFit.contain,
width: double.infinity,
// height: double.infinity,
),
// controller.state.bannerPage![index]
// .classifyDesc,
// Image.asset(
// doctorsList[index].image,
// fit: BoxFit.contain,
// width: double.infinity,
// height: double.infinity,
// ),
),
],
),
),
// SizedBox(width: 40)
],
),
Container(
// ignore: prefer_const_constructors
decoration: BoxDecoration(
// circular(24)
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(16),
bottomRight: Radius.circular(16),
),
// color: Colors.white,
),
//
// color: Colors.white,
height: 132,
child: Padding(
padding: EdgeInsets.symmetric(
vertical: 20, horizontal: 20),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
controller.state.bannerPage![index]
.classifyName,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 24),
),
SizedBox(height: 5),
Text(
controller.state.bannerPage![index]
.classifyDesc,
style: TextStyle(
color: Colors.white,
fontSize: 16),
),
SizedBox(height: 5),
Row(
children: [ children: [
RatingBar.builder( Container(
unratedColor: Colors.grey width: 300,
.withOpacity(0.5), height: 130,
itemSize: 15, padding:
initialRating: EdgeInsets.only(top: 16),
doctorsList[index] child: Image.network(
.reviewScore '${controller.state.bannerPage![index].icon}',
.toDouble(), fit: BoxFit.contain,
minRating: 0, width: double.infinity,
allowHalfRating: true, // height: double.infinity,
direction: Axis.horizontal,
itemPadding:
EdgeInsets.symmetric(
horizontal: 5),
itemCount: 5,
updateOnDrag: false,
itemBuilder: (context, _) =>
Icon(
Icons.star,
color: Colors.orange,
), ),
onRatingUpdate: (value) {}, // controller.state.bannerPage![index]
// .classifyDesc,
// Image.asset(
// doctorsList[index].image,
// fit: BoxFit.contain,
// width: double.infinity,
// height: double.infinity,
// ),
), ),
SizedBox(width: 1),
Text(
"(103个用户使用过)",
style: TextStyle(
color: Colors.white,
fontSize: 12),
)
], ],
), ),
], ),
),
)), // SizedBox(width: 40)
], ],
), ),
), Container(
// ignore: prefer_const_constructors
decoration: BoxDecoration(
// circular(24)
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(16),
bottomRight: Radius.circular(16),
),
// color: Colors.white,
),
//
// color: Colors.white,
height: 132,
child: Padding(
padding: EdgeInsets.symmetric(
vertical: 20, horizontal: 20),
child: Center(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
controller
.state
.bannerPage![index]
.classifyName,
style: TextStyle(
fontWeight:
FontWeight.bold,
color: Colors.white,
fontSize: 24),
),
SizedBox(height: 5),
Text(
controller
.state
.bannerPage![index]
.classifyDesc,
style: TextStyle(
color: Colors.white,
fontSize: 16),
),
SizedBox(height: 5),
Row(
children: [
RatingBar.builder(
unratedColor: Colors
.grey
.withOpacity(0.5),
itemSize: 15,
initialRating:
doctorsList[index]
.reviewScore
.toDouble(),
minRating: 0,
allowHalfRating: true,
direction:
Axis.horizontal,
itemPadding: EdgeInsets
.symmetric(
horizontal: 5),
itemCount: 5,
updateOnDrag: false,
itemBuilder:
(context, _) =>
Icon(
Icons.star,
color: Colors.orange,
),
onRatingUpdate:
(value) {},
),
SizedBox(width: 1),
Text(
"(103个用户使用过)",
style: TextStyle(
color: Colors.white,
fontSize: 12),
)
],
),
],
),
))),
],
),
)),
), ),
); );
// return controller.state.bannerPage![index % pages.length]; // return controller.state.bannerPage![index % pages.length];
......
...@@ -2,6 +2,7 @@ import 'package:chart/common/routers/routes.dart'; ...@@ -2,6 +2,7 @@ import 'package:chart/common/routers/routes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../common/store/user.dart'; import '../../../common/store/user.dart';
...@@ -31,14 +32,23 @@ class NewsCategoriesWidget extends GetView<MainController> { ...@@ -31,14 +32,23 @@ class NewsCategoriesWidget extends GetView<MainController> {
// ignore: prefer_const_literals_to_create_immutables // ignore: prefer_const_literals_to_create_immutables
children: [ children: [
// ignore: prefer_const_constructors // ignore: prefer_const_constructors
Obx(() => Text( Obx(
() => Container(
width: 200,
child: Text(
"Hi, ${userC.profile.username}", "Hi, ${userC.profile.username}",
maxLines: 1,
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
softWrap: true,
// ignore: prefer_const_constructors // ignore: prefer_const_constructors
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 20.sp), fontSize: 20),
)), ),
),
),
SizedBox(height: 30), SizedBox(height: 30),
// ignore: prefer_const_constructors // ignore: prefer_const_constructors
Text( Text(
...@@ -50,9 +60,10 @@ class NewsCategoriesWidget extends GetView<MainController> { ...@@ -50,9 +60,10 @@ class NewsCategoriesWidget extends GetView<MainController> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Get.toNamed(AppRoutes.SIGN_IN); // Get.toNamed(AppRoutes.SIGN_IN);
// AppRoutes.SIGN_IN // AppRoutes.SIGN_IN
// Get.toNamed(AppRoutes.PAY_LIST); Vibrate.feedback(FeedbackType.impact);
Get.toNamed(AppRoutes.PAY_LIST);
}, },
// {Navigator.of(context).pushNamed('/pay')}, // {Navigator.of(context).pushNamed('/pay')},
child: Container( child: Container(
...@@ -92,7 +103,7 @@ class NewsCategoriesWidget extends GetView<MainController> { ...@@ -92,7 +103,7 @@ class NewsCategoriesWidget extends GetView<MainController> {
// color: controller.state.selCategoryCode == item.code // color: controller.state.selCategoryCode == item.code
// ? AppColors.secondaryElementText // ? AppColors.secondaryElementText
// : AppColors.primaryText, // : AppColors.primaryText,
// fontSize: 18.sp, // fontSize: 18,
// fontFamily: 'Montserrat', // fontFamily: 'Montserrat',
// fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
// ), // ),
......
...@@ -29,7 +29,7 @@ class NewsCategoriesWidget extends GetView<MainController> { ...@@ -29,7 +29,7 @@ class NewsCategoriesWidget extends GetView<MainController> {
color: controller.state.selCategoryCode == item.code color: controller.state.selCategoryCode == item.code
? AppColors.secondaryElementText ? AppColors.secondaryElementText
: AppColors.primaryText, : AppColors.primaryText,
fontSize: 18.sp, fontSize: 18,
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
......
...@@ -5,6 +5,7 @@ import 'package:chart/pages/frame/product/view.dart'; ...@@ -5,6 +5,7 @@ import 'package:chart/pages/frame/product/view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:card_swiper/card_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
import '../../../common/values/values.dart'; import '../../../common/values/values.dart';
...@@ -37,176 +38,34 @@ class ListPageWidget extends GetView<MainController> { ...@@ -37,176 +38,34 @@ class ListPageWidget extends GetView<MainController> {
children: List.generate( children: List.generate(
controller.state.bannerPageDetail!.length, controller.state.bannerPageDetail!.length,
(index) => InkWell( (index) => InkWell(
onTap: () => { onTap: () {
Get.defaultDialog( Vibrate.feedback(FeedbackType.impact);
// rgba(250, 237, 212, 1.00) var firstLabel = controller.state.bannerPageDetail![index]
backgroundColor: Color.fromRGBO(250, 237, 212, 1), .detailParamsEntityList[0].label;
// onConfirm: () => print("Ok"), var firstValue = controller.state.bannerPageDetail![index]
title: "", .detailParamsEntityList[0].placeHolder;
content: Container( var lastLabel = controller.state.bannerPageDetail![index]
padding: EdgeInsets.symmetric( .detailParamsEntityList[1].label;
horizontal: 20.0, vertical: 0.0), var lastValue = controller.state.bannerPageDetail![index]
// rgba(250, 237, 212, 1.00) .detailParamsEntityList[1].placeHolder;
// rgba(250, 237, 212, 1.00) var title =
// color: Color.fromARGB(255, 201, 63, 1), controller.state.bannerPageDetail![index].detailName;
width: MediaQuery.of(context).size.width * .8,
height: MediaQuery.of(context).size.height * .5,
child: Column(
// textDirection: TextDirection.ltr,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
// "商品评论",
"${controller.state.bannerPageDetail![index].detailName}",
textAlign: TextAlign.left,
style: TextStyle(
color: AppColor.primaryText,
fontSize: 18,
height: 1.5,
fontWeight: FontWeight.bold),
),
Text(
"您可以告诉我您想写的内容,例如:",
textAlign: TextAlign.left,
style: TextStyle(
color: AppColor.primaryText,
fontSize: 14,
height: 2.5,
fontWeight: FontWeight.w400),
),
// rgba(119, 119, 119, 1.00)
Text(
// "主题:取暖器",
"${controller.state.bannerPageDetail![index].detailParamsEntityList[0].label}:" +
"${controller.state.bannerPageDetail![index].detailParamsEntityList[0].placeHolder}",
textAlign: TextAlign.left,
style: TextStyle(
height: 1.5,
color: Color.fromRGBO(119, 119, 119, 1),
fontSize: 12,
// fontWeight: FontWeight.bold
),
),
Text(
"${controller.state.bannerPageDetail![index].detailParamsEntityList[1].label}:" +
"${controller.state.bannerPageDetail![index].detailParamsEntityList[1].placeHolder}",
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(119, 119, 119, 1),
fontSize: 12,
// fontWeight: FontWeight.bold
),
),
Text(
"根据上面輸入,即刻力您生成以下文字:",
textAlign: TextAlign.left,
style: TextStyle(
color: AppColor.primaryText,
fontSize: 14,
height: 2.5,
fontWeight: FontWeight.w400),
),
Expanded(
child: Text(
"这是一篇对于取暖器的商品评论 这款取暖器真的很不错,价格很便宜,而且耗电量也很低,热量分布也很均匀,让我在寒冷的冬季里感受到温暖。总之,这款取暖器的性价比非常高,是一款很值得推荐的商品。",
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(119, 119, 119, 1),
fontSize: 12,
// fontWeight: FontWeight.bold
),
),
),
TextButton(
style: ButtonStyle(
minimumSize: MaterialStateProperty.all(Size(
MediaQuery.of(context).size.width, 40)),
textStyle:
MaterialStateProperty.all(TextStyle(
fontSize: 16.sp,
)),
foregroundColor:
MaterialStateProperty.resolveWith(
(states) {
if (states.contains(
MaterialState.focused) &&
!states.contains(
MaterialState.pressed)) {
return Colors.blue;
} else if (states
.contains(MaterialState.pressed)) {
return Colors.deepPurple;
}
return AppColors.primaryElementText;
},
),
backgroundColor:
MaterialStateProperty.resolveWith(
(states) {
if (states
.contains(MaterialState.pressed)) {
return Colors.blue[200];
}
return AppColors.primaryElement;
}),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: Radii.k6pxRadius,
)),
// with: double.infinity,
),
child: Text("使用模版"),
onPressed: () async {
// await Get.put(ProductController());
// final a = ;
var firstLabel = controller
.state
.bannerPageDetail![index]
.detailParamsEntityList[0]
.label;
var firstValue = controller
.state
.bannerPageDetail![index]
.detailParamsEntityList[0]
.placeHolder;
var lastLabel = controller
.state
.bannerPageDetail![index]
.detailParamsEntityList[1]
.label;
var lastValue = controller
.state
.bannerPageDetail![index]
.detailParamsEntityList[1]
.placeHolder;
var title = controller.state
.bannerPageDetail![index].detailName;
var detailId = var detailId =
'${controller.state.bannerPageDetail![index].id}'; '${controller.state.bannerPageDetail![index].id}';
Get.toNamed(AppRoutes.PRODUCT_PAGE, Get.toNamed(AppRoutes.PRODUCT_PAGE, parameters: {
parameters: { "title": title,
"title": title, "firstValue": firstValue,
"firstValue": firstValue, "firstLabel": firstLabel,
"firstLabel": firstLabel, "lastValue": lastValue,
"lastValue": lastValue, "lastLabel": lastLabel,
"lastLabel": lastLabel, "detailId": detailId
"detailId": detailId });
}); Future.delayed(Duration(milliseconds: 100), () {
Future.delayed(Duration(milliseconds: 100), // print("延时1秒执行");
() { c.showModal();
// print("延时1秒执行"); });
c.showModal();
});
// "${controller.state.bannerPageDetail![index].detailParamsEntityList[1]['label']}:" +
// "${controller.state.bannerPageDetail![index].detailParamsEntityList[1]['placeHolder']}",
},
)
]),
),
middleText: "")
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
......
...@@ -22,7 +22,7 @@ class NewsletterWidget extends GetView<MainController> { ...@@ -22,7 +22,7 @@ class NewsletterWidget extends GetView<MainController> {
'Newsletter', 'Newsletter',
style: TextStyle( style: TextStyle(
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontSize: 18.sp, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.thirdElement, color: AppColors.thirdElement,
), ),
......
...@@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart'; import 'package:flutter_chat_types/flutter_chat_types.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:card_swiper/card_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
import '../index.dart'; import '../index.dart';
...@@ -29,7 +30,7 @@ class SiperBannerWidget extends GetView<MainController> { ...@@ -29,7 +30,7 @@ class SiperBannerWidget extends GetView<MainController> {
return Obx(() => controller.state.bannerList == null return Obx(() => controller.state.bannerList == null
? Container() ? Container()
: Container( : Container(
height: 230.h, height: 230,
child: Swiper( child: Swiper(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
autoplay: true, autoplay: true,
...@@ -37,12 +38,16 @@ class SiperBannerWidget extends GetView<MainController> { ...@@ -37,12 +38,16 @@ class SiperBannerWidget extends GetView<MainController> {
pagination: SwiperPagination(), pagination: SwiperPagination(),
control: null, control: null,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Center(
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.circular(16.r), decoration: BoxDecoration(
color: Colors.black.withAlpha(0), borderRadius: BorderRadius.circular(16.r),
color: Colors.black.withAlpha(0),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: _renderList(index)),
), ),
child: Column(children: _renderList(index)),
); );
}, },
), ),
...@@ -52,9 +57,9 @@ class SiperBannerWidget extends GetView<MainController> { ...@@ -52,9 +57,9 @@ class SiperBannerWidget extends GetView<MainController> {
Widget _generateWidget(MessageEntity message, int idx, int index) { Widget _generateWidget(MessageEntity message, int idx, int index) {
final c = Get.put(ChatNewController()); final c = Get.put(ChatNewController());
return Container( return Container(
height: 70.0, // height: 90.0,
width: double.infinity, width: double.infinity,
margin: idx == 1 ? const EdgeInsets.symmetric(vertical: 10.0) : null, // margin: idx == 1 ? const EdgeInsets.symmetric(vertical: 10.0) : null,
constraints: const BoxConstraints(minWidth: 41), constraints: const BoxConstraints(minWidth: 41),
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Colors.white, // color: Colors.white,
...@@ -100,6 +105,7 @@ class SiperBannerWidget extends GetView<MainController> { ...@@ -100,6 +105,7 @@ class SiperBannerWidget extends GetView<MainController> {
}, },
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Vibrate.feedback(FeedbackType.impact);
// message.question // message.question
Chat.ChatUser _user = Chat.ChatUser( Chat.ChatUser _user = Chat.ChatUser(
id: '1', id: '1',
......
import 'package:get/get.dart';
import 'controller.dart';
class PrivacyBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<PrivacyController>(() => PrivacyController());
}
}
import 'package:get/get.dart';
import 'index.dart';
class PrivacyController extends GetxController {
PrivacyController();
final state = PrivacyState();
// tap
void handleTap(int index) {
Get.snackbar(
"标题",
"消息",
);
}
/// 在 widget 内存中分配后立即调用。
@override
void onInit() {
super.onInit();
}
/// 在 onInit() 之后调用 1 帧。这是进入的理想场所
@override
void onReady() {
super.onReady();
}
/// 在 [onDelete] 方法之前调用。
@override
void onClose() {
super.onClose();
}
/// dispose 释放内存
@override
void dispose() {
super.dispose();
}
}
library privacy;
export './state.dart';
export './controller.dart';
export './bindings.dart';
export './view.dart';
import 'package:get/get.dart';
class PrivacyState {
final _title = """
我们重视您的隐私权,并承诺在使用您的个人信息时遵守相关法律法规。本隐私协议旨在向您说明我们在使用您的个人信息时如何保护您的隐私。
1.信息收集
我们会收集您在使用本 app 时提供给我们的个人信息,例如:
●注册账户时提供的个人信息,包括但不限于您的姓名、电子邮箱地址、手机号码等;
●使用本 app 时提供的信息,包括但不限于您与 AI 服务器进行交流时提供的问题和回答等;
●在使用本 app 时,我们可能会使用 cookie 和其他技术来自动收集一些信息,例如您的设备信息、浏览器信息、IP 地址、访问时间、访问页面等。
2.信息使用
我们会将您的个人信息用于以下目的:
●向您提供本 app 的服务,并持续改进和优化本 app 的功能;
●向您提供有关本 app 的信息,包括但不限于本 app 的更新、服务、活动、推广等;
●进行内部审计、数据分析和研究,以改进我们的产品、服务和提升用户体验;
●依法律法规要求或与相关政府机构合作,遵守法律法规的要求。
●使用第三方服务进行内容安全审查。
3.信息共享
我们不会向第三方共享您的个人信息,但以下情况除外:
●在获得您的明确同意后;
●根据法律法规的要求,我们需要披露您的个人信息;
●为了保护我们的合法权益,我们可能需要披露您的个人信息;
●为了保护您或其他用户的人身、财产安全,我们可能需要披露您的个人信息。
●使用第三方服务进行内容安全审查
●如果您申请了退款,我们会将您的付费计划使用情况发送给Apple团队
4.信息保护
我们采取合理的安全措施来保护您的个人信息,但不对因不可抗力或非因我们的原因导致的信息泄露承担责任。
5.特别说明
目前,您发送给AI的信息除了被AI服务器处理之外,依据国家法律法规,还会使用第三方服务进行内容安全审查,例如腾讯内容安全审查接口。除此之外,我们会严格保护您的信息安全 。
特别注意的是,请保护好您的隐私,不要发送有关账号密码、身份信息等个人隐私数据,亦不要发送违反法律法规、社会道德的内容。
6.其他
本隐私协议自您接受之日起生效,对我们和用户均具有约束力。
如果我们对本隐私协议作出任何变更,我们会在本 app 上公布变更后的协议。如果您继续使用本 app,即表示您同意受变更后的协议的约束。如果您不同意变更后的协议,应当立即停止使用本 app。
本隐私协议未尽事宜,您需遵守我们不时发布的其他服务条款和操作规则。
Privacy Agreement
We value your privacy and promise to abide by relevant laws and regulations when using your personal information. This Privacy Policy is intended to explain to you how we protect your privacy when using your personal information.
1. Information Collection
We collect personal information that you provide to us when using the app, such as:
●Personal information provided when registering an account, including but not limited to your name, email address, mobile phone number, etc.;
●Information provided when using this app, including but not limited to questions and answers you provide when communicating with the AI server;
●When using this app, we may use cookies and other technologies to automatically collect some information, such as your device information, browser information, IP address, access time, visited pages, etc.
2. Use of information
We will use your personal information for the following purposes:
●Provide you with the services of this app, and continuously improve and optimize the functions of this app;
●Provide you with information about this app, including but not limited to updates, services, events, promotions, etc. of this app;
● Conduct internal audits, data analysis and research to improve our products, services and user experience;
●Abiding by the requirements of laws and regulations or cooperating with relevant government agencies to comply with the requirements of laws and regulations.
● Use third-party services for content security review.
3. Information sharing
We will not share your personal information with third parties, except in the following circumstances:
●After obtaining your explicit consent;
● According to the requirements of laws and regulations, we need to disclose your personal information;
●In order to protect our legitimate rights and interests, we may need to disclose your personal information;
●In order to protect the personal and property safety of you or other users, we may need to disclose your personal information.
●Content security review using third-party services
●If you have requested a refund, we will send your paid plan usage to the Apple team
4. Information protection
We take reasonable security measures to protect your personal information, but we are not responsible for any information leakage caused by force majeure or not caused by us.
5. Special instructions
At present, in addition to being processed by the AI server, the information you send to AI will also use third-party services for content security review in accordance with national laws and regulations, such as the Tencent content security review interface. In addition, we will strictly protect your information security.
In particular, please protect your privacy, do not send personal privacy data such as account passwords, identity information, and do not send content that violates laws, regulations, or social ethics.
6. Other
This Privacy Agreement becomes effective on the date of your acceptance and is binding on us and users.
If we make any changes to this privacy agreement, we will post the changed agreement on this app. Your continued use of the app constitutes your agreement to be bound by the changed agreement. If you do not agree to the changed agreement, you should stop using this app immediately.
For matters not covered in this Privacy Agreement, you shall abide by other terms of service and operating rules that we publish from time to time.
"""
.obs;
set title(value) => _title.value = value;
get title => _title.value;
}
import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class PrivacyPage extends GetView<PrivacyController> {
const PrivacyPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return GlassmorphicContainer(
height: double.infinity,
width: double.infinity,
// flex: 1,
borderRadius: 16,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
child: const HelloWidget(),
// margin: EdgeInsets.only(bottom: 16.h),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
));
}
@override
Widget build(BuildContext context) {
return GetBuilder<PrivacyController>(
builder: (_) {
return Scaffold(
appBar: transparentAppBar(
leading: IconButton(
tooltip: '返回上一页',
icon: const Icon(
Icons.arrow_back,
color: AppColors.primaryElementText,
),
onPressed: () async {
// Get.back();
// Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application);
Get.back();
// await Get.toNamed();
// Navigator.of(context).pop();
//_nextPage(-1);
},
),
title: const Text(
"隐私协议",
style: TextStyle(color: Colors.white),
)),
body: Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover),
),
child: _buildView(),
),
);
},
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../index.dart';
/// hello
class HelloWidget extends GetView<PrivacyController> {
const HelloWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Obx(() => ListView(
padding: EdgeInsets.all(16),
children: [
Text(
controller.state.title,
style: TextStyle(
fontFamily: 'Montserrat',
fontSize: 18,
color: Colors.white),
)
],
)),
);
}
}
library widgets;
export './hello.dart';
...@@ -2,8 +2,6 @@ import 'package:chart/common/values/values.dart'; ...@@ -2,8 +2,6 @@ import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart'; import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_connect/sockets/src/socket_notifier.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'index.dart'; import 'index.dart';
import 'widgets/widgets.dart'; import 'widgets/widgets.dart';
......
...@@ -44,7 +44,9 @@ class HelloWidget extends GetView<TemplateController> { ...@@ -44,7 +44,9 @@ class HelloWidget extends GetView<TemplateController> {
// width: 100, // width: 100,
// height: 100, // height: 100,
// color: Colors.amber, // color: Colors.amber,
child: GlassmorphicFlexContainer( child: GlassmorphicContainer(
height: 120,
width: 120,
borderRadius: 16, borderRadius: 16,
// ignore: sort_child_properties_last // ignore: sort_child_properties_last
child: InkWell( child: InkWell(
...@@ -72,7 +74,8 @@ class HelloWidget extends GetView<TemplateController> { ...@@ -72,7 +74,8 @@ class HelloWidget extends GetView<TemplateController> {
"firstValue": firstValue, "firstValue": firstValue,
"firstLabel": firstLabel, "firstLabel": firstLabel,
"lastValue": lastValue, "lastValue": lastValue,
"lastLabel": lastLabel "lastLabel": lastLabel,
"detailId": "${act.id}"
}); });
Future.delayed(Duration(milliseconds: 100), Future.delayed(Duration(milliseconds: 100),
() { () {
......
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/user.dart'; import 'package:chart/common/store/user.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
...@@ -23,7 +24,7 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -23,7 +24,7 @@ class UserDetailPage extends GetView<UserDetailController> {
child: ListView( child: ListView(
children: [ children: [
GlassmorphicContainer( GlassmorphicContainer(
height: 220, height: 140,
width: double.infinity, width: double.infinity,
// flex: 1, // flex: 1,
borderRadius: 16, borderRadius: 16,
...@@ -50,221 +51,249 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -50,221 +51,249 @@ class UserDetailPage extends GetView<UserDetailController> {
], ],
), ),
child: Column(children: [ child: Column(children: [
Row(children: [ Row(
// ignore: prefer_const_constructors children: [
Container( // ignore: prefer_const_constructors
width: 100, Container(
height: 100, width: 100,
margin: EdgeInsets.all(20), height: 100,
// color: Colors.black, margin: EdgeInsets.all(20),
padding: EdgeInsets.all(0), // color: Colors.black,
decoration: BoxDecoration( padding: EdgeInsets.all(0),
border: decoration: BoxDecoration(
new Border.all(color: Color(0xFFFFFFFF), width: 3), border: new Border.all(
borderRadius: BorderRadius.circular(60), color: Color(0xFFFFFFFF), width: 3),
), borderRadius: BorderRadius.circular(60),
),
child: const CircleAvatar( child: const CircleAvatar(
radius: 60, radius: 60,
//头像图片 -> NetworkImage网络图片,AssetImage项目资源包图片, FileImage本地存储图片 //头像图片 -> NetworkImage网络图片,AssetImage项目资源包图片, FileImage本地存储图片
backgroundImage: NetworkImage( backgroundImage: NetworkImage(
'https://pic2.zhimg.com/v2-639b49f2f6578eabddc458b84eb3c6a1.jpg'), 'https://pic2.zhimg.com/v2-639b49f2f6578eabddc458b84eb3c6a1.jpg'),
),
), ),
), Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Row(
Row( // mainAxisAlignment: MainAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start, // verticalDirection: VerticalDirection.up,
// verticalDirection: VerticalDirection.up, // textBaseline: TextBaseline.alphabetic,
// textBaseline: TextBaseline.alphabetic, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
children: [ Obx(() => Container(
Obx(() => Container( width: 140,
height: 30, height: 30,
// color: Colors.white, // color: Colors.white,
child: Text( child: Text(
'${c.profile.username}', '${c.profile.username}',
style: TextStyle( maxLines: 1,
color: Colors.white, textAlign: TextAlign.left,
fontSize: 16, overflow: TextOverflow.ellipsis,
height: 1.5, softWrap: true,
fontWeight: FontWeight.bold), style: TextStyle(
), color: Colors.white,
margin: EdgeInsets.only(right: 16), fontSize: 16,
)), height: 1.5,
Container( fontWeight: FontWeight.bold),
width: 60, ),
height: 30, margin: EdgeInsets.only(right: 16),
// color: Colors.white, )),
decoration: BoxDecoration( Container(
image: DecorationImage( width: 60,
image: height: 30,
Image.asset("assets/images/vip6.png") // color: Colors.white,
.image, decoration: BoxDecoration(
fit: BoxFit.contain), // image: DecorationImage(
), // image: Image.asset(
) // "assets/images/vip6.png")
]), // .image,
Row(children: [ // fit: BoxFit.contain),
Container( ),
// width: 80, )
height: 25, ]),
padding: EdgeInsets.symmetric( Row(children: [
horizontal: 10, vertical: 4), Container(
margin: EdgeInsets.only(top: 16), // width: 80,
decoration: BoxDecoration( height: 25,
// rgba(233, 234, 244, 1.00) padding: EdgeInsets.symmetric(
color: Color.fromRGBO(255, 255, 255, .2), horizontal: 10, vertical: 4),
borderRadius: BorderRadius.circular(20), margin: EdgeInsets.only(top: 16),
// image: DecorationImage( decoration: BoxDecoration(
// image: Image.asset("assets/images/vip6.png") // rgba(233, 234, 244, 1.00)
// .image, color: Color.fromRGBO(255, 255, 255, .2),
// fit: BoxFit.contain), borderRadius: BorderRadius.circular(20),
), // image: DecorationImage(
child: Row(children: [ // image: Image.asset("assets/images/vip6.png")
Image.asset( // .image,
"assets/images/jifen.png", // fit: BoxFit.contain),
fit: BoxFit.cover,
), ),
Container( child: Row(children: [
margin: EdgeInsets.only(left: 5), Image.asset(
child: Text( "assets/images/jifen.png",
"100", fit: BoxFit.cover,
style: TextStyle(
color: Color.fromRGBO(255, 255, 255, 1)),
), ),
) Container(
]), margin: EdgeInsets.only(left: 5),
), child: Text(
Container( "100",
// width: 80, style: TextStyle(
height: 25, color:
padding: EdgeInsets.symmetric( Color.fromRGBO(255, 255, 255, 1)),
horizontal: 10, vertical: 4), ),
margin: EdgeInsets.only(top: 16, left: 16), )
decoration: BoxDecoration( ]),
// rgba(233, 234, 244, 1.00)
color: Color.fromRGBO(255, 255, 255, .2),
borderRadius: BorderRadius.circular(20),
// image: DecorationImage(
// image: Image.asset("assets/images/vip6.png")
// .image,
// fit: BoxFit.contain),
), ),
child: Row(children: [ Container(
Image.asset( // width: 80,
"assets/images/jifen1.png", height: 25,
fit: BoxFit.cover, padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 4),
margin: EdgeInsets.only(top: 16, left: 16),
decoration: BoxDecoration(
// rgba(233, 234, 244, 1.00)
color: Color.fromRGBO(255, 255, 255, .2),
borderRadius: BorderRadius.circular(20),
// image: DecorationImage(
// image: Image.asset("assets/images/vip6.png")
// .image,
// fit: BoxFit.contain),
), ),
Container( child: Row(children: [
margin: EdgeInsets.only(left: 5), Image.asset(
child: Text( "assets/images/jifen1.png",
"300", fit: BoxFit.cover,
style: TextStyle(
color: Color.fromRGBO(255, 255, 255, 1)),
), ),
) Container(
]), margin: EdgeInsets.only(left: 5),
) child: Text(
]) "300",
],
),
]),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
height: 70,
width: 70,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
"assets/images/jifen1.png",
fit: BoxFit.cover,
width: 40,
height: 40,
),
Text(
"积分",
style: TextStyle( style: TextStyle(
color: Colors.white, color:
// fontWeight: FontWeight.bold, Color.fromRGBO(255, 255, 255, 1)),
fontSize: 14),
),
],
)),
Container(
height: 70,
width: 70,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
"assets/images/shoucang.png",
fit: BoxFit.cover,
width: 40,
height: 40,
), ),
Text( )
"收藏", ]),
style: TextStyle( )
color: Colors.white, ])
// fontWeight: FontWeight.bold, ],
fontSize: 14), ),
), ],
], ),
)),
Container( // Expanded(
height: 70, // child: Container(
width: 70, // width: double.infinity,
child: Column( // margin: EdgeInsets.symmetric(horizontal: 16),
mainAxisAlignment: MainAxisAlignment.center, // decoration: BoxDecoration(
children: [ // // boxShadow: [
Image.asset( // // BoxShadow(
"assets/images/shangcheng.png", // // color: Colors.yellow,
fit: BoxFit.cover, // // blurRadius: 10.0,
width: 40, // // spreadRadius: 10.0),
height: 40, // // ],
), // gradient: new LinearGradient(
Text( // begin: Alignment.bottomCenter,
"商城", // end: Alignment.topCenter,
style: TextStyle( // colors: [
color: Colors.white, // Colors.amber,
// fontWeight: FontWeight.bold, // Colors.yellow,
fontSize: 14), // ]),
), // ),
], // padding: EdgeInsets.symmetric(horizontal: 16),
)), // child: Text("121"),
Container( // // child: Row(
height: 70, // // mainAxisAlignment: MainAxisAlignment.spaceAround,
width: 70, // // children: [
child: Column( // // Container(
mainAxisAlignment: MainAxisAlignment.center, // // height: 70,
children: [ // // width: 70,
Image.asset( // // child: Column(
"assets/images/jilu.png", // // mainAxisAlignment: MainAxisAlignment.center,
fit: BoxFit.cover, // // children: [
width: 40, // // Image.asset(
height: 40, // // "assets/images/jifen1.png",
), // // fit: BoxFit.cover,
Text( // // width: 40,
"记录", // // height: 40,
style: TextStyle( // // ),
color: Colors.white, // // Text(
// fontWeight: FontWeight.bold, // // "积分",
fontSize: 14), // // style: TextStyle(
), // // color: Colors.white,
], // // // fontWeight: FontWeight.bold,
)), // // fontSize: 14),
]), // // ),
// color: Colors.black, // // ],
)) // // )),
// // Container(
// // height: 70,
// // width: 70,
// // child: Column(
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // Image.asset(
// // "assets/images/shoucang.png",
// // fit: BoxFit.cover,
// // width: 40,
// // height: 40,
// // ),
// // Text(
// // "收藏",
// // style: TextStyle(
// // color: Colors.white,
// // // fontWeight: FontWeight.bold,
// // fontSize: 14),
// // ),
// // ],
// // )),
// // Container(
// // height: 70,
// // width: 70,
// // child: Column(
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // Image.asset(
// // "assets/images/shangcheng.png",
// // fit: BoxFit.cover,
// // width: 40,
// // height: 40,
// // ),
// // Text(
// // "商城",
// // style: TextStyle(
// // color: Colors.white,
// // // fontWeight: FontWeight.bold,
// // fontSize: 14),
// // ),
// // ],
// // )),
// // Container(
// // height: 70,
// // width: 70,
// // child: Column(
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: [
// // Image.asset(
// // "assets/images/jilu.png",
// // fit: BoxFit.cover,
// // width: 40,
// // height: 40,
// // ),
// // Text(
// // "记录",
// // style: TextStyle(
// // color: Colors.white,
// // // fontWeight: FontWeight.bold,
// // fontSize: 14),
// // ),
// // ],
// // )),
// // ]),
// // color: Colors.black,
// ),
// ),
// Row( // Row(
// children: [Text("data"), Text("data")], // children: [Text("data"), Text("data")],
// ) // )
...@@ -320,12 +349,14 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -320,12 +349,14 @@ class UserDetailPage extends GetView<UserDetailController> {
child: Container( child: Container(
// color: Colors.white, // color: Colors.white,
child: SettingsItem( child: SettingsItem(
onTap: () {}, onTap: () {
Get.toNamed(AppRoutes.PAY_LIST);
},
icons: Icons.account_balance_wallet_rounded, icons: Icons.account_balance_wallet_rounded,
iconStyle: IconStyle(iconsColor: Colors.white), iconStyle: IconStyle(iconsColor: Colors.white),
titleStyle: TextStyle(color: Colors.white), titleStyle: TextStyle(color: Colors.white),
title: '订单记录', title: '购买套餐',
subtitle: "查询您的消费历史", subtitle: "根据您的需求选择不同的订阅方式",
trailing: Icon( trailing: Icon(
Icons.arrow_forward_ios_rounded, Icons.arrow_forward_ios_rounded,
color: Colors.white, color: Colors.white,
...@@ -363,15 +394,17 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -363,15 +394,17 @@ class UserDetailPage extends GetView<UserDetailController> {
child: Container( child: Container(
// color: Colors.white, // color: Colors.white,
child: SettingsItem( child: SettingsItem(
onTap: () {}, onTap: () {
Get.toNamed(AppRoutes.USER_PRIVACT);
},
icons: Icons.add_alert_outlined, icons: Icons.add_alert_outlined,
iconStyle: IconStyle( iconStyle: IconStyle(
iconsColor: Colors.white, iconsColor: Colors.white,
backgroundColor: Colors.purple, backgroundColor: Colors.purple,
), ),
titleStyle: TextStyle(color: Colors.white), titleStyle: TextStyle(color: Colors.white),
title: '积分记录', title: '用户协议',
subtitle: "查询您的积分使用情况", subtitle: "查看用户协议情况",
trailing: Icon( trailing: Icon(
Icons.arrow_forward_ios_rounded, Icons.arrow_forward_ios_rounded,
color: Colors.white, color: Colors.white,
...@@ -409,7 +442,10 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -409,7 +442,10 @@ class UserDetailPage extends GetView<UserDetailController> {
child: Container( child: Container(
// color: Colors.white, // color: Colors.white,
child: SettingsItem( child: SettingsItem(
onTap: () {}, onTap: () {
Get.toNamed(AppRoutes.PRIVACT);
//
},
icons: Icons.safety_check, icons: Icons.safety_check,
iconStyle: IconStyle( iconStyle: IconStyle(
iconsColor: Colors.white, iconsColor: Colors.white,
...@@ -455,14 +491,17 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -455,14 +491,17 @@ class UserDetailPage extends GetView<UserDetailController> {
child: Container( child: Container(
// color: Colors.white, // color: Colors.white,
child: SettingsItem( child: SettingsItem(
onTap: () {}, onTap: () {
// Get.toNamed(AppRoutes.SIGN_IN);
c.onLogout();
},
icons: Icons.logout, icons: Icons.logout,
iconStyle: IconStyle( iconStyle: IconStyle(
iconsColor: Colors.white, iconsColor: Colors.white,
backgroundColor: Colors.red, backgroundColor: Colors.red,
), ),
titleStyle: TextStyle(color: Colors.white), titleStyle: TextStyle(color: Colors.white),
title: '退出登录', title: c.isLogin ? '退出登录' : '登录账号',
subtitle: "退出该登录账号", subtitle: "退出该登录账号",
trailing: Icon( trailing: Icon(
Icons.arrow_forward_ios_rounded, Icons.arrow_forward_ios_rounded,
......
import 'package:get/get.dart';
import 'controller.dart';
class UserPrivacyBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<UserPrivacyController>(() => UserPrivacyController());
}
}
import 'package:get/get.dart';
import 'index.dart';
class UserPrivacyController extends GetxController {
UserPrivacyController();
final state = UserPrivacyState();
// tap
void handleTap(int index) {
Get.snackbar(
"标题",
"消息",
);
}
/// 在 widget 内存中分配后立即调用。
@override
void onInit() {
super.onInit();
}
/// 在 onInit() 之后调用 1 帧。这是进入的理想场所
@override
void onReady() {
super.onReady();
}
/// 在 [onDelete] 方法之前调用。
@override
void onClose() {
super.onClose();
}
/// dispose 释放内存
@override
void dispose() {
super.dispose();
}
}
library user_privacy;
export './state.dart';
export './controller.dart';
export './bindings.dart';
export './view.dart';
import 'package:get/get.dart';
class UserPrivacyState {
final _title = """
本协议是您(下文称为“用户”)与本 app 的所有者(下文称为“我们”)之间关于您使用本 app 所订立的协议。本协议描述了用户使用本 app 的权利和义务。使用本 app 即表示您同意接受本协议的所有条款。如果您不同意本协议的任何条款,请勿使用本 app。
1.用户账户
为了使用本 app 的所有功能,用户需要注册一个账户并输入正确的信息。用户应当对自己的账户和密码保密,并对其帐户下的所有活动负责。如果用户发现任何未经授权使用其账户的情况,应立即通知我们。
2.用户内容
本 app 允许用户存储和发送问题记录到 AI 服务器。用户应当对自己存储和发送的内容负责,并保证其不违反任何法律、法规或本协议。
3.使用规则
用户在使用本 app 时,应遵守以下规则:
●不得发布、传播任何违法、淫秽、色情、赌博、暴力、恐怖或者教唆犯罪的内容;
●不得发布、传播任何侵犯他人知识产权或其它合法权益的内容;
●不得发布、传播任何误导、欺骗、虚假信息或者进行任何不诚实的行为;
●不得发布、传播任何政治宣传或者进行任何政治活动;
●不得进行任何危害网络安全的行为,包括但不限于:恶意攻击、恶意破坏、恶意干扰等;
●不得进行任何影响本 app 正常运行的行为,包括但不限于:非法使用本 app 的资源、恶意注册、恶意请求等;
如果用户违反了上述规则,我们有权立即终止本协议并禁止用户使用本 app。
4.知识产权
本 app 包含的所有内容,包括但不限于文字、图片、音频、视频、软件、代码、商标、商业信息等,均受著作权、商标权、专利权及其它知识产权法律的保护。未经我们书面同意,用户不得使用、复制、修改、拷贝、发布、出售、出租、传播本 app 的任何内容。
5.AI 服务器回答内容责任
本 app 的 AI 服务器会根据用户的问题进行回答,但用户需要自行判断回答的内容的正确性和可靠性,并自行承担使用回答内容的风险。我们不对回答内容的准确性、可靠性、完整性、有效性、及时性、适用性等作出任何保证或承诺。
6.隐私保护
我们尊重用户的隐私权,并承诺在使用用户的个人信息时遵守相关法律法规。我们将采取合理的安全措施来保护用户的个人信息,但不对因不可抗力或非因我们的原因导致的信息泄露承担责任。
7.免责声明
本 app 提供的信息和服务仅供参考,不构成任何担保或承诺。我们不保证本 app 的信息和服务的准确性、可靠性、完整性、有效性、及时性、适用性。用户使用本 app 的信息和服务所产生的风险由用户自行承担。
8.变更和终止
我们有权随时变更本协议的任何条款,并将变更后的协议在本 app 上公布。如果用户继续使用本 app,即表示用户同意受变更后的协议的约束。如果用户不同意变更后的协议,应当立即停止使用本 app。
我们有权在任何时候终止本协议,并无需事先通知用户。在协议终止后,用户无权继续使用本 app。
9.适用法律
本协议的订立、执行、解释及争议的解决均适用中华人民共和国法律。如发生本协议与中华人民共和国法律相抵触时,应当以中华人民共和国法律的明文规定为准。
如双方就本协议内容或执行发生任何争议,双方应尽力友好协商解决;协商不成时,任何一方均可向本 app 所在地的人民法院提起诉讼。
10.其他
本协议构成双方对本协议之约定事项及其他有关事宜的完整协议,除本协议规定的之外,未赋予本协议各方其他权利。
如本协议中的任何条款无论因何种原因完全或部分无效或不具有执行力,本协议的其余条款仍应有效并且有约束力。
本协议中的标题仅供方便参阅,不具有实际意义,不能作为本协议涵义解释的依据。
本协议未尽事宜,您需遵守我们不时发布的其他服务条款和操作规则。
本协议自您接受之日起生效,对我们和用户均具有约束力。
"""
.obs;
set title(value) => _title.value = value;
get title => _title.value;
}
import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class UserPrivacyPage extends GetView<UserPrivacyController> {
const UserPrivacyPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return GlassmorphicContainer(
height: double.infinity,
width: double.infinity,
// flex: 1,
borderRadius: 16,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
child: const HelloWidget(),
// margin: EdgeInsets.only(bottom: 16.h),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
));
}
@override
Widget build(BuildContext context) {
return GetBuilder<UserPrivacyController>(
builder: (_) {
return Scaffold(
appBar: transparentAppBar(
leading: IconButton(
tooltip: '返回上一页',
icon: const Icon(
Icons.arrow_back,
color: AppColors.primaryElementText,
),
onPressed: () async {
// Get.back();
// Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application);
Get.back();
// await Get.toNamed();
// Navigator.of(context).pop();
//_nextPage(-1);
},
),
title: const Text(
"用户协议",
style: TextStyle(color: Colors.white),
)),
body: Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover),
),
child: _buildView(),
));
},
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../index.dart';
/// hello
class HelloWidget extends GetView<UserPrivacyController> {
const HelloWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Obx(() => ListView(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
children: [
Text(
controller.state.title,
style: TextStyle(
fontFamily: 'Montserrat',
fontSize: 18,
color: Colors.white),
)
],
)),
);
}
}
library widgets;
export './hello.dart';
...@@ -12,6 +12,7 @@ import package_info ...@@ -12,6 +12,7 @@ import package_info
import path_provider_foundation import path_provider_foundation
import share_plus import share_plus
import shared_preferences_foundation import shared_preferences_foundation
import sign_in_with_apple
import smart_auth import smart_auth
import sqflite import sqflite
import url_launcher_macos import url_launcher_macos
...@@ -24,6 +25,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ...@@ -24,6 +25,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin"))
SmartAuthPlugin.register(with: registry.registrar(forPlugin: "SmartAuthPlugin")) SmartAuthPlugin.register(with: registry.registrar(forPlugin: "SmartAuthPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
......
...@@ -506,6 +506,13 @@ packages: ...@@ -506,6 +506,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_vibrate:
dependency: "direct main"
description:
name: flutter_vibrate
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -973,6 +980,27 @@ packages: ...@@ -973,6 +980,27 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.3" version: "2.1.3"
sign_in_with_apple:
dependency: "direct main"
description:
name: sign_in_with_apple
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.0"
sign_in_with_apple_platform_interface:
dependency: transitive
description:
name: sign_in_with_apple_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
sign_in_with_apple_web:
dependency: transitive
description:
name: sign_in_with_apple_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -992,6 +1020,13 @@ packages: ...@@ -992,6 +1020,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0+2" version: "1.0.0+2"
social_login_buttons:
dependency: "direct main"
description:
name: social_login_buttons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
......
...@@ -107,6 +107,9 @@ dependencies: ...@@ -107,6 +107,9 @@ dependencies:
flutter_staggered_animations: ^1.1.1 flutter_staggered_animations: ^1.1.1
vibration: ^1.7.6 vibration: ^1.7.6
gradient_borders: ^1.0.0 gradient_borders: ^1.0.0
sign_in_with_apple: ^4.3.0
flutter_vibrate: ^1.3.0
social_login_buttons: ^1.0.7
# package:bubble/bubble.dart # package:bubble/bubble.dart
dev_dependencies: dev_dependencies:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment