Commit 1c1e22c6 authored by 关振斌's avatar 关振斌

update ios design

parent 545df9e8
......@@ -136,6 +136,15 @@ class UserAPI {
// return ApplePayEntity.fromMap(response['data']);
}
static Future<int> sceneGeneral(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/scene/sceneGeneral/${parameters['detailId']}',
data: parameters['arr'],
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
// /api/
// openAi/createConversion
......
......@@ -62,7 +62,7 @@ class DetailData {
String? _updateTime;
int? _isDelete;
int? _isShow;
Null? _value;
String? _value;
int? _sort;
DetailData(
......@@ -74,7 +74,7 @@ class DetailData {
String? updateTime,
int? isDelete,
int? isShow,
Null? value,
String? value,
int? sort}) {
if (id != null) {
this._id = id;
......@@ -124,8 +124,8 @@ class DetailData {
set isDelete(int? isDelete) => _isDelete = isDelete;
int? get isShow => _isShow;
set isShow(int? isShow) => _isShow = isShow;
Null? get value => _value;
set value(Null? value) => _value = value;
String? get value => _value;
set value(String? value) => _value = value;
int? get sort => _sort;
set sort(int? sort) => _sort = sort;
......
......@@ -130,34 +130,34 @@ class ApplicationController extends GetxController {
bottomTabs = <BottomNavigationBarItem>[
// ignore: unnecessary_new
const BottomNavigationBarItem(
icon: Image(image: AssetImage("assets/images/home.png"), width: 24.0),
icon: Image(image: AssetImage("assets/images/home.png"), width: 30.0),
activeIcon: Image(
image: AssetImage("assets/images/home-selected.png"), width: 24.0),
image: AssetImage("assets/images/home-selected.png"), width: 30.0),
label: '百晓通',
backgroundColor: AppColors.primaryBackground,
),
const BottomNavigationBarItem(
icon:
Image(image: AssetImage("assets/images/product.png"), width: 24.0),
Image(image: AssetImage("assets/images/product.png"), width: 30.0),
activeIcon: Image(
image: AssetImage("assets/images/product-selected.png"),
width: 24.0),
width: 30.0),
label: '创作',
backgroundColor: AppColors.primaryBackground,
),
const BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/images/assistant.png"), width: 24.0),
image: AssetImage("assets/images/assistant.png"), width: 30.0),
activeIcon: Image(
image: AssetImage("assets/images/assistant-selected.png"),
width: 24.0),
width: 30.0),
label: '私人助理',
backgroundColor: AppColors.primaryBackground,
),
const BottomNavigationBarItem(
icon: Image(image: AssetImage("assets/images/my.png"), width: 24.0),
icon: Image(image: AssetImage("assets/images/my.png"), width: 30.0),
activeIcon: Image(
image: AssetImage("assets/images/my-selected.png"), width: 24.0),
image: AssetImage("assets/images/my-selected.png"), width: 30.0),
label: '我的',
backgroundColor: AppColors.primaryBackground,
),
......
......@@ -103,8 +103,9 @@ class ApplicationPage extends GetView<ApplicationController> {
// letIndexChange: (index) => true,
// ),
return Obx(() => BottomNavigationBar(
// #363b48
backgroundColor: Color.fromARGB(0, 54, 59, 72),
backgroundColor: Color.fromARGB(120, 0, 0, 0),
//
// Color.fromARGB(255, 54, 59, 72),
// Color.argb(255, 82, 88, 103)
......@@ -114,6 +115,7 @@ class ApplicationPage extends GetView<ApplicationController> {
items: controller.bottomTabs,
currentIndex: controller.state.page,
// fixedColor: AppColors.primaryElement,
landscapeLayout: BottomNavigationBarLandscapeLayout.spread,
type: BottomNavigationBarType.fixed,
onTap: controller.handleNavBarTap,
showSelectedLabels: true,
......
......@@ -107,8 +107,21 @@ class GridWidget extends GetView<AssistantController> {
increaseWidthBy: -10.00,
callback: () {},
// controller.requestPurchase,
gradient:
Gradients.cosmicFusion,
gradient: const LinearGradient(
colors: [
// 61, 63, 84
// 180deg,
// #be6afb,
// #9c67f6,
// #7965f8
Color(0xFFbe6afb),
Color(0xFF9c67f6),
Color(0xFF7965f8)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
// shadowColor: Gradients
// .backToFuture.colors.last
// .withOpacity(0.25),
......
import 'dart:convert';
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/detail.dart';
import 'package:chart/common/store/user.dart';
import 'package:chart/common/values/server.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_client_sse/flutter_client_sse.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'index.dart';
class CreationDetailController extends GetxController {
static CreationDetailController get to => Get.put(CreationDetailController());
late var sse;
CreationDetailController();
final scrollController = ScrollController();
Map<String, TextEditingController> inputControllerMap = {
'input1': TextEditingController(),
'input2': TextEditingController(),
};
final state = CreationDetailState();
// final
......@@ -19,15 +33,100 @@ class CreationDetailController extends GetxController {
);
}
void updateState(String title, List<DetailData> items) {
getController(int key) {
return inputControllerMap['input$key'];
}
void updateState(String id, String title, List<DetailData> items) {
state.title = title;
state.detailList.value = [];
state.id = id;
// state.detailList.value = [];
items.sort((a, b) => a.sort! - b.sort!);
// input1
state.detailList.addAll(items);
}
void hideKeyboard() => FocusManager.instance.primaryFocus?.unfocus();
void genInner() async {
await initEventSource();
TextEditingController input1 = inputControllerMap['input1']!;
TextEditingController input2 = inputControllerMap['input2']!;
if (input1.text.trim().isEmpty || input2.text.trim().isEmpty) {
EasyLoading.showToast("请输入完整内容");
} else {
state.detailList.forEach((el) {
if (el.sort == 1) {
el.value = input1.text;
} else {
el.value = input2.text;
}
});
hideKeyboard();
EasyLoading.show(status: "AI正在生成中...");
try {
state.isLoading = true;
await NewsAPI.sendMessageByDetailId(state.detailList.value, state.id);
if (state.genText.isNotEmpty) {
state.genText = '';
}
// state.isLoading = false;
} catch (e) {
state.isLoading = false;
// EasyLoading.dismiss();
}
EasyLoading.dismiss();
}
}
initEventSource() async {
final _this = this;
// if (UserStore.to.isLogin) {
sse = SSEClient.subscribeToSSE(
url: "$SERVER_API_URL/openAi/connect/${UserStore.to.profile.id}",
header: {}).listen((event) async {
print('$event 1213213131');
if (event.data!.trim().isEmpty) {
return;
} else if (event.id == "[DONE]") {
// await UserAPI.saveResp({
// "conversionId": state.conversionId,
// "content": state.messageList[0].text,
// });
_this.state.isLoading = false;
return;
}
Map<String, dynamic> jsonMap = jsonDecode("${event.data}");
state.genText = state.genText + "${jsonMap['content']}";
});
// print(sse);
}
bool back() {
state.detailList.value = [];
inputControllerMap['input1']!.text = '';
inputControllerMap['input2']!.text = '';
state.genText = '';
return true;
}
/// 在 widget 内存中分配后立即调用。
@override
void onInit() {
// _focusNode.addListener(() {
// if (_focusNode.hasFocus) {//有焦点
// }else{ //失去焦点
// }
// });
// scrollController.addListener(() {
// print('scrollController$scrollController');
// });
super.onInit();
}
......@@ -46,6 +145,8 @@ class CreationDetailController extends GetxController {
/// dispose 释放内存
@override
void dispose() {
print(21321);
SSEClient.unsubscribeFromSSE();
super.dispose();
}
}
......@@ -7,5 +7,17 @@ class CreationDetailState {
set title(value) => _title.value = value;
get title => _title.value;
final _id = "".obs;
set id(value) => _id.value = value;
get id => _id.value;
final _genText = "".obs;
set genText(value) => _genText.value = value;
get genText => _genText.value;
final _isLoading = false.obs;
set isLoading(value) => _isLoading.value = value;
get isLoading => _isLoading.value;
RxList detailList = [].obs;
}
......@@ -17,32 +17,27 @@ class CreationDetailPage extends GetView<CreationDetailController> {
return GetBuilder<CreationDetailController>(
builder: (_) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
// gradient: LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// // background: linear-gradient(180deg, #0F172A 0%, #0F1B38 100%);
// colors: [
// Color(0xFF0F172A),
// Color(0xFF0F1B38),
// ],
// ),
),
child: Obx(() => Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
appBar: AppBar(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
),
child: Obx(
() => WillPopScope(
onWillPop: () async {
return controller.back();
},
child: Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
title: Text('${controller.state.title}'),
elevation: 0),
body: Container(
child: SafeArea(
child: _buildView(),
)),
)),
);
appBar: AppBar(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
title: Text('${controller.state.title}'),
elevation: 0),
body: Container(
child: _buildView(),
),
)),
));
},
);
}
......
......@@ -37,10 +37,11 @@ class CreationController extends GetxController {
size: 30,
));
Vibrate.feedback(FeedbackType.impact);
final res = await UserAPI.getDetailParamsByDetailId(item.classifyId);
final res = await UserAPI.getDetailParamsByDetailId(item.id);
EasyLoading.dismiss();
CreationDetailController.to.updateState(item.detailName, res.data!);
CreationDetailController.to
.updateState('${item.id}', item.detailName, res.data!);
Get.toNamed(AppRoutes.CREATION_PAGE_DETAIL);
//
}
......
......@@ -96,7 +96,7 @@ class GridWidget extends GetView<CreationController> {
image: Image.network(
'${controller.list[index].icon}')
.image,
fit: BoxFit.fitWidth,
fit: BoxFit.fitHeight,
// colorFilter: ColorFilter.mode(Colors.red, BlendMode.colorBurn),
),
),
......@@ -105,18 +105,31 @@ class GridWidget extends GetView<CreationController> {
MainAxisAlignment.end,
children: [
GradientButton(
child: Text('2.8万人使用',
child: const Text('2.8万人使用',
style: TextStyle(
fontSize: 10)),
increaseHeightBy: -10.00,
increaseWidthBy: -10.00,
callback: () {},
callback: () {
controller.onTap(
controller.list[index]);
},
// controller.requestPurchase,
gradient:
Gradients.cosmicFusion,
shadowColor: Gradients
.backToFuture.colors.last
.withOpacity(0.25),
gradient: const LinearGradient(
colors: [
// 61, 63, 84
// 180deg,
// #be6afb,
// #9c67f6,
// #7965f8
Color(0xFFbe6afb),
Color(0xFF9c67f6),
Color(0xFF7965f8)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
)
],
)
......
......@@ -19,47 +19,36 @@ class PayListPage extends GetView<PayListController> {
@override
Widget build(BuildContext context) {
final c = Get.put(PayListController());
return Scaffold(
// appBar: transparentAppBar(
// title: Text(
// "套餐选择",
// style: TextStyle(
// color: AppColors.primaryElementText,
// fontFamily: 'Montserrat',
// fontSize: 18,
// fontWeight: FontWeight.w600,
// ),
// ),
// leading: IconButton(
// tooltip: '返回上一页',
// icon: const Icon(
// Icons.arrow_back,
// color: AppColors.primaryElementText,
// ),
// onPressed: () async {
// // Get.back();
// // Get.offAll(ApplicationPage());
// // await Get.off(ApplicationPage());
// // Get.toNamed(AppRoutes.Application);
// Get.back();
// // await Get.toNamed();
// // Navigator.of(context).pop();
// //_nextPage(-1);
// },
// ),
// ),
// _buildView
body: Container(
width: double.infinity,
height: double.infinity,
// padding: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg1.png").image,
fit: BoxFit.cover),
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(
appBar: AppBar(
elevation: 0,
backgroundColor: const Color.fromARGB(0, 0, 0, 0),
title: Text("订阅中心"),
),
backgroundColor: const Color.fromARGB(0, 0, 0, 0),
body: _buildView()
// Container(
// // child: Text("12312"),
// // width: double.infinity,
// // height: double.infinity,
// // // padding: EdgeInsets.symmetric(horizontal: 20),
// // decoration: BoxDecoration(
// // image: DecorationImage(
// // image: Image.asset("assets/images/bg1.png").image,
// // fit: BoxFit.cover),
// // ),
// // child:
// ),
),
child: _buildView()),
);
}
}
This diff is collapsed.
......@@ -65,6 +65,9 @@ class HomeController extends GetxController {
/// 事件
void sendMessage(Chat.ChatMessage message) async {
if (state.isLoading || message.text.trim().isEmpty) {
return;
}
Vibrate.feedback(FeedbackType.impact);
final textMessage = Chat.ChatMessage(
......
......@@ -80,9 +80,11 @@ class HomePage extends GetView<HomeController> {
Text("订阅",
style: TextStyle(
color: Color.fromARGB(255, 95, 54, 0),
fontSize: 16))
fontSize: 16)),
]),
callback: () {})
callback: () {
Get.toNamed(AppRoutes.PAY_LIST);
})
// IconButton(
// tooltip: '返回上一页',
......@@ -96,7 +98,7 @@ class HomePage extends GetView<HomeController> {
// },
// ),
),
body: Container(
body: SizedBox(
width: double.infinity,
height: double.infinity,
// color: Color.fromARGB(0, 255, 255, 0),
......@@ -109,18 +111,19 @@ class HomePage extends GetView<HomeController> {
textInputAction: TextInputAction.send,
sendOnEnter: true,
// showTraillingBeforeSend: true,
inputDisabled: cc.state.isLoading,
inputTextStyle: TextStyle(color: Colors.white),
// inputToolbarStyle: BoxDecoration(
// color: Color.fromARGB(0, 54, 59, 72),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(16),
// topRight: Radius.circular(16)),
// ),
// 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: 10),
inputToolbarPadding: const EdgeInsets.only(
top: 15, right: 15, left: 15, bottom: 10),
),
currentUser: _user,
onSend: cc.sendMessage,
......
......@@ -20,12 +20,12 @@ class MyPage extends GetView<MyController> {
id: "my",
builder: (_) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 29, 33, 60),
backgroundColor: Color.fromARGB(0, 29, 33, 60),
appBar: AppBar(
elevation: 0,
title: const Text("我的"),
bottomOpacity: 0.1,
backgroundColor: Color.fromARGB(255, 29, 33, 60),
backgroundColor: Color.fromARGB(0, 29, 33, 60),
),
body: SafeArea(
child: _buildView(),
......
......@@ -7,7 +7,7 @@ packages:
name: _flutterfire_internals
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.17"
version: "1.1.0"
alipay_kit:
dependency: "direct main"
description:
......@@ -273,7 +273,7 @@ packages:
name: easy_container
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.4+1"
equatable:
dependency: transitive
description:
......@@ -329,42 +329,42 @@ packages:
name: firebase_auth
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.10"
version: "4.4.0"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.11.12"
version: "6.13.0"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.9"
version: "5.3.0"
firebase_core:
dependency: transitive
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.1"
version: "2.9.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.3"
version: "4.6.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
version: "2.3.0"
firebase_phone_auth_handler:
dependency: "direct main"
description:
......@@ -384,6 +384,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_barrage:
dependency: "direct main"
description:
name: flutter_barrage
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.2"
flutter_blurhash:
dependency: transitive
description:
......@@ -453,7 +460,7 @@ packages:
name: flutter_inapp_purchase
url: "https://pub.dartlang.org"
source: hosted
version: "5.4.0"
version: "5.4.1"
flutter_inappwebview:
dependency: transitive
description:
......@@ -461,6 +468,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.7.2+3"
flutter_keyboard_visibility:
dependency: "direct main"
description:
name: flutter_keyboard_visibility
url: "https://pub.dartlang.org"
source: hosted
version: "5.4.0"
flutter_keyboard_visibility_linux:
dependency: transitive
description:
name: flutter_keyboard_visibility_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_keyboard_visibility_macos:
dependency: transitive
description:
name: flutter_keyboard_visibility_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_keyboard_visibility_platform_interface:
dependency: transitive
description:
name: flutter_keyboard_visibility_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_keyboard_visibility_web:
dependency: transitive
description:
name: flutter_keyboard_visibility_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_keyboard_visibility_windows:
dependency: transitive
description:
name: flutter_keyboard_visibility_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_link_previewer:
dependency: transitive
description:
......@@ -678,14 +727,14 @@ packages:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.7"
version: "0.8.7+1"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.6+1"
version: "0.8.6+6"
image_picker_for_web:
dependency: transitive
description:
......@@ -699,7 +748,7 @@ packages:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.7+1"
version: "0.8.7+2"
image_picker_platform_interface:
dependency: transitive
description:
......@@ -860,7 +909,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
version: "2.0.14"
path_provider_android:
dependency: transitive
description:
......@@ -874,7 +923,7 @@ packages:
name: path_provider_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.2.1"
path_provider_linux:
dependency: transitive
description:
......@@ -965,7 +1014,7 @@ packages:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.2"
version: "3.7.2"
process:
dependency: transitive
description:
......@@ -1035,49 +1084,49 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.18"
version: "2.1.0"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.17"
version: "2.1.0"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
version: "2.2.0"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
version: "2.2.0"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.2.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.1.0"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
version: "2.2.0"
sign_in_with_apple:
dependency: "direct main"
description:
......@@ -1215,14 +1264,14 @@ packages:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.25"
version: "6.0.26"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
version: "6.1.3"
url_launcher_linux:
dependency: transitive
description:
......@@ -1285,35 +1334,35 @@ packages:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.0"
version: "2.6.1"
video_player_android:
dependency: transitive
description:
name: video_player_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.4.4"
video_player_avfoundation:
dependency: transitive
description:
name: video_player_avfoundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.3"
video_player_platform_interface:
dependency: transitive
description:
name: video_player_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.2"
version: "6.1.0"
video_player_web:
dependency: transitive
description:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
version: "2.0.16"
visibility_detector:
dependency: transitive
description:
......
......@@ -120,6 +120,9 @@ dependencies:
device_info_plus: ^8.1.0
app_settings: ^4.2.0
loading_animation_widget: ^1.2.0+4
flutter_keyboard_visibility: ^5.4.0
flutter_barrage: ^0.5.2
# package:bubble/bubble.dart
......
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