Commit 8bd02cb4 authored by netyouli's avatar netyouli

添加我的界面和我的作品界面

parent bbc7d200
......@@ -116,6 +116,8 @@ PODS:
- Flutter
- image_picker_ios (0.0.1):
- Flutter
- in_app_review (0.2.0):
- Flutter
- keyboard_utils (0.0.1):
- Flutter
- open_filex (0.0.2):
......@@ -180,6 +182,7 @@ DEPENDENCIES:
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- keyboard_utils (from `.symlinks/plugins/keyboard_utils/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
......@@ -256,6 +259,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_gallery_saver/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
in_app_review:
:path: ".symlinks/plugins/in_app_review/ios"
keyboard_utils:
:path: ".symlinks/plugins/keyboard_utils/ios"
open_filex:
......@@ -315,6 +320,7 @@ SPEC CHECKSUMS:
GTMSessionFetcher: c9e714f7eec91a55641e2bab9f45fd83a219b882
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
keyboard_utils: ab24bc711be9e91a5937c20489056b8dd650fecc
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
......
......@@ -7,7 +7,7 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let ksj = WXApi.registerApp("wxac6457d4b052cc48", universalLink: "https://order.1clickpass.com/app/")
let ksj = WXApi.registerApp("wxc2db450107fa65e1", universalLink: "https://order.1clickpass.com/app/")
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
......
......@@ -2,6 +2,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>SKStoreReviewController</key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
......@@ -35,7 +37,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxac6457d4b052cc48</string>
<string>wxc2db450107fa65e1</string>
</array>
</dict>
</array>
......
......@@ -6,6 +6,7 @@ import 'package:chart/common/utils/utils.dart';
import '../../entity/login_entity.dart';
import '../../entity/user_entity.dart';
import '../../pages/my/models.dart';
import '../entities/applePayList.dart';
/// 用户
......@@ -230,6 +231,14 @@ class UserAPI {
// UserLoginResponseEntity.fromJson(response);
}
static Future<UserInfoResponse> getUserInfoV2() async {
var response = await HttpUtil().get(
'/user/info',
);
return UserInfoResponse.fromJson(response);
// UserLoginResponseEntity.fromJson(response);
}
// /api/user/info
static Future<MsmEntity> sendSms(
Map<String, dynamic>? params,
......
......@@ -26,6 +26,8 @@ class AppRoutes {
static const CREATION_PAGE_DETAIL = '/creation-detail';
static const ASSISTANT_PAGE = '/assistant';
static const MY_PAGE = '/my';
static const MY_WORK = '/my/work';
static const SETTINGS_PAGE = '/my/settings';
static const ASSISTANT_ITEM = '/creation-item';
// AssistantItemBinding
// UserPrivacyPage
......
......@@ -11,7 +11,7 @@ import 'package:chart/pages/frame/android_pay_list/view.dart';
import 'package:chart/pages/frame/notfound/index.dart';
import 'package:chart/pages/frame/pay_list/view.dart';
import 'package:chart/pages/home/index.dart';
import 'package:chart/pages/my/index.dart';
import 'package:chart/pages/settings/index.dart';
import 'package:chart/pages/privacy/index.dart';
import 'package:chart/pages/template/index.dart';
import 'package:chart/pages/user_privacy/index.dart';
......@@ -34,6 +34,10 @@ import '../../pages/ai-draw-image/bindings.dart';
import '../../pages/ai-draw-image/view.dart';
import '../../pages/frame/android_pay_list/index.dart';
import '../../pages/frame/pay_list/bindings.dart';
import '../../pages/my-work/bindings.dart';
import '../../pages/my-work/view.dart';
import '../../pages/my/bindings.dart';
import '../../pages/my/view.dart';
import 'routes.dart';
class AppPages {
......@@ -100,6 +104,11 @@ class AppPages {
// ]
),
GetPage(
name: AppRoutes.MY_WORK,
page: () => MyWorkPage(),
binding: MyWorkBinding(),
),
GetPage(
name: AppRoutes.SIGN_IN,
page: () => SignInPage(),
......@@ -207,6 +216,11 @@ class AppPages {
page: () => AssistantPage(),
binding: AssistantBinding(),
),
GetPage(
name: AppRoutes.SETTINGS_PAGE,
page: () => SettingsPage(),
binding: SettingsBinding(),
),
GetPage(
name: AppRoutes.MY_PAGE,
page: () => MyPage(),
......
......@@ -31,6 +31,8 @@ class UserStore extends GetxController {
// 是否登录
late final _isLogin = false.obs;
var loginDidChange = false.obs;
// 令牌 token
String token = '';
......@@ -97,6 +99,7 @@ class UserStore extends GetxController {
if (profile.id != '') {
_isLogin.value = true;
loginDidChange.toggle();
}
}
} else {
......@@ -115,6 +118,7 @@ class UserStore extends GetxController {
_profile.value = IntegralEntity(
id: '', token: '', username: '', integral: 0, expireTime: null);
_isLogin.value = false;
loginDidChange.toggle();
}
Future refreshInfo() async {
......@@ -137,6 +141,7 @@ class UserStore extends GetxController {
if (profile.id != '') {
_isLogin.value = true;
loginDidChange.toggle();
}
await setToken(res.token);
......@@ -149,6 +154,7 @@ class UserStore extends GetxController {
expireTime: res.expireTime,
));
_isLogin.value = true;
loginDidChange.toggle();
Get.back();
// await MainController.to.asyncLoadBannerData();
}
......@@ -165,6 +171,7 @@ class UserStore extends GetxController {
expireTime: res.expireTime,
));
_isLogin.value = true;
loginDidChange.toggle();
Get.back();
// Get.put(ApplicationController());
// Get.offAndToNamed(AppRoutes.Application);
......@@ -234,6 +241,7 @@ class UserStore extends GetxController {
// if (_isLogin.value) await UserAPI.logout();
await StorageService.to.remove(STORAGE_USER_TOKEN_KEY);
_isLogin.value = false;
loginDidChange.toggle();
token = '';
saveProfile(IntegralEntity(
id: '', username: '', token: '', expireTime: null, integral: 0));
......
......@@ -11,6 +11,7 @@ class AppColor {
static const Color gray5 = Color.fromARGB(255, 40, 40, 40);
static const Color gray6 = Color.fromARGB(255, 30, 30, 30);
static const Color gray7 = Color.fromARGB(255, 50, 50, 50);
static const Color gray8 = Color.fromARGB(255, 200, 200, 200);
static const Color black1 = Color.fromARGB(255, 20, 20, 20);
static const Color gradient_back1 = Color.fromARGB(255, 15, 24, 29);
......@@ -19,6 +20,8 @@ class AppColor {
static const Color yellow1 = Color.fromARGB(255, 150, 100, 30);
static const Color yellow2 = Color.fromARGB(255, 252, 215, 156);
static const Color yellow3 = Color.fromARGB(255, 142, 61, 24);
/// 页面背景颜色
static const Color scaffoldBackground = Color(0xFFFFFFFF);
......
......@@ -36,7 +36,7 @@ void main() async {
const SystemUiOverlayStyle(systemNavigationBarColor: Colors.black);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
}
registerWxApi(appId: "wxac6457d4b052cc48",
registerWxApi(appId: "wxc2db450107fa65e1",
doOnAndroid: true,
doOnIOS: true,
universalLink: "https://order.1clickpass.com/app/");
......
......@@ -16,46 +16,71 @@ import 'controller.dart';
SafeArea(
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20))
color: Colors.transparent,
),
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
height: 138,
height: 190,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
alignment: Alignment.bottomCenter,
child: Column(
children: [
InkWell(
onTap: () {
controller.selectBlendImageUpload(ImageSource.camera);
Get.back();
},
child: Container(
height: 44,
width: Get.width - 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColor.primary,
borderRadius: BorderRadius.circular(22)
),
child: Text("拍照"),
Container(
decoration: const BoxDecoration(
color: AppColor.gray6,
borderRadius: BorderRadius.all(Radius.circular(20))
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
controller.selectBlendImageUpload(ImageSource.camera);
Get.back();
},
child: Container(
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)
),
child: const Text("打开“相机”"),
),
),
const Divider(height: 0.5, color: AppColor.gray1,),
InkWell(
onTap: () {
controller.selectBlendImageUpload(ImageSource.gallery);
Get.back();
},
child: Container(
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)
),
child: const Text("前往“照片”"),
),
)
],
),
),
SizedBox(height: 10,),
const SizedBox(height: 20,),
InkWell(
onTap: () {
controller.selectBlendImageUpload(ImageSource.gallery);
Get.back();
},
child: Container(
height: 44,
width: Get.width - 40,
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColor.primary,
borderRadius: BorderRadius.circular(22)
decoration: const BoxDecoration(
color: AppColor.gray6,
borderRadius: BorderRadius.all(Radius.circular(20))
),
child: Text("相册"),
child: const Text("取消"),
),
)
),
],
),
)
......
......@@ -13,12 +13,12 @@ Widget makeSectionTitleView(String index, String name) {
child: Row(
children: [
Text(index,
style: TextStyle(
style: const TextStyle(
color: AppColor.gray2,
fontWeight: FontWeight.bold
),
),
SizedBox(width: 3,),
const SizedBox(width: 3,),
Text(name)
],
),
......@@ -31,46 +31,71 @@ Widget makeSectionTitleView(String index, String name) {
SafeArea(
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20))
color: Colors.transparent,
),
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
height: 138,
height: 190,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
alignment: Alignment.bottomCenter,
child: Column(
children: [
InkWell(
onTap: () {
controller.selectTextImageUpload(ImageSource.camera);
Get.back();
},
child: Container(
height: 44,
width: Get.width - 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColor.primary,
borderRadius: BorderRadius.circular(22)
),
child: Text("拍照"),
Container(
decoration: const BoxDecoration(
color: AppColor.gray6,
borderRadius: BorderRadius.all(Radius.circular(20))
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
controller.selectTextImageUpload(ImageSource.camera);
Get.back();
},
child: Container(
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)
),
child: const Text("打开“相机”"),
),
),
const Divider(height: 0.5, color: AppColor.gray1,),
InkWell(
onTap: () {
controller.selectTextImageUpload(ImageSource.gallery);
Get.back();
},
child: Container(
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)
),
child: const Text("前往“照片”"),
),
)
],
),
),
SizedBox(height: 10,),
const SizedBox(height: 20,),
InkWell(
onTap: () {
controller.selectTextImageUpload(ImageSource.gallery);
Get.back();
},
child: Container(
height: 44,
width: Get.width - 40,
height: 50,
width: Get.width - 20,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColor.primary,
borderRadius: BorderRadius.circular(22)
decoration: const BoxDecoration(
color: AppColor.gray6,
borderRadius: BorderRadius.all(Radius.circular(20))
),
child: Text("相册"),
child: const Text("取消"),
),
)
),
],
),
)
......@@ -104,7 +129,7 @@ Widget makeSectionTitleView(String index, String name) {
// 插入图片
return Container(
height: 220,
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(20)
......@@ -129,11 +154,11 @@ Widget makeSectionTitleView(String index, String name) {
Column(
children: [
makeSectionTitleView("01.", "插入图片"),
SizedBox(height: 10,),
const SizedBox(height: 10,),
Container(
height: 160,
width: constraints.maxWidth - 20,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
decoration: BoxDecoration(
color: AppColor.black1,
borderRadius: BorderRadius.circular(10)
......@@ -151,7 +176,7 @@ Widget makeSectionTitleView(String index, String name) {
width: constraints.maxWidth - 20,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
children: const [
Image(image: AssetImage("assets/images/添加图片.png", ), width: 40, height: 40,),
SizedBox(height: 20,),
Text("支持图片格式:JPG/PNG,低于10M",
......@@ -209,13 +234,13 @@ Widget makeSectionTitleView(String index, String name) {
Positioned(
right: 0,
child: Container(
padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
decoration: BoxDecoration(
padding: const EdgeInsets.fromLTRB(8, 2, 8, 2),
decoration: const BoxDecoration(
color: AppColor.primary,
borderRadius: BorderRadius.only(topRight: Radius.circular(7), bottomLeft: Radius.circular(10)),
),
child: Text(item.typeName,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
),
),
......@@ -231,13 +256,13 @@ Widget makeSectionTitleView(String index, String name) {
final controller = Get.find<AIDrawImageController>();
// 描述词输入框
return Container(
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("不知道如何输入?可以试试大神描叙词",
const Text("不知道如何输入?可以试试大神描叙词",
style: TextStyle(
fontSize: 12,
color: AppColor.gray2
......@@ -251,7 +276,7 @@ Widget makeSectionTitleView(String index, String name) {
height: 30,
child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
child: Row(
children: [
children: const [
Image(image: AssetImage("assets/images/jifen1.png", ), width: 20, height: 20,),
SizedBox(width: 5),
Text("换一换",
......@@ -271,7 +296,7 @@ Widget makeSectionTitleView(String index, String name) {
child: Obx(() => ListView.separated(itemBuilder: (context, index) {
return makeImageRandomItem(index);
},
separatorBuilder: (BuildContext context, int index) => SizedBox(width: 10),
separatorBuilder: (BuildContext context, int index) => const SizedBox(width: 10),
scrollDirection: Axis.horizontal,
itemCount: controller.randomDescriptionItems.length,
),)
......@@ -286,7 +311,7 @@ Widget makeSectionTitleView(String index, String name) {
// 输入描叙词
return Container(
height: 390,
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(20)
......@@ -294,10 +319,10 @@ Widget makeSectionTitleView(String index, String name) {
child: Column(
children: [
makeSectionTitleView("02.", "输入描述词"),
SizedBox(height: 10,),
const SizedBox(height: 10,),
Container(
height: 160,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
decoration: BoxDecoration(
color: AppColor.black1,
borderRadius: BorderRadius.circular(10)
......@@ -306,11 +331,11 @@ Widget makeSectionTitleView(String index, String name) {
children: [
TextField(
controller: controller.textController,
style: TextStyle(
style: const TextStyle(
fontSize: 14
),
maxLines: 6, // 允许多行输入
decoration: InputDecoration(
decoration: const InputDecoration(
hintText: '请输入画面描述以短句、短语为佳、一逗号分割、支持中英文等语言输入', // placeholder提示
border: OutlineInputBorder(
borderSide: BorderSide.none, // 无边框
......@@ -318,7 +343,7 @@ Widget makeSectionTitleView(String index, String name) {
contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 0), // 内边距
),
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
......@@ -328,9 +353,9 @@ Widget makeSectionTitleView(String index, String name) {
},
child: Container(
height: 30,
child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
child: Padding(padding: const EdgeInsets.fromLTRB(0, 0, 10, 0),
child: Row(
children: [
children: const [
Image(image: AssetImage("assets/images/jifen1.png", ), width: 20, height: 20,),
SizedBox(width: 5),
Text("随机输入",
......@@ -347,22 +372,22 @@ Widget makeSectionTitleView(String index, String name) {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("${controller.textCount}/500",
style: TextStyle(
style: const TextStyle(
fontSize: 12
),
),
SizedBox(width: 5,),
const SizedBox(width: 5,),
InkWell(
onTap: () {
controller.textController.setText("");
},
child: Container(
child: Text("清除",
style: TextStyle(
fontSize: 12,
color: AppColor.primary
),
child: const Text("清除",
style: TextStyle(
fontSize: 12,
color: AppColor.primary
),
),
),
),
],
......@@ -417,13 +442,13 @@ Widget makeSectionTitleView(String index, String name) {
right: 15,
top: 8,
child: Container(
padding: EdgeInsets.fromLTRB(5, 2, 5, 2),
padding: const EdgeInsets.fromLTRB(5, 2, 5, 2),
decoration: BoxDecoration(
color: AppColor.yellow1,
borderRadius: BorderRadius.circular(5),
),
child: Text(item.vip,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold
),
......@@ -433,7 +458,7 @@ Widget makeSectionTitleView(String index, String name) {
)
],
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
Text(item.name)
],
);
......@@ -447,7 +472,7 @@ Widget makeSectionTitleView(String index, String name) {
// 风格选择
return Container(
height: 320,
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(20)
......@@ -455,13 +480,13 @@ Widget makeSectionTitleView(String index, String name) {
child: Column(
children: [
makeSectionTitleView("03.", "选择风格"),
SizedBox(height: 10,),
Divider(
const SizedBox(height: 10,),
const Divider(
color: AppColor.black1,
thickness: 1,
height: 10,
),
SizedBox(height: 15,),
const SizedBox(height: 15,),
Expanded(
child: GridView.count(
crossAxisCount: 2,
......@@ -501,7 +526,7 @@ Widget makeSectionTitleView(String index, String name) {
),
child: Column(
children: [
SizedBox(height: 10,),
const SizedBox(height: 10,),
ClipRRect(
borderRadius: BorderRadius.circular(5),
child: Image(image: AssetImage(item.imageUrl),
......@@ -509,16 +534,16 @@ Widget makeSectionTitleView(String index, String name) {
height: item.ratio == "1:1" ? 20 : 30,
),
),
SizedBox(height: 3,),
const SizedBox(height: 3,),
Text(item.name,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
color: AppColor.gray4
),
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
Text(item.ratio,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
),
),
......@@ -532,7 +557,7 @@ Widget makeSectionTitleView(String index, String name) {
// 选择画幅
return Container(
height: 160,
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(20)
......@@ -540,13 +565,13 @@ Widget makeSectionTitleView(String index, String name) {
child: Column(
children: [
makeSectionTitleView("04.", "选择画幅"),
SizedBox(height: 10,),
Divider(
const SizedBox(height: 10,),
const Divider(
color: AppColor.black1,
thickness: 1,
height: 10,
),
SizedBox(height: 15,),
const SizedBox(height: 15,),
Expanded(
child: Obx(() => GridView.count(
crossAxisCount: 1,
......@@ -575,17 +600,17 @@ Widget makeSectionTitleView(String index, String name) {
SingleChildScrollView(
controller: controller.textToImageController,
scrollDirection: Axis.vertical,
padding: EdgeInsets.fromLTRB(10, 10, 10, 70),
padding: const EdgeInsets.fromLTRB(10, 10, 10, 70),
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// tip
Container(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
children: const [
Text("AI绘图",
style: TextStyle(
fontWeight: FontWeight.bold
......@@ -598,20 +623,23 @@ Widget makeSectionTitleView(String index, String name) {
],
),
),
SizedBox(height: 20,),
const SizedBox(height: 20,),
makeInsertPictureView(),
SizedBox(height: 20,),
const SizedBox(height: 20,),
makeEnterDescriptiveWordsView(),
SizedBox(height: 20,),
const SizedBox(height: 20,),
makeStyleSelectionView(),
SizedBox(height: 20,),
const SizedBox(height: 20,),
makePictureFrameSelectionView(),
],
),
),
),
Positioned(
child: Padding(padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
bottom: 10,
width: Get.width,
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: InkWell(
onTap: () {
controller.toTextMakeDrawImage();
......@@ -623,12 +651,11 @@ Widget makeSectionTitleView(String index, String name) {
color: AppColor.primary,
borderRadius: BorderRadius.circular(25),
),
child: Text("立即生成(消耗2金币)"),
child: const Text("立即生成(消耗2金币)"),
),
),
),
bottom: 10,
width: Get.width,)
)
],
);
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import 'package:chart/common/widgets/wx_share.dart';
import 'package:chart/pages/assistant/index.dart';
import 'package:chart/pages/creation/index.dart';
import 'package:chart/pages/home/index.dart';
import 'package:chart/pages/my/index.dart';
import 'package:chart/pages/settings/index.dart';
import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart';
......@@ -20,6 +20,7 @@ import 'package:loading_animation_widget/loading_animation_widget.dart';
// import 'package:text_editor/text_editor.dart';
// import '../dashboard/dashboard_page.dart';
import '../ai-draw-image/view.dart';
import '../my/view.dart';
import 'index.dart';
class ApplicationPage extends GetView<ApplicationController> {
......
import 'package:get/get.dart';
import 'controller.dart';
class MyCollectBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<MyCollectController>(() => MyCollectController());
}
}
\ No newline at end of file
import 'dart:io';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/store/user.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:share_plus/share_plus.dart';
import 'package:in_app_review/in_app_review.dart';
import '../../common/routers/names.dart';
class MyCollectController extends GetxController {
}
\ No newline at end of file
import 'package:chart/common/routers/routes.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../common/style/color.dart';
import './controller.dart';
class MyCollectPage extends GetView<MyCollectController> {
const MyCollectPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
// TODO: implement build
throw UnimplementedError();
}
}
\ No newline at end of file
import 'package:get/get.dart';
import 'controller.dart';
class MyWorkBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<MyWorkController>(() => MyWorkController());
}
}
\ No newline at end of file
import 'dart:io';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/store/user.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:share_plus/share_plus.dart';
import 'package:in_app_review/in_app_review.dart';
import '../../common/routers/names.dart';
import '../ai-draw-image/model.dart';
class MyWorkController extends GetxController {
late ScrollController loadingMoreController = ScrollController(initialScrollOffset: 0);
late EasyRefreshController refreshController = EasyRefreshController();
var models = AIDrawTextToImageModel();
}
\ No newline at end of file
import 'package:chart/common/routers/routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:get/get.dart';
import '../../common/style/color.dart';
import './controller.dart';
class MyWorkPage extends GetView<MyWorkController> {
const MyWorkPage({Key? key}) : super(key: key);
Widget makeListView() {
// TODO: implement build
final controller = Get.find<MyWorkController>();
return Container(
child: EasyRefresh(
controller: controller.refreshController,
header: ClassicalHeader(
bgColor: Colors.white,
textColor: Colors.pink,
infoColor: Colors.pink,
refreshReadyText: '下拉刷新',
refreshingText: '正在努力刷新',
refreshedText: '加载完成',
showInfo: true,
infoText: '正在加载中',
),
footer: ClassicalFooter(
bgColor: Colors.white,
textColor: Colors.pink,
infoColor: Colors.pink,
showInfo: true,
noMoreText: '暂时没有更多了',
loadReadyText: '上拉加载',
loadedText: '加载完毕',
loadText: '上拉加载更多',
loadingText: '正在努力加载更多',
infoText: '正在加载中',
),
child: MasonryGridView.count(
controller: controller.loadingMoreController,
itemCount: controller.models.descriptives.length,
crossAxisCount: 2,
itemBuilder: (BuildContext context, int index) {
return ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image(image: AssetImage(controller.models.descriptives[index].imageUrl),
fit: BoxFit.cover,
height: index % 2 == 0 ? 260 : 200,
),
);
},
mainAxisSpacing: 10.0,
crossAxisSpacing: 10.0,
),
onLoad: () async {
print('没有更多了.......');
},
onRefresh: () async {
print('下拉刷新~~~~');
},
),
);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return GetBuilder<MyWorkController>(
init: MyWorkController(),
id: "mywork",
builder: (_) {
return Container(
height: double.infinity,
decoration: const BoxDecoration(
color: AppColor.black1
),
child: Scaffold(
backgroundColor: const Color.fromARGB(0, 29, 33, 60),
appBar: AppBar(
elevation: 0,
title: const Text("我的作品"),
bottomOpacity: 0.1,
backgroundColor: const Color.fromARGB(0, 29, 33, 60),
),
body: SafeArea(
child: makeListView(),
),
),
);
},
);
}
}
\ No newline at end of file
......@@ -7,4 +7,4 @@ class MyBinding implements Bindings {
void dependencies() {
Get.lazyPut<MyController>(() => MyController());
}
}
}
\ No newline at end of file
import 'dart:io';
import 'package:chart/pages/my/widgets/share.dart';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/store/user.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:fluwx/fluwx.dart';
import 'package:intl/intl.dart';
import 'package:share_plus/share_plus.dart';
import 'package:in_app_review/in_app_review.dart';
import '../../common/routers/names.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
import 'models.dart';
class MyController extends GetxController {
MyController();
var cacheSize = 16.43.obs;
var userInfo = Rx<UserInfoData>(UserInfoData(username: "未登录"));
var expireInfo = "--".obs;
@override
void onInit() {
// TODO: implement onInit
super.onInit();
requestUserInfo();
_initData() {
update(["my"]);
ever(UserStore.to.loginDidChange, (didChange) {
requestUserInfo();
});
}
dynamic getShareModel(ShareType shareType, ShareInfo shareInfo) {
var scene = fluwx.WeChatScene.SESSION;
switch (shareType) {
case ShareType.SESSION:
scene = fluwx.WeChatScene.SESSION;
break;
case ShareType.TIMELINE:
scene = fluwx.WeChatScene.TIMELINE;
break;
case ShareType.COPY_LINK:
break;
case ShareType.DOWNLOAD:
break;
}
goShare() async {
await Share.shareWithResult(
'https://apps.apple.com/cn/app/ai%E5%86%99%E4%BD%9C%E5%A4%A7%E5%B8%88/id1671136252');
}
if (shareInfo.img != null) {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
thumbnail: fluwx.WeChatImage.network(shareInfo.img),
scene: scene,
);
goFeedback() async {
final InAppReview inAppReview = InAppReview.instance;
if (await inAppReview.isAvailable()) {
inAppReview.requestReview();
} else {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
scene: scene,
);
EasyLoading.showToast("评价异常");
}
}
_initFluwx() async {
await registerWxApi(
appId: 'wxac6457d4b052cc48',
doOnAndroid: true,
doOnIOS: true,
universalLink: 'https://order.1clickpass.com/app/',
);
var result = await isWeChatInstalled;
print('is installed $result');
goClearCache() {
cacheSize.value = 0.0;
EasyLoading.showSuccess("清理成功");
}
handleToWx() async {
await fluwx.openWeChatCustomerServiceChat(
url: "https://work.weixin.qq.com/kfid/kfc4e77a401df6f7d09",
corpId: "wwe816b5b616eaf0f3");
// fluwx.shareToWeChat(
// WeChatShareTextModel("source text", scene: WeChatScene.TIMELINE));
}
handleShare() async {
await Share.shareWithResult(
'https://apps.apple.com/cn/app/ai%E5%86%99%E4%BD%9C%E5%A4%A7%E5%B8%88/id1671136252');
}
void onTap() {}
// @override
// void onInit() {
// super.onInit();
// }
@override
void onReady() {
super.onReady();
_initData();
_initFluwx();
void goPay() {
if (UserStore.to.isLogin) {
if (Platform.isAndroid) {
Get.toNamed(AppRoutes.AN_PAY_LIST);
} else {
Get.toNamed(AppRoutes.PAY_LIST);
}
} else {
Get.toNamed(AppRoutes.SIGN_IN);
}
}
// @override
// void onClose() {
// super.onClose();
// }
void virtualPay() {
if (Platform.isAndroid) {
Get.toNamed(AppRoutes.AN_PAY_LIST);
} else {
Get.toNamed(AppRoutes.PAY_LIST);
requestUserInfo() async {
if (UserStore.to.isLogin) {
final res = await UserAPI.getUserInfoV2();
if (res.status != 200) {
EasyLoading.showError(res.message ?? "获取个人信息失败");
}
userInfo.value = res.data ?? UserInfoData(username: "未登录");
/**
* if let text = chatController.userInfo?.expireTime, !text.isEmpty {
if text.isExpireTime {
cell?.detailTextLabel?.text = "已过期: \(text.expireTime)"
} else {
cell?.detailTextLabel?.text = "到期日: \(text.expireTime)"
}
} else {
cell?.detailTextLabel?.text = "可用积分: \(chatController.userInfo?.integral ?? 0)"
}
*/
final expireTime = userInfo.value.expireTime;
if (expireTime != null && expireTime.isNotEmpty) {
final expDate = DateTime.parse(expireTime);
final today = DateTime.now();
final difference = expDate.compareTo(today);
String formattedDateTime = DateFormat('yyyy-MM-dd HH:mm').format(expDate);
if (difference < 0) {
// 已过期
expireInfo.value = "已过期: $formattedDateTime";
} else {
expireInfo.value = "到期日: $formattedDateTime";
}
} else {
expireInfo.value = "当前可用积分: ${userInfo.value.integral ?? 0}";
}
}
}
}
}
\ No newline at end of file
class UserInfoResponse {
int? status;
String? message;
UserInfoData? data;
int? timestamp;
UserInfoResponse({this.status, this.message, this.data, this.timestamp});
UserInfoResponse.fromJson(Map<String, dynamic> json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? new UserInfoData.fromJson(json['data']) : null;
timestamp = json['timestamp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['status'] = this.status;
data['message'] = this.message;
if (this.data != null) {
data['data'] = this.data?.toJson();
}
data['timestamp'] = this.timestamp;
return data;
}
}
class UserInfoData {
int? id;
String? username;
String? password;
int? signIn;
String? signTime;
String? updateTime;
String? createTime;
int? delFlag;
int? userType;
int? integral;
String? openId;
String? unionId;
String? expireTime;
String? token;
String? source;
String? shareCode;
String? deviceType;
String? gopenId;
UserInfoData(
{this.id,
this.username,
this.password,
this.signIn,
this.signTime,
this.updateTime,
this.createTime,
this.delFlag,
this.userType,
this.integral,
this.openId,
this.unionId,
this.expireTime,
this.token,
this.source,
this.shareCode,
this.deviceType,
this.gopenId});
UserInfoData.fromJson(Map<String, dynamic> json) {
id = json['id'];
username = json['username'];
password = json['password'];
signIn = json['signIn'];
signTime = json['signTime'];
updateTime = json['updateTime'];
createTime = json['createTime'];
delFlag = json['delFlag'];
userType = json['userType'];
integral = json['integral'];
openId = json['openId'];
unionId = json['unionId'];
expireTime = json['expireTime'];
token = json['token'];
source = json['source'];
shareCode = json['shareCode'];
deviceType = json['deviceType'];
gopenId = json['gopenId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['username'] = this.username;
data['password'] = this.password;
data['signIn'] = this.signIn;
data['signTime'] = this.signTime;
data['updateTime'] = this.updateTime;
data['createTime'] = this.createTime;
data['delFlag'] = this.delFlag;
data['userType'] = this.userType;
data['integral'] = this.integral;
data['openId'] = this.openId;
data['unionId'] = this.unionId;
data['expireTime'] = this.expireTime;
data['token'] = this.token;
data['source'] = this.source;
data['shareCode'] = this.shareCode;
data['deviceType'] = this.deviceType;
data['gopenId'] = this.gopenId;
return data;
}
}
\ No newline at end of file
import 'package:bruno/bruno.dart';
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/store.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gradient_widgets/gradient_widgets.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
import 'index.dart';
import 'widgets/share.dart';
import '../../common/style/color.dart';
import './controller.dart';
class MyPage extends GetView<MyController> {
const MyPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView(context) {
final c = Get.put(UserStore());
return Obx(() => ListView(
padding: EdgeInsets.symmetric(horizontal: 10),
children: [
Obx(() => GestureDetector(
onTap: () {
if (UserStore.to.isLogin) {
} else {
Get.toNamed(AppRoutes.SIGN_IN);
}
},
child: Row(
children: [
Container(
width: 60,
height: 60,
child: ClipRRect(
borderRadius: BorderRadius.circular(60.0),
child: Image.asset(
"assets/images/60x3.png",
fit: BoxFit.contain,
),
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Text(
"用户名:${UserStore.to.profile.username.isEmpty ? '游客' : UserStore.to.profile.username}",
textAlign: TextAlign.left,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
!UserStore.to.isLogin
? Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Text(
'您还未登录,点击登录。',
textAlign: TextAlign.center,
style: TextStyle(
color: Color.fromARGB(255, 160, 165, 184),
),
),
)
: c.profile.expireTime == null
? Padding(
padding: EdgeInsets.only(left: 20),
child: Text(
"您还不是 VIP 会员",
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 16,
fontWeight: FontWeight.bold),
))
: Align(
alignment: Alignment.centerLeft,
child: Container(
// color: Colors.amber,
padding: EdgeInsets.symmetric(
horizontal: 20, vertical: 0),
child: RichText(
textAlign: TextAlign.left,
text: TextSpan(children: [
const TextSpan(
text: '会员到期时间:',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
TextSpan(
style: TextStyle(
fontSize: 12,
),
text:
"${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}"),
const TextSpan(
text: ',剩余积分:',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
TextSpan(
text: '${c.profile.integral}',
style: const TextStyle(
fontSize: 12,
),
),
const TextSpan(
text: '分。',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
// Text(
// "您的VIP会员资格将于" +
// "${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}" +
// "过期,如果您是自动续费会员将会在过期日前一天自动续费。",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: color,
// fontSize: 14,
// ),
// )
])),
),
)
],
)),
UserStore.to.isLogin
? SizedBox.shrink()
: SizedBox(
width: 60,
child: Center(
child:
Icon(Icons.arrow_forward_ios_outlined)),
),
],
Widget makeMyInfoView() {
final controller = Get.find<MyController>();
return Container(
child: Row(
children: [
Image.asset("assets/images/jifen1.png", width: 50, height: 50,),
const SizedBox(width: 10,),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("用户:${controller.userInfo.value.username}",
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16
),
)),
UserStore.to.isLogin
? Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.virtualPay();
},
child: Ink(
width: Get.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: const LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.monetization_on_outlined),
SizedBox(
width: 10,
),
Text('购买订阅')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
)
: SizedBox.shrink(),
Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
Get.toNamed(AppRoutes.USER_EULA);
},
child: Ink(
width: Get.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: const LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
const SizedBox(height: 5,),
Text(controller.expireInfo.value,
style: const TextStyle(
color: AppColor.gray4,
fontSize: 14
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.event_note_outlined),
SizedBox(
width: 10,
),
Text('服务协议')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
],
),
),
InkWell(
onTap: () {
controller.goPay();
},
child: Container(
height: 30,
decoration: BoxDecoration(
color: AppColor.gray1,
borderRadius: BorderRadius.circular(15),
border: Border.all(
color: Colors.black,
width: 1
)
),
child: Padding(padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Row(
children: const [
Image(image: AssetImage("assets/images/jifen1.png", ), width: 20, height: 20,),
SizedBox(width: 5),
Text("金币充值"),
],
),
),
),
),
],
),
);
}
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
Get.toNamed(AppRoutes.PRIVACT);
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
Widget makeHistoryInfoView() {
return Container(
padding: const EdgeInsets.fromLTRB(0, 30, 0, 30),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () {
Get.toNamed(AppRoutes.MY_WORK);
},
child: Column(
children: const [
Text("2",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.privacy_tip),
SizedBox(
width: 10,
),
Text('隐私政策')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
SizedBox(height: 5,),
Text("绘画作品",
style: TextStyle(
fontSize: 14,
color: AppColor.gray4,
),
),
],
),
),
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.handleToWx();
// showModalBottomSheet(
// /**
// * showModalBottomSheet常用属性
// * shape 设置形状
// * isScrollControlled:全屏还是半屏
// * isDismissible:外部是否可以点击,false不可以点击,true可以点击,点击后消失
// * backgroundColor : 设置背景色
// */
// backgroundColor: Colors.transparent,
// context: context,
// builder: (BuildContext context) {
// return ShareWidget(
// ShareInfo('Hello world', 'http://www.baidu.com'),
// list: [
// ShareOpt(
// title: '朋友圈',
// img: 'assets/images/icon_wechat_moments.jpg',
// shareType: ShareType.TIMELINE,
// doAction: (shareType, shareInfo) {
// var model = controller.getShareModel(
// shareType, shareInfo);
// fluwx.shareToWeChat(model);
// })
// ],
// );
// });
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
Container(
height: 18,
width: 1,
decoration: const BoxDecoration(
color: AppColor.gray4,
),
),
Expanded(
child: InkWell(
child: Column(
children: const [
Text("0",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const Icon(Icons.wechat),
SizedBox(
width: 10,
),
Text('微信客服')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
SizedBox(height: 5,),
Text("我的收藏",
style: TextStyle(
fontSize: 14,
color: AppColor.gray4,
),
),
],
),
),
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.handleShare();
// showModalBottomSheet(
// /**
// * showModalBottomSheet常用属性
// * shape 设置形状
// * isScrollControlled:全屏还是半屏
// * isDismissible:外部是否可以点击,false不可以点击,true可以点击,点击后消失
// * backgroundColor : 设置背景色
// */
// backgroundColor: Colors.transparent,
// context: context,
// builder: (BuildContext context) {
// return ShareWidget(
// ShareInfo('Hello world', 'http://www.baidu.com'),
// list: [
// ShareOpt(
// title: '朋友圈',
// img: 'assets/images/icon_wechat_moments.jpg',
// shareType: ShareType.TIMELINE,
// doAction: (shareType, shareInfo) {
// var model = controller.getShareModel(
// shareType, shareInfo);
// fluwx.shareToWeChat(model);
// })
// ],
// );
// });
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
Container(
height: 18,
width: 1,
decoration: const BoxDecoration(
color: AppColor.gray4,
),
),
Expanded(
child: InkWell(
child: Column(
children: const [
Text("0",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30
),
),
SizedBox(height: 5,),
Text("我的分享",
style: TextStyle(
fontSize: 14,
color: AppColor.gray4,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const Icon(Icons.ios_share_outlined),
SizedBox(
width: 10,
),
Text('分享APP')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
],
),
),
)
],
),
);
}
Widget makeVipView() {
final controller = Get.find<MyController>();
return Container(
height: 100,
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: DecorationImage(image: Image.asset("assets/images/vip_back.png").image, fit: BoxFit.fill)
),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text("成为AI写作大师会员",
style: TextStyle(
color: AppColor.yellow2,
fontWeight: FontWeight.bold,
fontSize: 20
),
),
SizedBox(height: 5,),
Text("升级解锁全部功能",
style: TextStyle(
color: AppColor.gray8,
),
)
],
),
),
InkWell(
onTap: () {
controller.goPay();
},
child: Container(
alignment: Alignment.center,
height: 40,
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: AppColor.yellow2
),
child: const Text("立即升级",
style: TextStyle(
color: AppColor.yellow3
),
),
),
UserStore.to.isLogin
? Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text('提示'),
content: Text('确定要退出吗?'),
actions: <Widget>[
CupertinoDialogAction(
child: Text('取消'),
onPressed: () {
Navigator.pop(context); // 关闭弹窗
},
),
CupertinoDialogAction(
child: Text('确定'),
onPressed: () {
UserStore.to.logout();
// Get.back();
Navigator.pop(context); // 关闭弹窗
},
),
],
);
},
);
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.logout),
SizedBox(
width: 10,
),
Text('退出登录')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
)
],
),
);
}
Widget makeSectionItemView(String name) {
return Container(
alignment: Alignment.centerLeft,
padding: const EdgeInsets.fromLTRB(10, 25, 20, 15),
child: Text(name,
style: const TextStyle(
color: AppColor.gray4,
fontSize: 14
),
),
);
}
Widget makeRowItemView({
required String name,
required Image icon,
required bool hasBottomLine,
Widget? rightItem,
void Function()? onClick
}) {
return InkWell(
onTap: () {
if (onClick != null) {
onClick();
}
},
child: Container(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Row(
children: [
icon,
const SizedBox(width: 10,),
Expanded(
child: Container(
padding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
decoration: BoxDecoration(
border: Border(
bottom: hasBottomLine ? const BorderSide(
width: 0.5,
color: AppColor.gray7
) : BorderSide.none
)
: SizedBox.shrink(),
// UserStore.to.isLogin
// ? Column(
// children: [
// SizedBox(
// height: 145,
// ),
// GestureDetector(
// onTap: () {
// UserStore.to.logout();
// Get.back();
// },
// child: Container(
// width: Get.width - 40,
// height: 45,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.all(Radius.circular(45 / 2.0)),
// color: Color(0xFF6F35A5)),
// child: Text(
// "退出".toUpperCase(),
// ),
// ),
// ),
// ],
// )
// : SizedBox.shrink()
// GradientButton(child: Text("321"), callback: () {})
),
child: Row(
children: [
Expanded(child: Text(name),),
rightItem ?? Container(width: 0,),
Image.asset("assets/images/row_arrow_icon.png", width: 25, height: 25,)
],
),
)
)
],
));
),
),
);
}
Widget makeCurrencySectionView() {
final controller = Get.find<MyController>();
return Container(
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(10)
),
child: Column(
children: [
makeRowItemView(
name: "添加键盘",
icon: Image.asset("assets/images/键盘_icon.png", width: 25, height: 25,),
hasBottomLine: true,
onClick: () {
},
),
makeRowItemView(
name: "Siri集成",
icon: Image.asset("assets/images/siri-icon.png", width: 25, height: 25,),
hasBottomLine: true,
onClick: () {
},
),
makeRowItemView(
name: "清理缓存",
icon: Image.asset("assets/images/清理_icon.png", width: 25, height: 25,),
hasBottomLine: false,
rightItem: Container(
padding: const EdgeInsets.fromLTRB(0, 0, 10, 0),
child: Obx(() => Text("${controller.cacheSize.value}MB")),
),
onClick: () {
controller.goClearCache();
},
)
],
),
);
}
Widget makeSupportWeSectionView() {
final controller = Get.find<MyController>();
return Container(
decoration: BoxDecoration(
color: AppColor.gray3,
borderRadius: BorderRadius.circular(10)
),
child: Column(
children: [
makeRowItemView(
name: "关于我们",
icon: Image.asset("assets/images/关于-icon.png", width: 25, height: 25,),
hasBottomLine: true,
onClick: () {
Get.toNamed(AppRoutes.PRIVACT);
},
),
makeRowItemView(
name: "赏个好评",
icon: Image.asset("assets/images/点赞-icon.png", width: 25, height: 25,),
hasBottomLine: true,
onClick: () {
controller.goFeedback();
},
),
makeRowItemView(
name: "分享给好友",
icon: Image.asset("assets/images/分享-icon.png", width: 25, height: 25,),
hasBottomLine: false,
onClick: () {
controller.goShare();
},
)
],
),
);
}
Widget makeContentView() {
return SingleChildScrollView(
scrollDirection: Axis.vertical,
padding: const EdgeInsets.fromLTRB(15, 15, 15, 15),
child: Column(
children: [
Obx(() => makeMyInfoView()),
makeHistoryInfoView(),
makeVipView(),
makeSectionItemView("通用"),
makeCurrencySectionView(),
makeSectionItemView("支持我们"),
makeSupportWeSectionView(),
],
),
);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return GetBuilder<MyController>(
init: MyController(),
id: "my",
builder: (_) {
return Container(
// color: Colors.amber,
height: double.infinity,
// width: Get.width,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
decoration: const BoxDecoration(
color: AppColor.black1
),
child: Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
backgroundColor: const Color.fromARGB(0, 29, 33, 60),
appBar: AppBar(
elevation: 0,
title: const Text("设置"),
title: const Text("我的"),
bottomOpacity: 0.1,
backgroundColor: Color.fromARGB(0, 29, 33, 60),
backgroundColor: const Color.fromARGB(0, 29, 33, 60),
actions: [
InkWell(
onTap: () {
Get.toNamed(AppRoutes.SETTINGS_PAGE);
},
child: Container(
padding: const EdgeInsets.fromLTRB(0, 0, 20, 0),
child: Image.asset("assets/images/my_settings_icon.png", width: 30, height: 30,),
),
)
]
),
body: SafeArea(
child: _buildView(context),
child: makeContentView(),
),
),
);
},
);
}
}
}
\ No newline at end of file
import 'package:get/get.dart';
import 'controller.dart';
class SettingsBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<SettingsController>(() => SettingsController());
}
}
import 'dart:io';
import 'package:chart/pages/settings/widgets/share.dart';
import 'package:get/get.dart';
import 'package:fluwx/fluwx.dart';
import 'package:share_plus/share_plus.dart';
import '../../common/routers/names.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
class SettingsController extends GetxController {
SettingsController();
_initData() {
update(["settings"]);
}
dynamic getShareModel(ShareType shareType, ShareInfo shareInfo) {
var scene = fluwx.WeChatScene.SESSION;
switch (shareType) {
case ShareType.SESSION:
scene = fluwx.WeChatScene.SESSION;
break;
case ShareType.TIMELINE:
scene = fluwx.WeChatScene.TIMELINE;
break;
case ShareType.COPY_LINK:
break;
case ShareType.DOWNLOAD:
break;
}
if (shareInfo.img != null) {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
thumbnail: fluwx.WeChatImage.network(shareInfo.img),
scene: scene,
);
} else {
return fluwx.WeChatShareWebPageModel(
shareInfo.url,
title: shareInfo.title,
scene: scene,
);
}
}
_initFluwx() async {
await registerWxApi(
appId: 'wxac6457d4b052cc48',
doOnAndroid: true,
doOnIOS: true,
universalLink: 'https://order.1clickpass.com/app/',
);
var result = await isWeChatInstalled;
print('is installed $result');
}
handleToWx() async {
await fluwx.openWeChatCustomerServiceChat(
url: "https://work.weixin.qq.com/kfid/kfc4e77a401df6f7d09",
corpId: "wwe816b5b616eaf0f3");
// fluwx.shareToWeChat(
// WeChatShareTextModel("source text", scene: WeChatScene.TIMELINE));
}
handleShare() async {
await Share.shareWithResult(
'https://apps.apple.com/cn/app/ai%E5%86%99%E4%BD%9C%E5%A4%A7%E5%B8%88/id1671136252');
}
void onTap() {}
// @override
// void onInit() {
// super.onInit();
// }
@override
void onReady() {
super.onReady();
_initData();
_initFluwx();
}
// @override
// void onClose() {
// super.onClose();
// }
void virtualPay() {
if (Platform.isAndroid) {
Get.toNamed(AppRoutes.AN_PAY_LIST);
} else {
Get.toNamed(AppRoutes.PAY_LIST);
}
}
}
import 'package:bruno/bruno.dart';
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/store.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gradient_widgets/gradient_widgets.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
import 'index.dart';
import 'widgets/share.dart';
class SettingsPage extends GetView<SettingsController> {
const SettingsPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView(context) {
final c = Get.put(UserStore());
return Obx(() => ListView(
padding: EdgeInsets.symmetric(horizontal: 10),
children: [
Obx(() => GestureDetector(
onTap: () {
if (UserStore.to.isLogin) {
} else {
Get.toNamed(AppRoutes.SIGN_IN);
}
},
child: Row(
children: [
Container(
width: 60,
height: 60,
child: ClipRRect(
borderRadius: BorderRadius.circular(60.0),
child: Image.asset(
"assets/images/60x3.png",
fit: BoxFit.contain,
),
)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Text(
"用户名:${UserStore.to.profile.username.isEmpty ? '游客' : UserStore.to.profile.username}",
textAlign: TextAlign.left,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
!UserStore.to.isLogin
? Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Text(
'您还未登录,点击登录。',
textAlign: TextAlign.center,
style: TextStyle(
color: Color.fromARGB(255, 160, 165, 184),
),
),
)
: c.profile.expireTime == null
? Padding(
padding: EdgeInsets.only(left: 20),
child: Text(
"您还不是 VIP 会员",
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 16,
fontWeight: FontWeight.bold),
))
: Align(
alignment: Alignment.centerLeft,
child: Container(
// color: Colors.amber,
padding: EdgeInsets.symmetric(
horizontal: 20, vertical: 0),
child: RichText(
textAlign: TextAlign.left,
text: TextSpan(children: [
const TextSpan(
text: '会员到期时间:',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
TextSpan(
style: TextStyle(
fontSize: 12,
),
text:
"${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}"),
const TextSpan(
text: ',剩余积分:',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
TextSpan(
text: '${c.profile.integral}',
style: const TextStyle(
fontSize: 12,
),
),
const TextSpan(
text: '分。',
style: TextStyle(
color: Color.fromARGB(
255, 160, 165, 184),
fontSize: 12,
),
),
// Text(
// "您的VIP会员资格将于" +
// "${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}" +
// "过期,如果您是自动续费会员将会在过期日前一天自动续费。",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: color,
// fontSize: 14,
// ),
// )
])),
),
)
],
)),
UserStore.to.isLogin
? SizedBox.shrink()
: SizedBox(
width: 60,
child: Center(
child:
Icon(Icons.arrow_forward_ios_outlined)),
),
],
),
)),
UserStore.to.isLogin
? Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.virtualPay();
},
child: Ink(
width: Get.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: const LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.monetization_on_outlined),
SizedBox(
width: 10,
),
Text('购买订阅')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
)
: SizedBox.shrink(),
Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
Get.toNamed(AppRoutes.USER_EULA);
},
child: Ink(
width: Get.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: const LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.event_note_outlined),
SizedBox(
width: 10,
),
Text('服务协议')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
),
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
Get.toNamed(AppRoutes.PRIVACT);
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.privacy_tip),
SizedBox(
width: 10,
),
Text('隐私政策')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
),
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.handleToWx();
// showModalBottomSheet(
// /**
// * showModalBottomSheet常用属性
// * shape 设置形状
// * isScrollControlled:全屏还是半屏
// * isDismissible:外部是否可以点击,false不可以点击,true可以点击,点击后消失
// * backgroundColor : 设置背景色
// */
// backgroundColor: Colors.transparent,
// context: context,
// builder: (BuildContext context) {
// return ShareWidget(
// ShareInfo('Hello world', 'http://www.baidu.com'),
// list: [
// ShareOpt(
// title: '朋友圈',
// img: 'assets/images/icon_wechat_moments.jpg',
// shareType: ShareType.TIMELINE,
// doAction: (shareType, shareInfo) {
// var model = controller.getShareModel(
// shareType, shareInfo);
// fluwx.shareToWeChat(model);
// })
// ],
// );
// });
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const Icon(Icons.wechat),
SizedBox(
width: 10,
),
Text('微信客服')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
),
Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.handleShare();
// showModalBottomSheet(
// /**
// * showModalBottomSheet常用属性
// * shape 设置形状
// * isScrollControlled:全屏还是半屏
// * isDismissible:外部是否可以点击,false不可以点击,true可以点击,点击后消失
// * backgroundColor : 设置背景色
// */
// backgroundColor: Colors.transparent,
// context: context,
// builder: (BuildContext context) {
// return ShareWidget(
// ShareInfo('Hello world', 'http://www.baidu.com'),
// list: [
// ShareOpt(
// title: '朋友圈',
// img: 'assets/images/icon_wechat_moments.jpg',
// shareType: ShareType.TIMELINE,
// doAction: (shareType, shareInfo) {
// var model = controller.getShareModel(
// shareType, shareInfo);
// fluwx.shareToWeChat(model);
// })
// ],
// );
// });
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const Icon(Icons.ios_share_outlined),
SizedBox(
width: 10,
),
Text('分享APP')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
),
UserStore.to.isLogin
? Container(
margin: const EdgeInsets.only(top: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text('提示'),
content: Text('确定要退出吗?'),
actions: <Widget>[
CupertinoDialogAction(
child: Text('取消'),
onPressed: () {
Navigator.pop(context); // 关闭弹窗
},
),
CupertinoDialogAction(
child: Text('确定'),
onPressed: () {
UserStore.to.logout();
// Get.back();
Navigator.pop(context); // 关闭弹窗
},
),
],
);
},
);
},
child: Ink(
width: Get.width,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
gradient: LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(Icons.logout),
SizedBox(
width: 10,
),
Text('退出登录')
],
),
const Icon(Icons.arrow_forward_ios_outlined),
]),
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
)
: SizedBox.shrink(),
// UserStore.to.isLogin
// ? Column(
// children: [
// SizedBox(
// height: 145,
// ),
// GestureDetector(
// onTap: () {
// UserStore.to.logout();
// Get.back();
// },
// child: Container(
// width: Get.width - 40,
// height: 45,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.all(Radius.circular(45 / 2.0)),
// color: Color(0xFF6F35A5)),
// child: Text(
// "退出".toUpperCase(),
// ),
// ),
// ),
// ],
// )
// : SizedBox.shrink()
// GradientButton(child: Text("321"), callback: () {})
],
));
}
@override
Widget build(BuildContext context) {
return GetBuilder<SettingsController>(
init: SettingsController(),
id: "settings",
builder: (_) {
return Container(
// color: Colors.amber,
height: double.infinity,
// width: Get.width,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
),
child: Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
appBar: AppBar(
elevation: 0,
title: const Text("设置"),
bottomOpacity: 0.1,
backgroundColor: Color.fromARGB(0, 29, 33, 60),
),
body: SafeArea(
child: _buildView(context),
),
),
);
},
);
}
}
......@@ -10,6 +10,7 @@ import device_info_plus
import firebase_auth
import firebase_core
import flutter_tts
import in_app_review
import package_info
import path_provider_foundation
import share_plus
......@@ -26,6 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
......
......@@ -949,6 +949,22 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.3"
in_app_review:
dependency: "direct main"
description:
name: in_app_review
sha256: "16328b8202d36522322b95804ae5d975577aa9f584d634985849ba1099645850"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.6"
in_app_review_platform_interface:
dependency: transitive
description:
name: in_app_review_platform_interface
sha256: b12ec9aaf6b34d3a72aa95895eb252b381896246bdad4ef378d444affe8410ef
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.4"
intl:
dependency: "direct main"
description:
......
......@@ -133,6 +133,7 @@ dependencies:
fluwx: ^3.13.1
flutter_native_splash: ^2.2.19
image_gallery_saver: '^2.0.2'
in_app_review: ^2.0.6
# package:bubble/bubble.dart
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