Commit 405ae83f authored by 关振斌's avatar 关振斌

update uikit

parent adf14af8
......@@ -79,6 +79,8 @@ PODS:
- OrderedSet (~> 5.0)
- flutter_keyboard_visibility (0.0.1):
- Flutter
- flutter_tts (0.0.1):
- Flutter
- flutter_vibrate (0.0.1):
- Flutter
- fluttercontactpicker (4.6.0):
......@@ -156,6 +158,7 @@ DEPENDENCIES:
- flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`)
- fluttercontactpicker (from `.symlinks/plugins/fluttercontactpicker/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
......@@ -216,6 +219,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
flutter_vibrate:
:path: ".symlinks/plugins/flutter_vibrate/ios"
fluttercontactpicker:
......@@ -268,6 +273,7 @@ SPEC CHECKSUMS:
flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
flutter_vibrate: 9f4c2ab57008965f78969472367c329dd77eb801
fluttercontactpicker: d582836dea6b5d489f3d259f35d7817ae82ee5e6
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
......
......@@ -361,16 +361,17 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4;
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
......@@ -493,16 +494,17 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4;
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
......@@ -519,16 +521,17 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "AI写作大师";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4;
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
......
import 'package:chart/common/entities/detail.dart';
import 'package:chart/common/entities/entities.dart';
import 'package:chart/common/entities/scene.dart';
import 'package:chart/common/entities/selectAllEntity.dart';
import 'package:chart/common/utils/utils.dart';
......@@ -70,6 +71,17 @@ class UserAPI {
}
}
static Future<int> sceneConversion(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/openAi/sceneConversion',
data: parameters,
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
// /scene/sceneConversion
static Future<int> endConversion(Map<String, dynamic> parameters) async {
var response = await HttpUtil().get(
'/openAi/endConversion?conversionId=${parameters['conversionId']}',
......@@ -100,6 +112,19 @@ class UserAPI {
// return ApplePayEntity.fromMap(response['data']);
}
//无上下文对话
static Future<int> aiAnswerWithoutSave(
Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/openAi/aiAnswerWithoutSave',
data: parameters,
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
// /openAi/aiAnswerWithoutSave
//获取所有列表
static Future<SelectAllEntity> selectAll() async {
var response = await HttpUtil().get(
......@@ -125,6 +150,28 @@ class UserAPI {
//
//home 重制回话
static Future<int> resetConversion() async {
var response = await HttpUtil().post(
'/openAi/resetConversion',
data: {},
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
//home 保存问题
static Future<int> saveRespTemp(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/openAi/saveRespTemp',
data: parameters,
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
///api/ 保存问题
static Future<int> saveResp(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
......@@ -145,6 +192,16 @@ class UserAPI {
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
static Future<SceneEntity> getSceneList() async {
var response = await HttpUtil().get(
'/scene/getSceneList',
);
return SceneEntity.fromJson(response);
// UserInfoEntity.fromMap(response['data']);
// UserLoginResponseEntity.fromJson(response);
}
// /
// /api/
// openAi/createConversion
......
class SceneEntity {
int? _status;
String? _message;
List<SceneItem>? _data;
int? _timestamp;
SceneEntity(
{int? status, String? message, List<SceneItem>? data, int? timestamp}) {
if (status != null) {
this._status = status;
}
if (message != null) {
this._message = message;
}
if (data != null) {
this._data = data;
}
if (timestamp != null) {
this._timestamp = timestamp;
}
}
int? get status => _status;
set status(int? status) => _status = status;
String? get message => _message;
set message(String? message) => _message = message;
List<SceneItem>? get data => _data;
set data(List<SceneItem>? data) => _data = data;
int? get timestamp => _timestamp;
set timestamp(int? timestamp) => _timestamp = timestamp;
SceneEntity.fromJson(Map<String, dynamic> json) {
_status = json['status'];
_message = json['message'];
if (json['data'] != null) {
_data = <SceneItem>[];
json['data'].forEach((v) {
_data!.add(new SceneItem.fromJson(v));
});
}
_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!.map((v) => v.toJson()).toList();
}
data['timestamp'] = this._timestamp;
return data;
}
}
class SceneItem {
int? _id;
String? _sceneName;
String? _sceneDesc;
String? _scenePre;
int? _isShow;
String? _icon;
SceneItem(
{int? id,
String? sceneName,
String? sceneDesc,
String? scenePre,
int? isShow,
String? icon}) {
if (id != null) {
this._id = id;
}
if (sceneName != null) {
this._sceneName = sceneName;
}
if (sceneDesc != null) {
this._sceneDesc = sceneDesc;
}
if (scenePre != null) {
this._scenePre = scenePre;
}
if (isShow != null) {
this._isShow = isShow;
}
if (icon != null) {
this._icon = icon;
}
}
int? get id => _id;
set id(int? id) => _id = id;
String? get sceneName => _sceneName;
set sceneName(String? sceneName) => _sceneName = sceneName;
String? get sceneDesc => _sceneDesc;
set sceneDesc(String? sceneDesc) => _sceneDesc = sceneDesc;
String? get scenePre => _scenePre;
set scenePre(String? scenePre) => _scenePre = scenePre;
int? get isShow => _isShow;
set isShow(int? isShow) => _isShow = isShow;
String? get icon => _icon;
set icon(String? icon) => _icon = icon;
SceneItem.fromJson(Map<String, dynamic> json) {
_id = json['id'];
_sceneName = json['sceneName'];
_sceneDesc = json['sceneDesc'];
_scenePre = json['scenePre'];
_isShow = json['isShow'];
_icon = json['icon'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this._id;
data['sceneName'] = this._sceneName;
data['sceneDesc'] = this._sceneDesc;
data['scenePre'] = this._scenePre;
data['isShow'] = this._isShow;
data['icon'] = this._icon;
return data;
}
}
......@@ -21,5 +21,7 @@ class AppRoutes {
static const CREATION_PAGE_DETAIL = '/creation-detail';
static const ASSISTANT_PAGE = '/assistant';
static const MY_PAGE = '/my';
static const ASSISTANT_ITEM = '/creation-item';
// AssistantItemBinding
// UserPrivacyPage
}
import 'package:chart/pages/assistant-item/index.dart';
import 'package:chart/pages/assistant/index.dart';
import 'package:chart/pages/chat/view.dart';
import 'package:chart/pages/creation-detail/index.dart';
......@@ -189,6 +190,11 @@ class AppPages {
name: AppRoutes.CREATION_PAGE_DETAIL,
page: () => const CreationDetailPage(),
binding: CreationDetailBinding(),
),
GetPage(
name: AppRoutes.ASSISTANT_ITEM,
page: () => AssistantItemPage(),
binding: AssistantItemBinding(),
)
];
......
......@@ -2,7 +2,8 @@
// const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008';
// const SERVER_API_URL = 'http://192.168.120.175: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.121.180:8083/api';//线上
//http://192.168.2.178:8083/api/doc.html
// const SERVER_API_URL = "http://192.168.120.108:8083/api";
// http://192.168.110.127:8083/api/doc.html
......
......@@ -13,9 +13,10 @@ AppBar transparentAppBar({
// elevation: 2,
title: title,
elevation: 0,
leadingWidth: 115,
leadingWidth: 90,
leading: leading ?? null,
actions: actions,
centerTitle: true,
);
}
......
......@@ -6,13 +6,19 @@ class ChartTTS {
String voiceName;
double volume;
double speechRate;
double pitch;
String language = "zh-CN";
static ChartTTS tts = ChartTTS();
ChartTTS({this.voiceName = "zh", this.volume = 1.0, this.speechRate = 1.0}) {
ChartTTS(
{this.voiceName = "zh",
this.volume = 1.0,
this.speechRate = 0.5,
this.pitch = 1.0}) {
flutterTts.setLanguage(language);
flutterTts.setVolume(volume);
flutterTts.setSpeechRate(speechRate);
flutterTts.setPitch(1.0);
flutterTts.setSpeechRate(0.5);
}
final FlutterTts _flutterTts = FlutterTts();
......
......@@ -229,8 +229,9 @@ class _DefaultMessageTextState extends State<DefaultMessageText> {
borderRadius: BorderRadius.circular(5),
child: Container(
width: 100,
padding: EdgeInsets.only(left: 5,top:5,right: 5,bottom: 5),
decoration: BoxDecoration(gradient: LinearGradient(
padding: EdgeInsets.only(left: 5, top: 5, right: 5, bottom: 5),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF3d3f54), Color(0xFF333450), Color(0xFF2b2b4d)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
......
......@@ -154,13 +154,13 @@ class ApplicationController extends GetxController {
label: '私人助理',
backgroundColor: AppColors.primaryBackground,
),
const BottomNavigationBarItem(
icon: Image(image: AssetImage("assets/images/my.png"), width: 30.0),
activeIcon: Image(
image: AssetImage("assets/images/my-selected.png"), width: 30.0),
label: '我的',
backgroundColor: AppColors.primaryBackground,
),
// const BottomNavigationBarItem(
// icon: Image(image: AssetImage("assets/images/my.png"), width: 30.0),
// activeIcon: Image(
// image: AssetImage("assets/images/my-selected.png"), width: 30.0),
// label: '我的',
// backgroundColor: AppColors.primaryBackground,
// ),
];
pageController = PageController(initialPage: state.page);
}
......
......@@ -49,7 +49,7 @@ class ApplicationPage extends GetView<ApplicationController> {
HomePage(),
CreationPage(),
AssistantPage(),
MyPage()
// MyPage()
]);
}
......
import 'package:get/get.dart';
import 'controller.dart';
class AssistantItemBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<AssistantItemController>(() => AssistantItemController());
}
}
import 'dart:convert';
import 'package:chart/common/apis/user.dart';
import 'package:chart/common/store/store.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart';
import 'package:flutter_client_sse/flutter_client_sse.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import '../../common/values/values.dart';
import 'index.dart';
Chat.ChatUser _user = Chat.ChatUser(
id: '1',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
final receiveUser = Chat.ChatUser(
id: '82091008-a484-4a89-ae75-a22bf8d6f3aa',
// firstName: "A",
// lastName: 'I',
// imageUrl:
// "https://imgb15.photophoto.cn/20201124/jiqirentupian-39852917_3.jpg"
// // imageUrl: "assets/images/300.jpg",
);
class AssistantItemController extends GetxController {
AssistantItemController();
static AssistantItemController get to => Get.put(AssistantItemController());
final state = AssistantItemState();
// tap
void handleTap(int index) {
Get.snackbar(
"标题",
"消息",
);
}
tabMessage(ChatMessage message) {
if (message.user.id == '0' && !state.isLoading) {
sendMessage(Chat.ChatMessage(
text: "${message.text}",
user: _user,
createdAt: DateTime.now(),
));
}
// Clipboard.setData(ClipboardData(text: message?.text));
// EasyLoading.showSuccess("复制成功");
// Get.snackbar("复制成功", "", colorText: Colors.white);
}
void sendMessage(Chat.ChatMessage message) async {
Vibrate.feedback(FeedbackType.impact);
final textMessage = Chat.ChatMessage(
user: _user,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "${message.text}",
);
_addMessage(textMessage);
final receiveMessage = Chat.ChatMessage(
user: receiveUser,
createdAt: DateTime.now(),
status: MessageStatus.pending,
// id: const Uuid().v4(),
text: "LOADING",
);
_addMessage(receiveMessage);
try {
await initEventSource();
state.isLoading = true;
await UserAPI.sceneConversion({
"conversionId": state.actId,
"question": message.text,
"sceneId": state.selectItem['sceneId'],
});
} catch (e) {}
// final loadingMessage = types.TextMessage(
// author: receiveUser,
// createdAt: DateTime.now().millisecondsSinceEpoch,
// id: const Uuid().v4(),
// text: "loading",
// status: types.Status.sending,
// // "sending",
// );
}
initEventSource() async {
SSEClient.subscribeToSSE(
url: "$SERVER_API_URL/openAi/connect/${UserStore.to.profile.id}",
header: {}).listen((event) async {
print(event);
if (event.data!.trim().isEmpty) {
return;
} else if (event.id == "[DONE]") {
await UserAPI.saveResp({
"conversionId": state.actId,
"content": state.messageList[0].text,
});
state.isLoading = false;
return;
}
Map<String, dynamic> jsonMap = jsonDecode("${event.data}");
_updateMessage("${jsonMap['content']}" as String);
});
// print(sse);
}
void _addMessage(Chat.ChatMessage message) {
state.messageList.insert(0, message);
}
_updateMessage(String text) {
if (state.messageList.isEmpty) {
return;
}
state.messageList.setRange(0, 1, [
ChatMessage(
user: receiveUser,
createdAt: DateTime.now(),
text: state.messageList.value[0].text == "LOADING"
? text
: state.messageList.value[0].text + text
// user: receiveUser,
// createdAt: DateTime.now(),
// // id: const Uuid().v4(),
// text: "",
)
]);
// state.messageList.value = [...state.messageList.value];list.setRange(1, 4, [9, 9, 9]);
// state.messageList.value[0].text = state.messageList.value[0].text + text;
}
/// 在 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 assistant_item;
export './state.dart';
export './controller.dart';
export './bindings.dart';
export './view.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
class AssistantItemState {
// title
final _title = "".obs;
set title(value) => _title.value = value;
get title => _title.value;
final _actId = 0.obs;
set actId(value) => _actId.value = value;
get actId => _actId.value;
final _selectItem = {}.obs;
set selectItem(value) => _selectItem.value = value;
get selectItem => _selectItem.value;
final _isLoading = false.obs;
set isLoading(value) => _isLoading.value = value;
get isLoading => _isLoading.value;
RxList<Chat.ChatMessage> messageList = <Chat.ChatMessage>[].obs;
final color = Colors.white.obs;
}
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:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import 'package:gradient_widgets/gradient_widgets.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class AssistantItemPage extends GetView<AssistantItemController> {
const AssistantItemPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return const HelloWidget();
}
@override
Widget build(BuildContext context) {
final cc = Get.put(AssistantItemController());
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
),
child: Obx(
() => Scaffold(
backgroundColor: Color.fromARGB(0, 0, 0, 0),
appBar: AppBar(
elevation: 0,
backgroundColor: Color.fromARGB(0, 0, 0, 0),
actions: [],
title: RichText(
textAlign: TextAlign.center,
text: TextSpan(children: [
TextSpan(
text: "${controller.state.selectItem['title']}",
style: TextStyle(
color: AppColors.primaryElementText,
fontFamily: 'Montserrat',
fontSize: 18,
fontWeight: FontWeight.w600,
)),
TextSpan(
text: "${controller.state.messageList.length}",
style: TextStyle(fontSize: 0)),
])),
),
body: KeyboardVisibilityBuilder(builder: (context, visible) {
return Chat.DashChat(
inputOptions: Chat.InputOptions(
textInputAction: TextInputAction.send,
sendOnEnter: true,
// showTraillingBeforeSend: true,
// inputDisabled: cc.state.isLoading,
inputTextStyle: TextStyle(color: Colors.white),
inputToolbarStyle: BoxDecoration(
color: Color.fromARGB(120, 0, 0, 0),
// Color.fromARGB(0, 54, 59, 72),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16)),
),
inputToolbarMargin: EdgeInsets.all(0),
sendButtonBuilder: null,
inputToolbarPadding: EdgeInsets.only(
top: 15,
right: 15,
left: 15,
bottom: visible ? 15 : 50),
),
currentUser: _user,
onSend: cc.sendMessage,
messages: cc.state.messageList,
messageOptions: Chat.MessageOptions(
onPressMessage: cc.tabMessage,
// containerColor: Colors.black,
),
);
})),
));
}
// Widget build(BuildContext context) {
// final cc = Get.put(AssistantItemController());
// return GetBuilder<AssistantItemController>(
// builder: (_) {
// return Container(
// decoration: BoxDecoration(
// image: DecorationImage(
// image: Image.asset("assets/images/background.png").image,
// fit: BoxFit.cover),
// ),
// child: Obx(
// () => Scaffold(
// backgroundColor: Color.fromARGB(0, 29, 33, 60),
// appBar: AppBar(
// backgroundColor: Color.fromARGB(0, 29, 33, 60),
// title: Text('${cc.state.selectItem['title']}'),
// elevation: 0),
// body: Container(child:
// KeyboardVisibilityBuilder(builder: (context, visible) {
// return Obx(() => Chat.DashChat(
// inputOptions: Chat.InputOptions(
// textInputAction: TextInputAction.send,
// sendOnEnter: true,
// // showTraillingBeforeSend: true,
// inputDisabled: cc.state.isLoading,
// inputTextStyle: const TextStyle(color: Colors.white),
// inputToolbarStyle: const BoxDecoration(
// color: Color.fromARGB(120, 0, 0, 0),
// // Color.fromARGB(0, 54, 59, 72),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(16),
// topRight: Radius.circular(16)),
// ),
// inputToolbarMargin: EdgeInsets.all(0),
// sendButtonBuilder: null,
// inputToolbarPadding: EdgeInsets.only(
// top: 15,
// right: 15,
// left: 15,
// bottom: visible ? 15 : 40),
// ),
// currentUser: _user,
// onSend: cc.sendMessage,
// messages: cc.state.messageList,
// // messageOptions: const Chat.MessageOptions(
// // // onPressMessage: cc.tabMessage/,
// // // containerColor: Colors.black,
// // ),
// ));
// })),
// ),
// ));
// },
// );
// }
// Widget build(BuildContext context) {
// return GetBuilder<AssistantItemController>(
// builder: (_) {
// return Scaffold(
// appBar: AppBar(title: const Text(c)),
// body: SafeArea(
// child: _buildView(),
// ),
// );
// },
// );
// }
}
Chat.ChatUser _user = Chat.ChatUser(
id: '1',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:get/get.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import '../index.dart';
/// hello
class HelloWidget extends GetView<AssistantItemController> {
const HelloWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(child: KeyboardVisibilityBuilder(builder: (context, visible) {
return Obx(() => Chat.DashChat(
inputOptions: Chat.InputOptions(
textInputAction: TextInputAction.send,
sendOnEnter: true,
// showTraillingBeforeSend: true,
inputDisabled: controller.state.isLoading,
inputTextStyle: const TextStyle(color: Colors.white),
inputToolbarStyle: const BoxDecoration(
color: Color.fromARGB(120, 0, 0, 0),
// Color.fromARGB(0, 54, 59, 72),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16)),
),
inputToolbarMargin: EdgeInsets.all(0),
sendButtonBuilder: null,
inputToolbarPadding: EdgeInsets.only(
top: 15, right: 15, left: 15, bottom: visible ? 15 : 40),
),
currentUser: _user,
onSend: controller.sendMessage,
messages: controller.state.messageList,
messageOptions: const Chat.MessageOptions(
// onPressMessage: cc.tabMessage,
// containerColor: Colors.black,
),
));
}));
}
}
Chat.ChatUser _user = Chat.ChatUser(
id: '1',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
library widgets;
export './hello.dart';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/scene.dart';
import 'package:chart/common/routers/names.dart';
import 'package:chart/pages/assistant-item/controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:get/get.dart';
import 'package:loading_animation_widget/loading_animation_widget.dart';
class AssistantController extends GetxController {
AssistantController();
_initData() {
update(["assistant"]);
final sceneList = [].obs;
_initData() async {
SceneEntity res = await UserAPI.getSceneList();
sceneList.addAll(res.data!);
}
void onTap() {}
void onTap(item) async {
EasyLoading.show(
status: "加载中",
dismissOnTap: false,
maskType: EasyLoadingMaskType.none,
indicator: LoadingAnimationWidget.staggeredDotsWave(
color: Colors.white,
size: 30,
));
Vibrate.feedback(FeedbackType.impact);
final res = await UserAPI.createConversion();
EasyLoading.dismiss();
AssistantItemController.to.state.actId = res;
AssistantItemController.to.state.selectItem = {
'title': item.sceneName,
'sceneId': item.id
};
AssistantItemController.to.state.messageList.clear();
// CreationDetailController.to
// .updateState('${item.id}', item.detailName, res.data!);
Get.toNamed(AppRoutes.ASSISTANT_ITEM);
// ASSISTANT_ITEM
}
// @override
// void onInit() {
......
......@@ -23,15 +23,29 @@ class GridWidget extends GetView<AssistantController> {
maxHeight: Get.height * .156,
child: Opacity(
opacity: .8,
child: Image.network(
width: double.infinity,
'https://www.hahagpt.com/images/assets/banner2.png',
height: Get.height * .16,
fit: BoxFit.cover
// ignore: prefer_const_constructors
// placeholder: CircularProgressIndicator(),
// errorWidget: Icon(Icons.error),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: FadeInImage(
fadeInDuration: Duration(milliseconds: 500),
placeholder: const AssetImage(
'assets/images/loading.gif'), // 加载指示器
image: NetworkImage(
'https://www.hahagpt.com/images/assets/banner2.png'),
// image: NetworkImage(
// 'https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.pinterest.com%2Fpin%2Fai-visualization-design-fui-artificial-intelligence-siri-filter-ai-loading-logo-flow-light--400538960609301125%2F&psig=AOvVaw0X4iFGabqA_JwUiW9zEG4u&ust=1680859399497000&source=images&cd=vfe&ved=0CA8QjRxqFwoTCLiAnK33lP4CFQAAAAAdAAAAABAb'), // 图像URL
fit: BoxFit.cover, // 图像适应方式
placeholderFit: BoxFit.cover, // 图像适应
),
)
// Image.network(
// width: double.infinity,
// 'https://www.hahagpt.com/images/assets/banner2.png',
// height: Get.height * .16,
// fit: BoxFit.cover
// // ignore: prefer_const_constructors
// // placeholder: CircularProgressIndicator(),
// // errorWidget: Icon(Icons.error),
// ),
//
// child:
// Container(
......@@ -42,7 +56,6 @@ class GridWidget extends GetView<AssistantController> {
// ),
)),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
......@@ -55,16 +68,23 @@ class GridWidget extends GetView<AssistantController> {
top: 10,
bottom: 20,
),
child: StaggeredGrid.count(
child: Obx(() => StaggeredGrid.count(
crossAxisCount: 1,
mainAxisSpacing: 20,
crossAxisSpacing: 10,
children: List.generate(100, (index) {
children: List.generate(controller.sceneList.length, (index) {
return StaggeredGridTile.count(
crossAxisCellCount: 1,
mainAxisCellCount: 0.31,
child: Container(
// margin: EdgeInsets.only(bottom: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
controller.onTap(controller.sceneList[index]);
},
child: Ink(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
......@@ -82,8 +102,25 @@ class GridWidget extends GetView<AssistantController> {
),
child: Row(
children: [
Image.network(
'https://www.hahagpt.com/images/yiliao.jpg'),
ClipRRect(
borderRadius: BorderRadius.circular(40),
child: FadeInImage(
width: 80,
height: 80,
fadeInDuration:
Duration(milliseconds: 500),
placeholder: const AssetImage(
'assets/images/loading.gif'), // 加载指示器
image: NetworkImage(
'${controller.sceneList[index].icon}'),
// image: NetworkImage(
// 'https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.pinterest.com%2Fpin%2Fai-visualization-design-fui-artificial-intelligence-siri-filter-ai-loading-logo-flow-light--400538960609301125%2F&psig=AOvVaw0X4iFGabqA_JwUiW9zEG4u&ust=1680859399497000&source=images&cd=vfe&ved=0CA8QjRxqFwoTCLiAnK33lP4CFQAAAAAdAAAAABAb'), // 图像URL
fit: BoxFit.cover, // 图像适应方式
placeholderFit: BoxFit.cover, // 图像适应
),
),
// Image.network(
// controller.sceneList[index].icon),
Expanded(
child: Container(
// color: Colors.red,
......@@ -96,18 +133,26 @@ class GridWidget extends GetView<AssistantController> {
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment
.spaceBetween,
children: [
Text('语言翻译'),
Text(controller
.sceneList[index]
.sceneName),
GradientButton(
child: Text('咨询',
style: TextStyle(
fontSize: 10)),
increaseHeightBy: -5.00,
increaseWidthBy: -10.00,
callback: () {},
callback: () {
controller.onTap(
controller.sceneList[
index]);
},
// controller.requestPurchase,
gradient: const LinearGradient(
gradient:
const LinearGradient(
colors: [
// 61, 63, 84
......@@ -119,8 +164,10 @@ class GridWidget extends GetView<AssistantController> {
Color(0xFF9c67f6),
Color(0xFF7965f8)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
begin:
Alignment.topCenter,
end: Alignment
.bottomCenter,
),
// shadowColor: Gradients
// .backToFuture.colors.last
......@@ -128,156 +175,26 @@ class GridWidget extends GetView<AssistantController> {
)
]),
Text(
"下面我让你来充当翻译家,你的目标是把任何语言翻译成英文,请翻译时不要带翻译腔,而是要翻译得自然、流畅和地道,使用优美和高雅的表达方式。",
"${controller.sceneList[index].sceneDesc}",
maxLines: 2,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 10))
]),
),
)
],
),
)),
// child: Ink(
// // decoration: BoxDecoration(
// // // color: Colors.amber.withOpacity(.5),
// // borderRadius: BorderRadius.circular(10),
// // ),
// child: GestureDetector(
// // radius: 20.0,
// // highlightColor: Colors.amber,
// // focusColor: Colors.black,
// // hoverColor: Colors.white,
// onTap: () {
// Vibrate.feedback(FeedbackType.impact);
// // print(12);
// // 点击事件
// },
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Padding(
// padding: EdgeInsets.only(left: 10, right: 10),
// child: Container(
// height: Get.height * 0.16,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// image: DecorationImage(
// image: Image.network(
// 'https://www.hahagpt.com/images/tousu.jpg')
// .image,
// fit: BoxFit.fitWidth,
// // colorFilter: ColorFilter.mode(Colors.red, BlendMode.colorBurn),
// ),
// ),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.end,
// children: [
// GradientButton(
// child: Text('2.8万人使用',
// style: TextStyle(fontSize: 10)),
// increaseHeightBy: -10.00,
// increaseWidthBy: -10.00,
// callback: () {},
// // controller.requestPurchase,
// gradient: Gradients.cosmicFusion,
// shadowColor: Gradients
// .backToFuture.colors.last
// .withOpacity(0.25),
// )
// ],
// )
// // Positioned(
// // child: ),
// )),
// Text("心情日志",
// style: TextStyle(
// fontFamily: 'Montserrat',
// fontWeight: FontWeight.w500,
// fontSize: 14)),
// Text("为您打开思绪",
// style: TextStyle(
// color: Color(0x908f8fc9), fontSize: 12))
// ],
// ),
// // child: Container(color: Colors.red),
// // child: const Overlay(
// // initialEntries: [],
// // )
// ),
// ),
// child: Ink(
// color: Colors.black.withOpacity(0.1),
// child: Container(
// // color: Colors.black,
// // color: Colors.black.withOpacity(0.5),
// child: Column(
// children: [
// Image.network(
// 'https://www.hahagpt.com/images/tousu.jpg')
// ],
// )),
// ),
);
}).toList()
// Range(1,100).to
// .map((e) => StaggeredGridTile.count(
// crossAxisCellCount: 1,
// mainAxisCellCount: 1.7,
// child: Container(color: Colors.black),
// ))
),
);
}).toList())),
);
},
childCount: 1,
))
// Positioned(
// left: 50,
// top: 50,
// child: Opacity(
// opacity: 0.1,
// child: Container(
// width: double.infinity,
// height: 100,
// color: Colors.red,
// ),
// )),
// Expanded(
// child:
// )
],
);
// return Container(
// alignment: Alignment.center,
// height: 100.w,
// padding: EdgeInsets.all(20.w),
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 20.w),
// decoration: BoxDecoration(
// border: Border.fromBorderSide(Borders.primaryBorder),
// borderRadius: Radii.k6pxRadius,
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "Tired of Ads? Get Premium - \$9.99",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: AppColors.primaryText,
// fontFamily: "Avenir",
// fontWeight: FontWeight.w400,
// fontSize: 18,
// height: 18 / 18,
// ),
// ),
// ],
// ),
// ),
// );
}
}
......
......@@ -23,15 +23,29 @@ class GridWidget extends GetView<CreationController> {
maxHeight: Get.height * .156,
child: Opacity(
opacity: .668,
child: Image.network(
width: double.infinity,
'https://www.hahagpt.com/images/assets/banner1.png',
height: Get.height * .16,
fit: BoxFit.cover
// ignore: prefer_const_constructors
// placeholder: CircularProgressIndicator(),
// errorWidget: Icon(Icons.error),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: FadeInImage(
fadeInDuration: Duration(milliseconds: 500),
placeholder: const AssetImage(
'assets/images/loading.gif'), // 加载指示器
image: NetworkImage(
'https://www.hahagpt.com/images/assets/banner1.png'),
// image: NetworkImage(
// 'https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.pinterest.com%2Fpin%2Fai-visualization-design-fui-artificial-intelligence-siri-filter-ai-loading-logo-flow-light--400538960609301125%2F&psig=AOvVaw0X4iFGabqA_JwUiW9zEG4u&ust=1680859399497000&source=images&cd=vfe&ved=0CA8QjRxqFwoTCLiAnK33lP4CFQAAAAAdAAAAABAb'), // 图像URL
fit: BoxFit.cover, // 图像适应方式
placeholderFit: BoxFit.cover, // 图像适应
),
)
// Image.network(
// width: double.infinity,
// 'https://www.hahagpt.com/images/assets/banner1.png',
// height: Get.height * .16,
// fit: BoxFit.cover
// // ignore: prefer_const_constructors
// // placeholder: CircularProgressIndicator(),
// // errorWidget: Icon(Icons.error),
// ),
//
// child:
// Container(
......@@ -90,22 +104,42 @@ class GridWidget extends GetView<CreationController> {
child: Container(
height: Get.height * 0.16,
decoration: BoxDecoration(
// color: Colors.red,
borderRadius:
BorderRadius.circular(10),
image: DecorationImage(
image: Image.network(
'${controller.list[index].icon}')
.image,
fit: BoxFit.fitHeight,
// colorFilter: ColorFilter.mode(Colors.red, BlendMode.colorBurn),
),
child: Stack(children: [
Positioned(
left: 0,
top: 0,
bottom: 0,
right: 0,
child: ClipRRect(
borderRadius:
BorderRadius.circular(10),
child: FadeInImage(
fadeInDuration: Duration(
milliseconds: 500),
placeholder: const AssetImage(
'assets/images/loading.gif'), // 加载指示器
image: NetworkImage(
'${controller.list[index].icon}'),
// image: NetworkImage(
// 'https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.pinterest.com%2Fpin%2Fai-visualization-design-fui-artificial-intelligence-siri-filter-ai-loading-logo-flow-light--400538960609301125%2F&psig=AOvVaw0X4iFGabqA_JwUiW9zEG4u&ust=1680859399497000&source=images&cd=vfe&ved=0CA8QjRxqFwoTCLiAnK33lP4CFQAAAAAdAAAAABAb'), // 图像URL
fit: BoxFit.cover, // 图像适应方式
placeholderFit:
BoxFit.cover, // 图像适应
),
child: Column(
)),
Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
// Stack()
GradientButton(
child: const Text('2.8万人使用',
child: Text(
'${controller.list[index].count}人使用',
style: TextStyle(
fontSize: 10)),
increaseHeightBy: -10.00,
......@@ -117,12 +151,6 @@ class GridWidget extends GetView<CreationController> {
// controller.requestPurchase,
gradient: const LinearGradient(
colors: [
// 61, 63, 84
// 180deg,
// #be6afb,
// #9c67f6,
// #7965f8
Color(0xFFbe6afb),
Color(0xFF9c67f6),
Color(0xFF7965f8)
......@@ -133,9 +161,7 @@ class GridWidget extends GetView<CreationController> {
)
],
)
// Positioned(
// child: ),
]),
)),
Text('${controller.list[index].detailName}',
style: TextStyle(
......
......@@ -48,7 +48,7 @@ class UserEulaPage extends GetView<UserEulaController> {
return GetBuilder<UserEulaController>(
builder: (_) {
return Scaffold(
appBar: transparentAppBar(
appBar: AppBar(
leading: IconButton(
tooltip: '返回上一页',
icon: const Icon(
......
......@@ -67,21 +67,6 @@ class ChatNewController extends GetxController {
void sendMessage(Chat.ChatMessage message) async {
print("${message.text}");
Vibrate.feedback(FeedbackType.impact);
// if (state.messageList.isNotEmpty) {
// // data = !_messages.every((element) => element.status != Status.sending);
// }
// if (data) {
// Fluttertoast.showToast(
// msg: "操作太快了 你上个问题还没问完呢",
// toastLength: Toast.LENGTH_SHORT,
// gravity: ToastGravity.CENTER,
// timeInSecForIosWeb: 1,
// backgroundColor: Colors.red,
// textColor: Colors.white,
// fontSize: 16.0);
// return;
// }
final textMessage = Chat.ChatMessage(
user: _user,
......@@ -176,19 +161,6 @@ class ChatNewController extends GetxController {
void _addMessage(Chat.ChatMessage message) {
state.messageList.insert(0, message);
// state.messageList = [message]
// state.messageList.add(message);
// state.messageList.add(message);
// updateState(state);
// update()
// update((state.messageList), {
// // state.messageList.value = [message]
// });
// user.update((value) {
// value?.name = "123";
// });
// state.messageList.value = [message];
}
void addCount() {
......
......@@ -20,8 +20,11 @@ class PayListController extends GetxController {
final state = PayListState();
final List<String> _productLists = [
"com.wudi.monthly_pass_chat",
"com.wudi.yearly_pass_chat",
"com.wudi.chat.week_pass",
"com.wudi.monthly_pass_chat_subscription",
"com.wudi.quarterly_pass_chat_subscription",
// "com.wudi.chat.halfyear_pass",
"com.wudi.yearly_pass_chat"
];
final List<dynamic> _mapData = [
......@@ -88,6 +91,7 @@ class PayListController extends GetxController {
});
if (res?.status == 200) {
state.loading = false;
EasyLoading.showSuccess('${res?.message}');
Vibrate.feedback(FeedbackType.success);
EasyLoading.dismiss();
......@@ -122,6 +126,7 @@ class PayListController extends GetxController {
} else {
await FlutterInappPurchase.instance.clearTransactionIOS();
EasyLoading.showError("${res?.message}}");
state.loading = false;
EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.error);
}
......@@ -133,6 +138,7 @@ class PayListController extends GetxController {
Vibrate.feedback(FeedbackType.error);
EasyLoading.showError('支付订单失败');
EasyLoading.dismiss();
state.loading = false;
});
}
......@@ -145,12 +151,13 @@ class PayListController extends GetxController {
for (var purchase in purchases!) {
// com.wudi.yearly_pass_chat
if (purchase.productId == 'com.wudi.yearly_pass_chat' ||
purchase.productId == "com.wudi.monthly_pass_chat") {
if (_productLists.contains(purchase.productId)) {
print(purchase.productId);
// // IAPItem item
FlutterInappPurchase.instance.requestPurchase(purchase.productId!);
EasyLoading.showSuccess("恢复购买成功");
} else {
EasyLoading.showInfo("没有查询到购买订单");
EasyLoading.dismiss();
}
......@@ -177,6 +184,7 @@ class PayListController extends GetxController {
}
void requestPurchase() {
state.loading = true;
Vibrate.feedback(FeedbackType.selection);
// print("${item.productId}");
EasyLoading.show(status: '支付中...');
......
......@@ -7,9 +7,13 @@ class PayListState {
set title(value) => this._title.value = value;
get title => this._title.value;
final _selected = "com.wudi.monthly_pass_chat".obs;
final _selected = "com.wudi.yearly_pass_chat".obs;
set selected(value) => _selected.value = value;
get selected => _selected.value;
final _loading = false.obs;
set loading(value) => _loading.value = value;
get loading => _loading.value;
RxList<IAPItem> items = <IAPItem>[].obs;
}
......@@ -33,6 +33,18 @@ class PayListPage extends GetView<PayListController> {
elevation: 0,
backgroundColor: const Color.fromARGB(0, 0, 0, 0),
title: Text("订阅中心"),
actions: <Widget>[
GestureDetector(
onTap: () {
controller.restorePurchases();
},
child: Container(
padding: EdgeInsets.only(right: 10),
child: Center(
child: Text("恢复购买"),
)),
)
],
),
backgroundColor: const Color.fromARGB(0, 0, 0, 0),
body: _buildView()
......
import 'dart:math';
import 'package:chart/common/routers/names.dart';
import 'package:chart/common/store/user.dart';
import 'package:flutter/material.dart';
......@@ -9,7 +11,9 @@ import 'package:glassy/glassy_config.dart';
import 'package:gradient_widgets/gradient_widgets.dart';
import 'package:url_launcher/url_launcher.dart';
import '../index.dart';
// import 'package:flutter_barrage/flutter_barrage.dart';
import 'package:flutter_barrage/flutter_barrage.dart';
import 'widgets.dart';
const color = Color(0xff8AFBFF);
......@@ -17,8 +21,21 @@ const color = Color(0xff8AFBFF);
class PayItemWidget extends GetView<PayListController> {
@override
Widget build(BuildContext context) {
Random random = new Random();
// List<Bullet> bullets = [];
List<Bullet> bullets = List<Bullet>.generate(1000, (i) {
final showTime = random.nextInt(60000); // in 60s
return Bullet(child: Text('$i-$showTime'), showTime: showTime);
});
final barrageWallController = BarrageWallController();
final textEditingController = TextEditingController();
// final textEditingController = TextEditingController();
final c = Get.put(UserStore());
return ListView(
return Column(
children: [
Expanded(
child: ListView(
children: [
Obx(() => c.profile.expireTime == null
? const Text(
......@@ -32,7 +49,8 @@ class PayItemWidget extends GetView<PayListController> {
alignment: Alignment.center,
child: Container(
// color: Colors.amber,
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 0),
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 0),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(children: [
......@@ -66,7 +84,529 @@ class PayItemWidget extends GetView<PayListController> {
])),
),
)),
MarqueeView(
child: Row(children: [
_buildText('手机用户159****0542购买了按年订阅套餐'),
_buildText('手机用户136****1949购买了按年订阅套餐'),
_buildText('手机用户159****1252购买了按年订阅套餐'),
_buildText('手机用户176****1429购买了按年订阅套餐'),
_buildText('手机用户158****8953购买了按年订阅套餐'),
_buildText('手机用户139****2752购买了按年订阅套餐'),
_buildText('手机用户130****5959购买了按年订阅套餐'),
_buildText('手机用户158****6048购买了按年订阅套餐'),
_buildText('手机用户136****8962购买了按年订阅套餐'),
]),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image(
image: Image.asset('assets/images/vip-2.png').image,
width: Get.width * 0.4,
),
Image(
image: Image.asset('assets/images/vip-1.png').image,
width: Get.width * 0.2,
)
],
),
),
Container(
margin: const EdgeInsets.all(10),
decoration: const BoxDecoration(
// Color.argb(255, 40, 40, 57)
color: Color.fromARGB(255, 40, 40, 57),
borderRadius: BorderRadius.all(Radius.circular(10))),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Column(children: [
Column(
children: [
Row(children: const [
Image(
image: AssetImage("assets/images/message.png"),
width: 30.0),
SizedBox(
width: 10,
),
Text('无限制AI消息回复')
]),
const SizedBox(
height: 10,
),
const Text(
'最新模型,消息秒回,超出人类智慧秒杀所有人工智能。',
style:
TextStyle(color: Color.fromARGB(255, 160, 165, 184)),
)
],
),
const SizedBox(
height: 20,
),
Column(
children: [
Row(children: const [
Image(
image: AssetImage("assets/images/project.png"),
width: 30.0),
SizedBox(
width: 10,
),
Text('最卷的 AI打工人')
]),
const SizedBox(
height: 10,
),
const Text(
'你的工作 AI写作大师 帮你完成,查资料,写计划,写报告,想灵感,写总结统统搞定。',
style:
TextStyle(color: Color.fromARGB(255, 160, 165, 184)),
)
],
),
const SizedBox(
height: 20,
),
Column(
children: [
Row(children: const [
Image(
image: AssetImage("assets/images/office.png"),
width: 30.0),
SizedBox(
width: 10,
),
Text('您的私人助理')
]),
const SizedBox(
height: 10,
),
const Text(
'学习,医疗,法律,旅游,翻译等任何生活问题 AI写作大师都能随时化身最专业的助手替您解决一切。',
style:
TextStyle(color: Color.fromARGB(255, 160, 165, 184)),
)
],
),
]),
),
Obx(
() => Container(
width: Get.width,
height: 140,
margin: EdgeInsets.all(10),
child: ListView(
// This next line does the trick.
scrollDirection: Axis.horizontal,
children: controller.state.items.reversed
.map((element) => Container(
// color: Colors.red,
margin: EdgeInsets.only(right: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
Vibrate.feedback(FeedbackType.selection);
controller.state.selected = element.productId!;
},
child: Ink(
padding: EdgeInsets.symmetric(
horizontal: 15, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
// border: ,Color.argb(255, 62, 67, 95)
border: Border.all(
width: 1,
color: controller.state.selected ==
element.productId
? Color.fromARGB(0, 0, 0, 0)
: Color.fromARGB(255, 90, 82, 91)),
gradient: LinearGradient(
colors: controller.state.selected ==
element.productId
? [
Color.fromARGB(
255, 247, 222, 127),
Color.fromARGB(
255, 246, 204, 135),
Color.fromARGB(255, 242, 189, 138)
]
: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
element.title!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state.selected ==
element.productId
? Color.fromARGB(255, 23, 17, 7)
: Colors.white),
),
Text(
element.localizedPrice!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state.selected ==
element.productId
? Color.fromARGB(255, 230, 31, 32)
: Color.fromARGB(
255, 241, 197, 131)),
),
Text(
${(int.parse(element.price!) * 1.2).toInt()}',
style: TextStyle(
color:
Color.fromARGB(255, 140, 145, 151),
decoration: TextDecoration.combine([
// TextDecoration.underline,
TextDecoration.lineThrough
]),
),
),
Text('限时特惠',
style: TextStyle(
color: controller.state.selected ==
element.productId
? Color.fromARGB(255, 230, 31, 32)
: Color.fromARGB(
255, 169, 171, 196),
decoration: TextDecoration.combine([
// TextDecoration.underline,
// TextDecoration.lineThrough
]),
))
],
),
),
)))
.toList()),
),
),
Container(
margin: const EdgeInsets.only(top: 10, bottom: 10),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 4,
height: 20,
decoration: const BoxDecoration(
color: Color.fromARGB(255, 99, 208, 243),
borderRadius: BorderRadius.all(Radius.circular(5)),
),
),
const SizedBox(
width: 10,
),
const Text('用户评论')
],
),
Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Row(children: [
Image(
width: 40,
image: Image.asset(
'assets/images/account_header.png')
.image),
SizedBox(
width: 10,
),
Text("182****1411"),
SizedBox(
width: 10,
),
Container(
padding: EdgeInsets.symmetric(
vertical: 6, horizontal: 10),
decoration: BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: [
Icon(
Icons.diamond_outlined,
size: 16,
color: Color.fromARGB(255, 246, 226, 145),
),
SizedBox(
width: 5,
),
Text(
'年度会员',
style: TextStyle(
color: Color.fromARGB(
255, 246, 226, 145)),
)
],
))
]),
Container(
height: 1,
color: Color.fromARGB(255, 39, 40, 56),
margin: EdgeInsets.symmetric(vertical: 10),
),
Text(
'作为公司小编,每天写文章很头疼,偶然发现这个软件,提高了我的工作效率。太赞了!',
style: TextStyle(
color: Color.fromARGB(255, 161, 161, 176)),
)
],
)),
Container(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Row(children: [
ClipRRect(
borderRadius: BorderRadius.circular(40),
child: Image.asset('assets/images/dog.jpg',
width: 40, height: 40),
),
const SizedBox(
width: 10,
),
const Text("130****5675"),
const SizedBox(
width: 10,
),
Container(
padding: const EdgeInsets.symmetric(
vertical: 6, horizontal: 10),
decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: const [
Icon(
Icons.diamond_outlined,
size: 16,
color: Color.fromARGB(255, 246, 226, 145),
),
SizedBox(
width: 5,
),
Text(
'年度会员',
style: TextStyle(
color: Color.fromARGB(
255, 246, 226, 145)),
)
],
))
]),
Container(
height: 1,
color: Color.fromARGB(255, 39, 40, 56),
margin: EdgeInsets.symmetric(vertical: 10),
),
const Text(
'用它来制定旅游计划真的很不错,以前出去玩要做十天半个月的攻略,现在分分钟搞定。',
style: TextStyle(
color: Color.fromARGB(255, 161, 161, 176)),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(children: [
ClipRRect(
borderRadius: BorderRadius.circular(40),
child: Image.asset('assets/images/feature-3.png',
width: 40, height: 40),
),
const SizedBox(
width: 10,
),
const Text("135****1903"),
const SizedBox(
width: 10,
),
Container(
padding: const EdgeInsets.symmetric(
vertical: 6, horizontal: 10),
decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: const [
Icon(
Icons.diamond_outlined,
size: 16,
color: Color.fromARGB(255, 246, 226, 145),
),
SizedBox(
width: 5,
),
Text(
'年度会员',
style: TextStyle(
color: Color.fromARGB(
255, 246, 226, 145)),
)
],
))
]),
Container(
height: 1,
color: const Color.fromARGB(255, 39, 40, 56),
margin: const EdgeInsets.symmetric(vertical: 10),
),
const Text(
'和软件聊天真的很有趣,它可以回答我的问题,并且让我感觉修在和一个真正的人交谈一样。',
style: TextStyle(
color: Color.fromARGB(255, 161, 161, 176)),
)
],
))
],
),
),
Container(
width: Get.width * 0.9,
margin: EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Text(
"说明:确认购买后,将向您的iTunes账户收款,如果选择自动续订,iTunes账户会在计费周期到期的前 24小时扣费。在此之前,您可以在系统[设置] - [Apple ID] 进行退订。",
style: TextStyle(
fontSize: 12,
color: Color.fromARGB(255, 164, 164, 183)),
// maxLines: 4,
),
const SizedBox(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
onTap: () async {
Get.toNamed(AppRoutes.USER_EULA);
// final Uri _url = Uri.parse(
// 'https://docs.qq.com/doc/DY3pybXJ5Y1JLQm13');
// await launchUrl(_url);
},
child: RichText(
text: const TextSpan(children: [
TextSpan(
text: 'Tap To view the ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color.fromARGB(
255, 164, 164, 183))),
TextSpan(
text: 'EULA',
style: TextStyle(
color: color,
fontWeight: FontWeight.bold)),
]),
),
// child: Text(
// "Tap To view the EULA",
// style: TextStyle(color: Colors.white),
// ),
),
]),
]))
],
)),
Container(
padding: const EdgeInsets.only(
top: 10,
bottom: 50,
),
decoration: BoxDecoration(
color: const Color(0xFF3d3f54).withOpacity(.8),
// gradient: const LinearGradient(
// colors: [Color(0xFF3d3f54), Color(0xFF333450), Color(0xFF2b2b4d)],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// )
),
width: Get.width,
child: Obx(
() => GradientButton(
increaseHeightBy: 10.00,
increaseWidthBy: Get.width * .7,
callback: () {
controller.requestPurchase();
},
isEnabled: !controller.state.loading,
// callback: controller.genInner,
shapeRadius: const BorderRadius.all(Radius.circular(5)),
// controller.requestPurchase,
// gradient: Gradients.cosmicFusion,
// background-image: linear-gradient(180deg, #3d3f54, #333450, #2b2b4d);
elevation: 0,
gradient: const LinearGradient(
colors: [
// 61, 63, 84
// 180deg,
// #be6afb,
// #9c67f6,
// #7965f8
Color(0xFFbe6afb),
Color(0xFF9c67f6),
Color(0xFF7965f8)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
child: const Text('立即解锁',
style:
TextStyle(fontSize: 14, fontWeight: FontWeight.w500)),
),
))
],
);
}
}
Widget _buildText(String txt) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
margin: EdgeInsets.only(right: 20),
decoration: const BoxDecoration(
color: Color.fromARGB(255, 42, 43, 61),
borderRadius: BorderRadius.all(Radius.circular(40))),
child: Text(
txt,
style: const TextStyle(
fontSize: 12,
color: Color.fromARGB(255, 160, 165, 184),
),
maxLines: 1,
overflow: TextOverflow.fade,
));
}
import 'package:flutter/material.dart';
class MarqueeView extends StatefulWidget {
final Duration pauseDuration, forwardDuration;
final double scrollSpeed; //滚动速度(时间单位是秒)。
final Widget child; //子视图。
/// 注: 构造函数入参的默认值必须是常量。
const MarqueeView(
{Key? key,
this.pauseDuration = const Duration(milliseconds: 100),
this.forwardDuration = const Duration(milliseconds: 2000),
this.scrollSpeed = 50.0,
required this.child})
: super(key: key);
@override
_MarqueeViewState createState() => _MarqueeViewState();
}
class _MarqueeViewState extends State<MarqueeView>
with SingleTickerProviderStateMixin {
bool _validFlag = true;
double _boxWidth = 0;
final ScrollController _controller = ScrollController();
@override
void dispose() {
_validFlag = false;
_controller.dispose();
super.dispose();
}
@override
void initState() {
super.initState();
scroll();
}
@override
Widget build(BuildContext context) {
/// 使用LayoutBuilder获取组件的大小。
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
_boxWidth = constraints.maxWidth;
return SingleChildScrollView(
// 禁止手动滑动。
physics: const NeverScrollableScrollPhysics(),
controller: _controller,
scrollDirection: Axis.horizontal,
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
padding: EdgeInsets.symmetric(horizontal: _boxWidth),
child: widget.child,
),
);
},
);
}
void scroll() async {
while (_validFlag) {
debugPrint('Track_MarqueeView_scroll');
await Future.delayed(widget.pauseDuration);
if (_boxWidth <= 0) {
continue;
}
_controller.jumpTo(0);
// 两个方向: Curves.easeIn 和 Curves.easeOut 。
await _controller.animateTo(_controller.position.maxScrollExtent,
duration: Duration(
seconds:
(_controller.position.maxScrollExtent / widget.scrollSpeed)
.floor()),
curve: Curves.easeIn);
}
}
}
library widgets;
export 'helloword.dart';
export 'marquee.dart';
......@@ -26,7 +26,7 @@ import 'package:flutter_client_sse/flutter_client_sse.dart';
// EventSource eventSource = EventSource(Uri.parse('http://example.com/events'));
//
class HomeController extends GetxController {
class HomeController extends GetxController with SingleGetTickerProviderMixin {
HomeController();
static HomeController get to => Get.put(HomeController());
......@@ -36,6 +36,9 @@ class HomeController extends GetxController {
late StreamSubscription<Event> eventSource;
late AnimationController _controller;
late Animation<double> _animation;
bool _isRotated = false;
// ignore: prefer_typing_uninitialized_variables
late var sse;
......@@ -96,7 +99,7 @@ class HomeController extends GetxController {
if (UserStore.to.profile.id != '') {
await initEventSource();
state.isLoading = true;
int? result = await UserAPI.sceneAsk({
int? result = await UserAPI.aiAnswerWithoutSave({
"question": message.text,
"conversionId": 0,
"sceneId": 0,
......@@ -120,7 +123,6 @@ class HomeController extends GetxController {
integral: value.integral));
});
// index.value = state.messageList.length;
} else {
// EasyLoading.showError("网络异常");
......@@ -143,15 +145,17 @@ class HomeController extends GetxController {
} catch (e) {
print("eeeeeeee$e");
state.isLoading = false;
// _cancelLoading();
final receiveErrorMessage = Chat.ChatMessage(
user: receiveUser,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "当前用户太多了,请稍等再试",
);
// // _cancelLoading();
// final receiveErrorMessage = Chat.ChatMessage(
// user: receiveUser,
// createdAt: DateTime.now(),
// // id: const Uuid().v4(),
// text: "当前用户太多了,请稍等再试",
// );
_addMessage(receiveErrorMessage);
// _addMessage(receiveErrorMessage);
_updateMessage("网络错误,请重试!");
EasyLoading.dismiss();
Vibrate.feedback(FeedbackType.error);
}
......@@ -281,10 +285,9 @@ class HomeController extends GetxController {
if (event.data!.trim().isEmpty) {
return;
} else if (event.id == "[DONE]") {
// await UserAPI.saveResp({
// "conversionId": state.conversionId,
// "content": state.messageList[0].text,
// });
await UserAPI.saveRespTemp({
"content": state.messageList[0].text,
});
state.isLoading = false;
return;
}
......@@ -331,17 +334,26 @@ class HomeController extends GetxController {
// state.messageList.value[0].text = state.messageList.value[0].text + text;
}
share() async {
final text =
state.messageList.reversed.map((element) => element.text).join('\n\n');
print(text);
// state.messageQueenItemQueen.map((element) => element.text).join("");
if (text.isNotEmpty) {
await Share.share(
text,
// sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
reset() async {
rotateIcon();
try {
await UserAPI.resetConversion();
EasyLoading.showToast('重置成功');
} catch (e) {}
}
share() async {
Get.toNamed(AppRoutes.MY_PAGE);
// final text =
// state.messageList.reversed.map((element) => element.text).join('\n\n');
// print(text);
// // state.messageQueenItemQueen.map((element) => element.text).join("");
// if (text.isNotEmpty) {
// await Share.share(
// text,
// // sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
// );
// }
}
tabMessage(ChatMessage message) {
......@@ -376,15 +388,30 @@ class HomeController extends GetxController {
// http://192.168.110.127:8083/api/openAi/connect
// await initEventSource();
super.onInit();
_controller =
AnimationController(vsync: this, duration: Duration(seconds: 1));
_animation = Tween<double>(begin: 0, end: 1).animate(_controller);
// ever(Get.parameters['question'].obs, (value) {
// print("messageListmessageListmessageListmessageList$value");
// });
}
Animation<double> get animation => _animation;
void rotateIcon() {
if (_isRotated) {
_controller.reverse();
} else {
_controller.forward();
}
_isRotated = !_isRotated;
update();
}
///dispose 释放内存
@override
void dispose() {
_controller.dispose();
super.dispose();
// dispose 释放对象
// refreshController.dispose();
......
......@@ -29,10 +29,23 @@ class HomePage extends GetView<HomeController> {
backgroundColor: Color.fromARGB(0, 0, 0, 0),
appBar: transparentAppBar(
actions: [
RotationTransition(
turns: controller.animation,
child: IconButton(
tooltip: '重置',
icon: const Icon(
Icons.settings_backup_restore_sharp,
color: AppColors.primaryElementText,
),
onPressed: () {
controller.reset();
},
),
),
IconButton(
tooltip: '分享',
tooltip: '设置',
icon: const Icon(
Icons.share,
Icons.settings,
color: AppColors.primaryElementText,
),
onPressed: () {
......@@ -41,6 +54,7 @@ class HomePage extends GetView<HomeController> {
)
],
title: RichText(
textAlign: TextAlign.center,
text: TextSpan(children: [
TextSpan(
text: "${controller.state.page}",
......@@ -55,8 +69,8 @@ class HomePage extends GetView<HomeController> {
style: TextStyle(fontSize: 0)),
])),
leading: GradientButton(
// increaseHeightBy: -5,
// increaseWidthBy: -5,
increaseHeightBy: -5,
increaseWidthBy: 105,
elevation: 0,
shadowColor: Colors.black,
gradient: const LinearGradient(
......@@ -72,7 +86,7 @@ class HomePage extends GetView<HomeController> {
Icon(
Icons.add_circle,
color: Colors.black,
size: 35,
size: 30,
),
SizedBox(
width: 10,
......@@ -84,19 +98,7 @@ class HomePage extends GetView<HomeController> {
]),
callback: () {
Get.toNamed(AppRoutes.PAY_LIST);
})
// IconButton(
// tooltip: '返回上一页',
// icon: const Icon(
// Icons.arrow_back,
// color: AppColors.primaryElementText,
// ),
// onPressed: () {
// // Get.back();
// controller.closeChat();
// },
// ),
}),
),
body: SizedBox(
width: double.infinity,
......@@ -107,13 +109,13 @@ class HomePage extends GetView<HomeController> {
// color: Color.fromARGB(0, 29, 33, 60),
// color: Color.fromARGB(255, 26, 27, 46),
child: Chat.DashChat(
inputOptions: Chat.InputOptions(
inputOptions: const Chat.InputOptions(
textInputAction: TextInputAction.send,
sendOnEnter: true,
// showTraillingBeforeSend: true,
// inputDisabled: cc.state.isLoading,
inputTextStyle: const TextStyle(color: Colors.white),
inputToolbarStyle: const BoxDecoration(
inputTextStyle: TextStyle(color: Colors.white),
inputToolbarStyle: BoxDecoration(
color: Color.fromARGB(120, 0, 0, 0),
// Color.fromARGB(0, 54, 59, 72),
borderRadius: BorderRadius.only(
......@@ -122,8 +124,8 @@ class HomePage extends GetView<HomeController> {
),
inputToolbarMargin: EdgeInsets.all(0),
sendButtonBuilder: null,
inputToolbarPadding: const EdgeInsets.only(
top: 15, right: 15, left: 15, bottom: 10),
inputToolbarPadding:
EdgeInsets.only(top: 15, right: 15, left: 15, bottom: 10),
),
currentUser: _user,
onSend: cc.sendMessage,
......
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/store/store.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gradient_widgets/gradient_widgets.dart';
import 'index.dart';
......@@ -8,8 +11,172 @@ class MyPage extends GetView<MyController> {
// 主视图
Widget _buildView() {
return const Center(
child: Text("MyPage"),
final c = Get.put(UserStore());
return ListView(
padding: EdgeInsets.symmetric(horizontal: 10),
children: [
Obx(() => c.profile.expireTime == null
? const Text(
"您还不是 VIP 会员",
style: TextStyle(
color: Color.fromARGB(255, 160, 165, 184),
fontSize: 14,
),
)
: Align(
alignment: Alignment.center,
child: Container(
// color: Colors.amber,
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 0),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(children: [
const TextSpan(
text: '您的VIP会员资格将于',
style: TextStyle(
color: Color.fromARGB(255, 160, 165, 184),
fontSize: 14,
),
),
TextSpan(
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: 14,
),
),
// Text(
// "您的VIP会员资格将于" +
// "${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}" +
// "过期,如果您是自动续费会员将会在过期日前一天自动续费。",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: color,
// fontSize: 14,
// ),
// )
])),
),
)),
Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
onTap: () {
Get.toNamed(AppRoutes.PAY_LIST);
},
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),
),
),
),
Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
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.list),
SizedBox(
width: 10,
),
Text('服务协议')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
),
Container(
margin: EdgeInsets.only(top: 20),
child: InkWell(
onTap: () {
Get.toNamed(AppRoutes.PRIVACT);
},
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.list),
SizedBox(
width: 10,
),
Text('隐私政策')
],
),
Icon(Icons.arrow_forward_ios_outlined),
]),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
),
),
)
// GradientButton(child: Text("321"), callback: () {})
],
);
}
......@@ -19,17 +186,27 @@ class MyPage extends GetView<MyController> {
init: MyController(),
id: "my",
builder: (_) {
return Scaffold(
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("我的"),
title: const Text("设置"),
bottomOpacity: 0.1,
backgroundColor: Color.fromARGB(0, 29, 33, 60),
),
body: SafeArea(
child: _buildView(),
),
),
);
},
);
......
......@@ -49,7 +49,7 @@ class PrivacyPage extends GetView<PrivacyController> {
return GetBuilder<PrivacyController>(
builder: (_) {
return Scaffold(
appBar: transparentAppBar(
appBar: AppBar(
leading: IconButton(
tooltip: '返回上一页',
icon: const Icon(
......
......@@ -9,6 +9,7 @@ import connectivity_plus
import device_info_plus
import firebase_auth
import firebase_core
import flutter_tts
import package_info
import path_provider_foundation
import share_plus
......@@ -23,6 +24,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
......
......@@ -120,6 +120,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
clipboard:
dependency: "direct main"
description:
name: clipboard
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
clock:
dependency: transitive
description:
......@@ -218,6 +225,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
custom_pop_up_menu:
dependency: "direct main"
description:
name: custom_pop_up_menu
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.4"
dash_chat_2:
dependency: "direct main"
description:
......@@ -618,6 +632,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_tts:
dependency: "direct main"
description:
name: flutter_tts
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.3"
flutter_vibrate:
dependency: "direct main"
description:
......
......@@ -7,6 +7,7 @@
#include "generated_plugin_registrant.h"
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <flutter_tts/flutter_tts_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <smart_auth/smart_auth_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
......@@ -14,6 +15,8 @@
void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
FlutterTtsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterTtsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
SmartAuthPluginRegisterWithRegistrar(
......
......@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
flutter_tts
share_plus
smart_auth
url_launcher_windows
......
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