Commit 7779fc2d authored by 关振斌's avatar 关振斌

update style

parent 2ffc9c3c
PODS: PODS:
- alipay_kit_ios (5.0.0):
- alipay_kit_ios/utdid (= 5.0.0)
- alipay_kit_ios/vendor (= 5.0.0)
- Flutter
- alipay_kit_ios/utdid (5.0.0):
- Flutter
- alipay_kit_ios/vendor (5.0.0):
- Flutter
- "app_settings (3.0.0+1)": - "app_settings (3.0.0+1)":
- Flutter - Flutter
- babstrap_settings_screen (0.0.1): - babstrap_settings_screen (0.0.1):
...@@ -150,7 +142,6 @@ PODS: ...@@ -150,7 +142,6 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- alipay_kit_ios (from `.symlinks/plugins/alipay_kit_ios/ios`)
- app_settings (from `.symlinks/plugins/app_settings/ios`) - app_settings (from `.symlinks/plugins/app_settings/ios`)
- babstrap_settings_screen (from `.symlinks/plugins/babstrap_settings_screen/ios`) - babstrap_settings_screen (from `.symlinks/plugins/babstrap_settings_screen/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
...@@ -198,8 +189,6 @@ SPEC REPOS: ...@@ -198,8 +189,6 @@ SPEC REPOS:
- Toast - Toast
EXTERNAL SOURCES: EXTERNAL SOURCES:
alipay_kit_ios:
:path: ".symlinks/plugins/alipay_kit_ios/ios"
app_settings: app_settings:
:path: ".symlinks/plugins/app_settings/ios" :path: ".symlinks/plugins/app_settings/ios"
babstrap_settings_screen: babstrap_settings_screen:
...@@ -256,7 +245,6 @@ EXTERNAL SOURCES: ...@@ -256,7 +245,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios" :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
alipay_kit_ios: bfa484b12d4690cc48a803f39ed5fb58fa774d2e
app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3 app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3
babstrap_settings_screen: 535097da0fa521a47fef6f6678ff2b464ee15937 babstrap_settings_screen: 535097da0fa521a47fef6f6678ff2b464ee15937
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
......
import 'package:chart/common/entities/detail.dart';
import 'package:chart/common/entities/entities.dart'; import 'package:chart/common/entities/entities.dart';
import 'package:chart/common/entities/selectAllEntity.dart';
import 'package:chart/common/utils/utils.dart'; import 'package:chart/common/utils/utils.dart';
import '../../entity/login_entity.dart'; import '../../entity/login_entity.dart';
...@@ -87,6 +89,42 @@ class UserAPI { ...@@ -87,6 +89,42 @@ class UserAPI {
// return ApplePayEntity.fromMap(response['data']); // return ApplePayEntity.fromMap(response['data']);
} }
//无上下文对话
static Future<int> sceneAsk(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post(
'/openAi/aiAnswerWithStream',
data: parameters,
);
return response['status'];
// return ApplePayEntity.fromMap(response['data']);
}
//获取所有列表
static Future<SelectAllEntity> selectAll() async {
var response = await HttpUtil().get(
'/classifyDetail/selectAll',
);
// goodEntityFromList(response['data']);
return SelectAllEntity.fromJson(response);
// return ApplePayEntity.fromMap(response['data']);
}
static Future<DetailEntity> getDetailParamsByDetailId(detailId) async {
var response = await HttpUtil().post(
'/detailParams/getDetailParamsByDetailId/$detailId',
);
// goodEntityFromList(response['data']);
return DetailEntity.fromJson(response);
// return ApplePayEntity.fromMap(response['data']);
}
// detailParams/getDetailParamsByDetailId/12
//
///api/ 保存问题 ///api/ 保存问题
static Future<int> saveResp(Map<String, dynamic> parameters) async { static Future<int> saveResp(Map<String, dynamic> parameters) async {
var response = await HttpUtil().post( var response = await HttpUtil().post(
......
class DetailEntity {
int? _status;
String? _message;
List<DetailData>? _data;
int? _timestamp;
DetailEntity(
{int? status, String? message, List<DetailData>? 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<DetailData>? get data => _data;
set data(List<DetailData>? data) => _data = data;
int? get timestamp => _timestamp;
set timestamp(int? timestamp) => _timestamp = timestamp;
DetailEntity.fromJson(Map<String, dynamic> json) {
_status = json['status'];
_message = json['message'];
if (json['data'] != null) {
_data = <DetailData>[];
json['data'].forEach((v) {
_data!.add(new DetailData.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 DetailData {
int? _id;
String? _label;
String? _placeHolder;
int? _detailId;
String? _createTime;
String? _updateTime;
int? _isDelete;
int? _isShow;
Null? _value;
int? _sort;
DetailData(
{int? id,
String? label,
String? placeHolder,
int? detailId,
String? createTime,
String? updateTime,
int? isDelete,
int? isShow,
Null? value,
int? sort}) {
if (id != null) {
this._id = id;
}
if (label != null) {
this._label = label;
}
if (placeHolder != null) {
this._placeHolder = placeHolder;
}
if (detailId != null) {
this._detailId = detailId;
}
if (createTime != null) {
this._createTime = createTime;
}
if (updateTime != null) {
this._updateTime = updateTime;
}
if (isDelete != null) {
this._isDelete = isDelete;
}
if (isShow != null) {
this._isShow = isShow;
}
if (value != null) {
this._value = value;
}
if (sort != null) {
this._sort = sort;
}
}
int? get id => _id;
set id(int? id) => _id = id;
String? get label => _label;
set label(String? label) => _label = label;
String? get placeHolder => _placeHolder;
set placeHolder(String? placeHolder) => _placeHolder = placeHolder;
int? get detailId => _detailId;
set detailId(int? detailId) => _detailId = detailId;
String? get createTime => _createTime;
set createTime(String? createTime) => _createTime = createTime;
String? get updateTime => _updateTime;
set updateTime(String? updateTime) => _updateTime = updateTime;
int? get isDelete => _isDelete;
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;
int? get sort => _sort;
set sort(int? sort) => _sort = sort;
DetailData.fromJson(Map<String, dynamic> json) {
_id = json['id'];
_label = json['label'];
_placeHolder = json['placeHolder'];
_detailId = json['detailId'];
_createTime = json['createTime'];
_updateTime = json['updateTime'];
_isDelete = json['isDelete'];
_isShow = json['isShow'];
_value = json['value'];
_sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this._id;
data['label'] = this._label;
data['placeHolder'] = this._placeHolder;
data['detailId'] = this._detailId;
data['createTime'] = this._createTime;
data['updateTime'] = this._updateTime;
data['isDelete'] = this._isDelete;
data['isShow'] = this._isShow;
data['value'] = this._value;
data['sort'] = this._sort;
return data;
}
}
class SelectAllEntity {
int? _status;
String? _message;
List<SelectEntity>? _data;
int? _timestamp;
SelectAllEntity(
{int? status,
String? message,
List<SelectEntity>? 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<SelectEntity>? get data => _data;
set data(List<SelectEntity>? data) => _data = data;
int? get timestamp => _timestamp;
set timestamp(int? timestamp) => _timestamp = timestamp;
SelectAllEntity.fromJson(Map<String, dynamic> json) {
_status = json['status'];
_message = json['message'];
if (json['data'] != null) {
_data = <SelectEntity>[];
json['data'].forEach((v) {
_data!.add(new SelectEntity.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 SelectEntity {
int? _id;
String? _detailName;
int? _classifyId;
String? _detailDesc;
String? _createTime;
String? _updateTime;
int? _isDelete;
int? _isShow;
String? _template;
String? _icon;
int? _count;
SelectEntity(
{int? id,
String? detailName,
int? classifyId,
String? detailDesc,
String? createTime,
String? updateTime,
int? isDelete,
int? isShow,
String? template,
String? icon,
int? count}) {
if (id != null) {
this._id = id;
}
if (detailName != null) {
this._detailName = detailName;
}
if (classifyId != null) {
this._classifyId = classifyId;
}
if (detailDesc != null) {
this._detailDesc = detailDesc;
}
if (createTime != null) {
this._createTime = createTime;
}
if (updateTime != null) {
this._updateTime = updateTime;
}
if (isDelete != null) {
this._isDelete = isDelete;
}
if (isShow != null) {
this._isShow = isShow;
}
if (template != null) {
this._template = template;
}
if (icon != null) {
this._icon = icon;
}
if (count != null) {
this._count = count;
}
}
int? get id => _id;
set id(int? id) => _id = id;
String? get detailName => _detailName;
set detailName(String? detailName) => _detailName = detailName;
int? get classifyId => _classifyId;
set classifyId(int? classifyId) => _classifyId = classifyId;
String? get detailDesc => _detailDesc;
set detailDesc(String? detailDesc) => _detailDesc = detailDesc;
String? get createTime => _createTime;
set createTime(String? createTime) => _createTime = createTime;
String? get updateTime => _updateTime;
set updateTime(String? updateTime) => _updateTime = updateTime;
int? get isDelete => _isDelete;
set isDelete(int? isDelete) => _isDelete = isDelete;
int? get isShow => _isShow;
set isShow(int? isShow) => _isShow = isShow;
String? get template => _template;
set template(String? template) => _template = template;
String? get icon => _icon;
set icon(String? icon) => _icon = icon;
int? get count => _count;
set count(int? count) => _count = count;
SelectEntity.fromJson(Map<String, dynamic> json) {
_id = json['id'];
_detailName = json['detailName'];
_classifyId = json['classifyId'];
_detailDesc = json['detailDesc'];
_createTime = json['createTime'];
_updateTime = json['updateTime'];
_isDelete = json['isDelete'];
_isShow = json['isShow'];
_template = json['template'];
_icon = json['icon'];
_count = json['count'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this._id;
data['detailName'] = this._detailName;
data['classifyId'] = this._classifyId;
data['detailDesc'] = this._detailDesc;
data['createTime'] = this._createTime;
data['updateTime'] = this._updateTime;
data['isDelete'] = this._isDelete;
data['isShow'] = this._isShow;
data['template'] = this._template;
data['icon'] = this._icon;
data['count'] = this._count;
return data;
}
}
...@@ -15,5 +15,11 @@ class AppRoutes { ...@@ -15,5 +15,11 @@ class AppRoutes {
static const USER_PRIVACT = '/user_privacy'; static const USER_PRIVACT = '/user_privacy';
static const WILL_COME = '/will_come'; static const WILL_COME = '/will_come';
static const USER_EULA = '/eula'; static const USER_EULA = '/eula';
static const HOME_PAGE = '/home';
static const CREATION_PAGE = '/creation';
static const CREATION_PAGE_DETAIL = '/creation-detail';
static const ASSISTANT_PAGE = '/assistant';
static const MY_PAGE = '/my';
// UserPrivacyPage // UserPrivacyPage
} }
import 'package:chart/pages/assistant/index.dart';
import 'package:chart/pages/chat/view.dart'; import 'package:chart/pages/chat/view.dart';
import 'package:chart/pages/creation-detail/index.dart';
import 'package:chart/pages/creation/index.dart';
import 'package:chart/pages/eula/bindings.dart'; import 'package:chart/pages/eula/bindings.dart';
import 'package:chart/pages/eula/view.dart'; import 'package:chart/pages/eula/view.dart';
import 'package:chart/pages/frame/android_pay_list/view.dart'; import 'package:chart/pages/frame/android_pay_list/view.dart';
import 'package:chart/pages/frame/notfound/index.dart'; import 'package:chart/pages/frame/notfound/index.dart';
import 'package:chart/pages/frame/pay_list/view.dart'; import 'package:chart/pages/frame/pay_list/view.dart';
import 'package:chart/pages/home/index.dart';
import 'package:chart/pages/my/index.dart';
import 'package:chart/pages/privacy/index.dart'; import 'package:chart/pages/privacy/index.dart';
import 'package:chart/pages/template/index.dart'; import 'package:chart/pages/template/index.dart';
import 'package:chart/pages/user_privacy/index.dart'; import 'package:chart/pages/user_privacy/index.dart';
...@@ -158,6 +163,33 @@ class AppPages { ...@@ -158,6 +163,33 @@ class AppPages {
page: () => CategoryPage(), page: () => CategoryPage(),
binding: CategoryBinding(), binding: CategoryBinding(),
), ),
//重构UI
GetPage(
name: AppRoutes.HOME_PAGE,
page: () => HomePage(),
binding: HomeBinding(),
),
GetPage(
name: AppRoutes.CREATION_PAGE,
page: () => CreationPage(),
binding: CreationBinding(),
),
GetPage(
name: AppRoutes.ASSISTANT_PAGE,
page: () => AssistantPage(),
binding: AssistantBinding(),
),
GetPage(
name: AppRoutes.MY_PAGE,
page: () => MyPage(),
binding: MyBinding(),
),
GetPage(
name: AppRoutes.CREATION_PAGE_DETAIL,
page: () => const CreationDetailPage(),
binding: CreationDetailBinding(),
)
]; ];
// static final unknownRoute = GetPage( // static final unknownRoute = GetPage(
......
...@@ -95,27 +95,29 @@ class UserStore extends GetxController { ...@@ -95,27 +95,29 @@ class UserStore extends GetxController {
} }
Future refreshInfo() async { Future refreshInfo() async {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo; if (GetPlatform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
final res = await UserAPI.appleLogin({
"phone": iosInfo.data['identifierForVendor'], final res = await UserAPI.appleLogin({
}); "phone": iosInfo.data['identifierForVendor'],
});
final value = IntegralEntity(
expireTime: res.expireTime == null ? null : res.expireTime, final value = IntegralEntity(
id: res.id, expireTime: res.expireTime == null ? null : res.expireTime,
token: res.token, id: res.id,
username: res.username, token: res.token,
integral: res.integral, username: res.username,
); integral: res.integral,
token = res.token; );
_profile.value = _profile(value); token = res.token;
_profile.value = _profile(value);
if (profile.id != '') {
_isLogin.value = true;
}
if (profile.id != '') { await MainController.to.asyncLoadBannerData();
_isLogin.value = true;
} }
await MainController.to.asyncLoadBannerData();
} }
handleLogin(IntegralEntity res) async { handleLogin(IntegralEntity res) async {
......
...@@ -9,9 +9,11 @@ AppBar transparentAppBar({ ...@@ -9,9 +9,11 @@ AppBar transparentAppBar({
List<Widget>? actions, List<Widget>? actions,
}) { }) {
return AppBar( return AppBar(
backgroundColor: Color.fromRGBO(41, 45, 62, 1.00), backgroundColor: Color.fromARGB(0, 0, 0, 0),
// elevation: 2, // elevation: 2,
title: title, title: title,
elevation: 0,
leadingWidth: 115,
leading: leading ?? null, leading: leading ?? null,
actions: actions, actions: actions,
); );
......
import 'package:chart/pages/frame/product/bindings.dart'; import 'package:chart/pages/frame/product/bindings.dart';
import 'package:chart/pages/home/index.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/langs/translation_service.dart'; import 'package:chart/common/langs/translation_service.dart';
import 'package:chart/common/routers/pages.dart'; import 'package:chart/common/routers/pages.dart';
...@@ -33,11 +34,12 @@ class ChatApp extends StatelessWidget { ...@@ -33,11 +34,12 @@ class ChatApp extends StatelessWidget {
designSize: Size(375, 812), designSize: Size(375, 812),
builder: (context, child) => GetMaterialApp( builder: (context, child) => GetMaterialApp(
title: 'AI写作大师', title: 'AI写作大师',
theme: AppTheme.light, theme: ThemeData.dark(),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: AppPages.INITIAL, initialRoute: AppPages.INITIAL,
darkTheme: ThemeData.dark(),
// initialBinding: AllControllerBinding(), themeMode: ThemeMode.dark,
initialBinding: AllControllerBinding(),
getPages: AppPages.routes, getPages: AppPages.routes,
builder: EasyLoading.init(), builder: EasyLoading.init(),
translations: TranslationService(), translations: TranslationService(),
...@@ -60,6 +62,7 @@ class AllControllerBinding extends Bindings { ...@@ -60,6 +62,7 @@ class AllControllerBinding extends Bindings {
@override @override
void dependencies() { void dependencies() {
Get.lazyPut(() => ProductBinding()); Get.lazyPut(() => ProductBinding());
Get.lazyPut(() => HomeBinding());
///Get.lazyPut(() => OneController()); ///Get.lazyPut(() => OneController());
///Get.lazyPut(() => TwoController()); ///Get.lazyPut(() => TwoController());
......
...@@ -13,6 +13,7 @@ import 'package:get/get_connect/http/src/utils/utils.dart'; ...@@ -13,6 +13,7 @@ import 'package:get/get_connect/http/src/utils/utils.dart';
import 'package:gradient_borders/input_borders/gradient_outline_input_border.dart'; import 'package:gradient_borders/input_borders/gradient_outline_input_border.dart';
import 'package:highlight/highlight.dart'; import 'package:highlight/highlight.dart';
import 'package:intl/intl.dart' as intl; import 'package:intl/intl.dart' as intl;
import 'package:loading_animation_widget/loading_animation_widget.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:video_player/video_player.dart' as vp; import 'package:video_player/video_player.dart' as vp;
......
...@@ -48,7 +48,17 @@ InputDecoration defaultInputDecoration( ...@@ -48,7 +48,17 @@ InputDecoration defaultInputDecoration(
Color.fromRGBO(116, 112, 249, 1.00), Color.fromRGBO(116, 112, 249, 1.00),
Color.fromRGBO(149, 197, 208, 1.00) Color.fromRGBO(149, 197, 208, 1.00)
]), ]),
width: 5, width: 2,
),
disabledBorder: GradientOutlineInputBorder(
// rgba(140, 197, 208, 1.00)
borderRadius: BorderRadius.circular(10),
// ignore: prefer_const_literals_to_create_immutables
gradient: LinearGradient(colors: [
Color.fromRGBO(116, 112, 249, 1.00),
Color.fromRGBO(149, 197, 208, 1.00),
]),
width: 2,
), ),
// OutlineInputBorder( // OutlineInputBorder(
// borderRadius: // borderRadius:
...@@ -66,7 +76,7 @@ InputDecoration defaultInputDecoration( ...@@ -66,7 +76,7 @@ InputDecoration defaultInputDecoration(
Color.fromRGBO(116, 112, 249, 1.00), Color.fromRGBO(116, 112, 249, 1.00),
Color.fromRGBO(149, 197, 208, 1.00) Color.fromRGBO(149, 197, 208, 1.00)
]), ]),
width: 5, width: 2,
), ),
// focusedBorder: OutlineInputBorder( // focusedBorder: OutlineInputBorder(
// borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
......
...@@ -93,55 +93,42 @@ class _InputToolbarState extends State<InputToolbar> ...@@ -93,55 +93,42 @@ class _InputToolbarState extends State<InputToolbar>
Expanded( Expanded(
child: Directionality( child: Directionality(
textDirection: widget.inputOptions.inputTextDirection, textDirection: widget.inputOptions.inputTextDirection,
child: widget.inputOptions.inputDisabled child: TextField(
? Center( focusNode: focusNode,
child: AnimatedTextKit( controller: textController,
animatedTexts: [ enabled: !widget.inputOptions.inputDisabled,
TypewriterAnimatedText('AI正在生成中......', textCapitalization: widget.inputOptions.textCapitalization,
textStyle: TextStyle(color: Colors.white)), textInputAction: widget.inputOptions.textInputAction,
], decoration: widget.inputOptions.inputDecoration ??
) defaultInputDecoration(_sendMessage),
// Text("请稍等", style: TextStyle(color: Colors.white) maxLength: widget.inputOptions.maxInputLength,
minLines: 1,
, maxLines: 1,
) // maxLines: widget.inputOptions.sendOnEnter
: TextField( // ? 1
focusNode: focusNode, // : widget.inputOptions.inputMaxLines,
controller: textController, cursorColor: widget.inputOptions.cursorStyle.color,
enabled: !widget.inputOptions.inputDisabled, cursorWidth: widget.inputOptions.cursorStyle.width,
textCapitalization: showCursor: !widget.inputOptions.cursorStyle.hide,
widget.inputOptions.textCapitalization, style: widget.inputOptions.inputTextStyle,
textInputAction: widget.inputOptions.textInputAction, onSubmitted: (String value) {
decoration: widget.inputOptions.inputDecoration ?? if (widget.inputOptions.sendOnEnter) {
defaultInputDecoration(_sendMessage), _sendMessage();
maxLength: widget.inputOptions.maxInputLength, }
minLines: 1, },
maxLines: 1, onChanged: (String value) async {
// maxLines: widget.inputOptions.sendOnEnter setState(() {});
// ? 1 if (widget.inputOptions.onTextChange != null) {
// : widget.inputOptions.inputMaxLines, widget.inputOptions.onTextChange!(value);
cursorColor: widget.inputOptions.cursorStyle.color, }
cursorWidth: widget.inputOptions.cursorStyle.width, WidgetsBinding.instance.addPostFrameCallback((_) async {
showCursor: !widget.inputOptions.cursorStyle.hide, if (widget.inputOptions.onMention != null) {
style: widget.inputOptions.inputTextStyle, await _checkMentions(value);
onSubmitted: (String value) { }
if (widget.inputOptions.sendOnEnter) { });
_sendMessage(); },
} autocorrect: widget.inputOptions.autocorrect,
}, ),
onChanged: (String value) async {
setState(() {});
if (widget.inputOptions.onTextChange != null) {
widget.inputOptions.onTextChange!(value);
}
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (widget.inputOptions.onMention != null) {
await _checkMentions(value);
}
});
},
autocorrect: widget.inputOptions.autocorrect,
),
), ),
), ),
if (widget.inputOptions.trailing != null && if (widget.inputOptions.trailing != null &&
......
...@@ -74,6 +74,73 @@ class _MessageListState extends State<MessageList> { ...@@ -74,6 +74,73 @@ class _MessageListState extends State<MessageList> {
final ChatMessage? nextMessage = final ChatMessage? nextMessage =
i > 0 ? widget.messages[i - 1] : null; i > 0 ? widget.messages[i - 1] : null;
final ChatMessage message = widget.messages[i]; final ChatMessage message = widget.messages[i];
final bool isPlaceHolder = message.user.id == '0';
if (isPlaceHolder) {
//
return InkWell(
onTap: () {
scrollController.animateTo(
0.0,
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
widget.messageOptions.onPressMessage!(message);
},
child: Container(
margin: const EdgeInsets.only(
left: 10, right: 10, bottom: 20),
child: Column(
children: [
Row(
children: [
Icon(
Icons.timelapse_sharp,
color: Color.fromARGB(255, 117, 194, 245),
),
SizedBox(width: 10),
Text(message.customProperties!['title']),
],
),
Container(
padding: const EdgeInsets.symmetric(
vertical: 15, horizontal: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
gradient: const LinearGradient(
colors: [
Color(0xFF3d3f54),
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
)),
margin: const EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
message.text,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: const TextStyle(
color: Color.fromARGB(
255, 170, 170, 194)),
)),
const Icon(
Icons.arrow_forward,
color: Color(0xFF9c67f6),
),
]),
)
],
),
),
);
}
final bool isAfterDateSeparator = _shouldShowDateSeparator( final bool isAfterDateSeparator = _shouldShowDateSeparator(
previousMessage, message, widget.messageListOptions); previousMessage, message, widget.messageListOptions);
bool isBeforeDateSeparator = false; bool isBeforeDateSeparator = false;
...@@ -101,7 +168,6 @@ class _MessageListState extends State<MessageList> { ...@@ -101,7 +168,6 @@ class _MessageListState extends State<MessageList> {
isBeforeDateSeparator, isBeforeDateSeparator,
), ),
] else ] else
// Text('121')
MessageRow( MessageRow(
message: widget.messages[i], message: widget.messages[i],
nextMessage: nextMessage, nextMessage: nextMessage,
...@@ -160,7 +226,7 @@ class _MessageListState extends State<MessageList> { ...@@ -160,7 +226,7 @@ class _MessageListState extends State<MessageList> {
: DefaultScrollToBottom( : DefaultScrollToBottom(
scrollController: scrollController, scrollController: scrollController,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
textColor: Theme.of(context).primaryColor, textColor: Colors.white,
), ),
], ],
), ),
......
...@@ -49,18 +49,18 @@ class DefaultAvatar extends StatelessWidget { ...@@ -49,18 +49,18 @@ class DefaultAvatar extends StatelessWidget {
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: <Widget>[ children: <Widget>[
ClipOval( // ClipOval(
child: Container( // child: Container(
color: Colors.grey[200], // color: Colors.grey[200],
child: Image( // child: Image(
image: fallbackImage ?? // image: fallbackImage ??
const AssetImage( // const AssetImage(
'assets/images/logo.png', // 'assets/images/logo.png',
// package: 'dash_chat_2', // // package: 'dash_chat_2',
), // ),
), // ),
), // ),
), // ),
if (user.profileImage != null && user.profileImage!.isNotEmpty) if (user.profileImage != null && user.profileImage!.isNotEmpty)
Center( Center(
child: ClipOval( child: ClipOval(
......
...@@ -92,12 +92,13 @@ class DefaultMessageText extends StatelessWidget { ...@@ -92,12 +92,13 @@ class DefaultMessageText extends StatelessWidget {
} }
} }
return <Widget>[ return <Widget>[
getParsePattern(message.text, isOwnMessage, messageLength, index) getParsePattern(message.text, isOwnMessage, messageLength, index),
]; ];
} }
Widget getPostMessageBuild(String text, List<ChatMessage> messageLength, Widget getPostMessageBuild(String text, List<ChatMessage> messageLength,
bool isOwnMessage, int index) { bool isOwnMessage, int index) {
// text
// var lastMessage = messageLength.first; // var lastMessage = messageLength.first;
// if(lastMessage.) { // if(lastMessage.) {
...@@ -114,15 +115,25 @@ class DefaultMessageText extends StatelessWidget { ...@@ -114,15 +115,25 @@ class DefaultMessageText extends StatelessWidget {
// child: Markdown(data: text, selectable: true), // child: Markdown(data: text, selectable: true),
// ); // );
return MyMarkdown( return text == 'LOADING'
// syntaxHighlighter: SyntaxHighlighter(), ? Row(
// styleConfig: StyleConfig(), children: [
data: text, const Text("AI正在思考中"),
// styleSheet: MarkdownStyleSheet( LoadingAnimationWidget.staggeredDotsWave(
// // code: TextStyle(color: Colors.red), color: Colors.white,
size: 20,
// ), ),
); ],
)
: MyMarkdown(
// syntaxHighlighter: SyntaxHighlighter(),
// styleConfig: StyleConfig(),
data: text,
styleSheet: MarkdownStyleSheet(
p: TextStyle(color: Colors.white),
code: TextStyle(color: Colors.white),
),
);
// Column( // Column(
// children: [ // children: [
// Expanded( // Expanded(
...@@ -153,6 +164,7 @@ class DefaultMessageText extends StatelessWidget { ...@@ -153,6 +164,7 @@ class DefaultMessageText extends StatelessWidget {
: defaultPersePatterns, : defaultPersePatterns,
text: text, text: text,
style: TextStyle( style: TextStyle(
fontSize: 16,
color: isOwnMessage color: isOwnMessage
? (messageOptions.currentUserTextColor ?? Colors.white) ? (messageOptions.currentUserTextColor ?? Colors.white)
: (messageOptions.textColor ?? Colors.black), : (messageOptions.textColor ?? Colors.black),
......
...@@ -42,17 +42,23 @@ class MessageRow extends StatelessWidget { ...@@ -42,17 +42,23 @@ class MessageRow extends StatelessWidget {
/// Get the avatar widget /// Get the avatar widget
Widget getAvatar() { Widget getAvatar() {
return messageOptions.avatarBuilder != null return DefaultAvatar(
? messageOptions.avatarBuilder!( user: message.user,
message.user, onLongPressAvatar: messageOptions.onLongPressAvatar,
messageOptions.onPressAvatar, onPressAvatar: messageOptions.onPressAvatar,
messageOptions.onLongPressAvatar, );
) // messageOptions.avatarBuilder != null
: DefaultAvatar( // ? messageOptions.avatarBuilder!(
user: message.user, // message.user,
onLongPressAvatar: messageOptions.onLongPressAvatar, // messageOptions.onPressAvatar,
onPressAvatar: messageOptions.onPressAvatar, // messageOptions.onLongPressAvatar,
); // )
// :
// DefaultAvatar(
// user: message.user,
// onLongPressAvatar: messageOptions.onLongPressAvatar,
// onPressAvatar: messageOptions.onPressAvatar,
// );
} }
@override @override
...@@ -75,15 +81,15 @@ class MessageRow extends StatelessWidget { ...@@ -75,15 +81,15 @@ class MessageRow extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment:
isOwnMessage ? MainAxisAlignment.end : MainAxisAlignment.start, isOwnMessage ? MainAxisAlignment.end : MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// if (messageOptions.showOtherUsersAvatar)
// Opacity(
// opacity:
// !isOwnMessage && (!isNextSameAuthor || isBeforeDateSeparator)
// ? 1
// : 0,
// child: getAvatar(),
// ),
if (messageOptions.showOtherUsersAvatar) if (messageOptions.showOtherUsersAvatar)
Opacity(
opacity:
!isOwnMessage && (!isNextSameAuthor || isBeforeDateSeparator)
? 1
: 0,
child: getAvatar(),
),
if (!messageOptions.showOtherUsersAvatar)
const Padding(padding: EdgeInsets.only(left: 10)), const Padding(padding: EdgeInsets.only(left: 10)),
GestureDetector( GestureDetector(
onLongPress: messageOptions.onLongPressMessage != null onLongPress: messageOptions.onLongPressMessage != null
...@@ -95,7 +101,7 @@ class MessageRow extends StatelessWidget { ...@@ -95,7 +101,7 @@ class MessageRow extends StatelessWidget {
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints( constraints: BoxConstraints(
maxWidth: messageOptions.maxWidth ?? maxWidth: messageOptions.maxWidth ??
MediaQuery.of(context).size.width * 0.7, MediaQuery.of(context).size.width * 0.8,
), ),
child: Column( child: Column(
crossAxisAlignment: isOwnMessage crossAxisAlignment: isOwnMessage
......
...@@ -57,32 +57,52 @@ class TextContainer extends StatelessWidget { ...@@ -57,32 +57,52 @@ class TextContainer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: messageOptions.messageDecorationBuilder != null margin: EdgeInsets.only(bottom: index == 0 ? 20 : 0),
? messageOptions.messageDecorationBuilder!( // background-image: linear-gradient(180deg, #be6afb, #9c67f6, #7965f8);
message, previousMessage, nextMessage) // background-image: linear-gradient(180deg, #3d3f54, #333450, #2b2b4d);
: defaultMessageDecoration( decoration: BoxDecoration(
color: isOwnMessage borderRadius: BorderRadius.only(
? (messageOptions.currentUserContainerColor ?? topLeft: !isOwnMessage ? Radius.circular(0) : Radius.circular(20),
Theme.of(context).primaryColor) topRight: Radius.circular(20),
: (messageOptions.containerColor ?? Colors.grey[100])!, bottomLeft: Radius.circular(20),
borderTopLeft: bottomRight:
isPreviousSameAuthor && !isOwnMessage && !isAfterDateSeparator isOwnMessage ? Radius.circular(0) : Radius.circular(20)
? 0.0 // bottomRight:
: 18.0, // isOwnMessage ? Radius.circular(20) : Radius.circular(0),
borderTopRight: ),
isPreviousSameAuthor && isOwnMessage && !isAfterDateSeparator gradient: LinearGradient(
? 0.0 colors: isOwnMessage
: 18.0, ? [Color(0xFFbe6afb), Color(0xFF9c67f6), Color(0xFF7965f8)]
borderBottomLeft: : [Color(0xFF3d3f54), Color(0xFF333450), Color(0xFF2b2b4d)],
!isOwnMessage && !isBeforeDateSeparator && isNextSameAuthor begin: Alignment.topCenter,
? 0.0 end: Alignment.bottomCenter,
: 18.0, )),
borderBottomRight: // decoration: messageOptions.messageDecorationBuilder != null
isOwnMessage && !isBeforeDateSeparator && isNextSameAuthor // ? messageOptions.messageDecorationBuilder!(
? 0.0 // message, previousMessage, nextMessage)
: 18.0, // : defaultMessageDecoration(
), // color: isOwnMessage
padding: messageOptions.messagePadding ?? const EdgeInsets.all(11), // ? (messageOptions.currentUserContainerColor ??
// Theme.of(context).primaryColor)
// : (messageOptions.containerColor ?? Colors.grey[100])!,
// borderTopLeft:
// isPreviousSameAuthor && !isOwnMessage && !isAfterDateSeparator
// ? 0.0
// : 18.0,
// borderTopRight:
// isPreviousSameAuthor && isOwnMessage && !isAfterDateSeparator
// ? 0.0
// : 18.0,
// borderBottomLeft:
// !isOwnMessage && !isBeforeDateSeparator && isNextSameAuthor
// ? 0.0
// : 18.0,
// borderBottomRight:
// isOwnMessage && !isBeforeDateSeparator && isNextSameAuthor
// ? 0.0
// : 18.0,
// ),
padding: messageOptions.messagePadding ?? const EdgeInsets.all(16),
child: DefaultMessageText( child: DefaultMessageText(
index: index, index: index,
messageLength: messageLength, messageLength: messageLength,
......
...@@ -126,58 +126,43 @@ class ApplicationController extends GetxController { ...@@ -126,58 +126,43 @@ class ApplicationController extends GetxController {
// handleIncomingLinks(); // handleIncomingLinks();
// 准备一些静态数据 // 准备一些静态数据
tabTitles = ['首页', '我的聊天', '个人中心']; tabTitles = ['AI对话', '创作', '私人助理', '我的'];
bottomTabs = <BottomNavigationBarItem>[ bottomTabs = <BottomNavigationBarItem>[
new BottomNavigationBarItem( // ignore: unnecessary_new
icon: Icon( const BottomNavigationBarItem(
Iconfont.fav, icon: Image(image: AssetImage("assets/images/home.png"), width: 24.0),
color: AppColors.tabBarElement, activeIcon: Image(
), image: AssetImage("assets/images/home-selected.png"), width: 24.0),
activeIcon: Icon( label: '百晓通',
Iconfont.home,
color: AppColors.secondaryElementText,
),
label: '首页',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
new BottomNavigationBarItem( const BottomNavigationBarItem(
icon: Icon( icon:
Iconfont.grid, Image(image: AssetImage("assets/images/product.png"), width: 24.0),
color: AppColors.tabBarElement, activeIcon: Image(
), image: AssetImage("assets/images/product-selected.png"),
activeIcon: Icon( width: 24.0),
Iconfont.grid, label: '创作',
color: AppColors.secondaryElementText,
),
label: '我的聊天',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
// new BottomNavigationBarItem( const BottomNavigationBarItem(
// icon: Icon( icon: Image(
// Iconfont.tag, image: AssetImage("assets/images/assistant.png"), width: 24.0),
// color: AppColors.tabBarElement, activeIcon: Image(
// ), image: AssetImage("assets/images/assistant-selected.png"),
// activeIcon: Icon( width: 24.0),
// Iconfont.tag, label: '私人助理',
// color: AppColors.secondaryElementText, backgroundColor: AppColors.primaryBackground,
// ), ),
// label: 'tag', const BottomNavigationBarItem(
// backgroundColor: AppColors.primaryBackground, icon: Image(image: AssetImage("assets/images/my.png"), width: 24.0),
// ), activeIcon: Image(
new BottomNavigationBarItem( image: AssetImage("assets/images/my-selected.png"), width: 24.0),
icon: Icon( label: '我的',
Iconfont.me,
color: AppColors.tabBarElement,
),
activeIcon: Icon(
Iconfont.me,
color: AppColors.secondaryElementText,
),
label: '个人中心',
backgroundColor: AppColors.primaryBackground, backgroundColor: AppColors.primaryBackground,
), ),
]; ];
pageController = new PageController(initialPage: state.page); pageController = PageController(initialPage: state.page);
} }
@override @override
......
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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart'; import 'package:chart/common/values/values.dart';
import 'package:chart/common/widgets/widgets.dart'; import 'package:chart/common/widgets/widgets.dart';
...@@ -37,21 +41,16 @@ class ApplicationPage extends GetView<ApplicationController> { ...@@ -37,21 +41,16 @@ class ApplicationPage extends GetView<ApplicationController> {
// 内容页 // 内容页
Widget _buildPageView() { Widget _buildPageView() {
return PageView( return PageView(
physics: NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: <Widget>[ controller: controller.pageController,
MainPage(), onPageChanged: controller.handlePageChanged,
// DashBoardPage(), // children: <Widget>[MainPage(), CategoryPage(), UserDetailPage()],
// Text("data"), children: <Widget>[
// Text("da"), HomePage(),
// MainPage(), CreationPage(),
CategoryPage(), AssistantPage(),
UserDetailPage() MyPage()
// Text('BookmarksPage'), ]);
// Text('AccountPage'),
],
controller: controller.pageController,
onPageChanged: controller.handlePageChanged,
);
} }
// 底部导航 // 底部导航
...@@ -104,29 +103,45 @@ class ApplicationPage extends GetView<ApplicationController> { ...@@ -104,29 +103,45 @@ class ApplicationPage extends GetView<ApplicationController> {
// letIndexChange: (index) => true, // letIndexChange: (index) => true,
// ), // ),
return Obx(() => BottomNavigationBar( return Obx(() => BottomNavigationBar(
items: controller.bottomTabs, // #363b48
currentIndex: controller.state.page, backgroundColor: Color.fromARGB(0, 54, 59, 72),
// fixedColor: AppColors.primaryElement, //
type: BottomNavigationBarType.fixed, // Color.fromARGB(255, 54, 59, 72),
onTap: controller.handleNavBarTap, // Color.argb(255, 82, 88, 103)
showSelectedLabels: false, fixedColor: Colors.white,
showUnselectedLabels: false, elevation: 0,
)); // Color(0x363b48FF),
items: controller.bottomTabs,
currentIndex: controller.state.page,
// fixedColor: AppColors.primaryElement,
type: BottomNavigationBarType.fixed,
onTap: controller.handleNavBarTap,
showSelectedLabels: true,
showUnselectedLabels: true,
selectedLabelStyle: TextStyle(
fontSize: 12,
)));
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Obx(() => Scaffold( return Container(
appBar: controller.state.page == 0 ? null : _buildAppBar(), decoration: BoxDecoration(
body: _buildPageView(), image: DecorationImage(
bottomNavigationBar: _buildBottomNavigationBar(), image: Image.asset("assets/images/background.png").image,
floatingActionButton: FloatingActionButton( fit: BoxFit.cover),
// elevation: 6.0, ),
// highlightElevation: 12.0, child: Obx(() => Scaffold(
child: Icon(Icons.chat), backgroundColor: Color.fromARGB(0, 0, 0, 0),
onPressed: controller.handleChat, // appBar: _buildAppBar(),
), body: _buildPageView(),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, bottomNavigationBar: _buildBottomNavigationBar(),
)); // floatingActionButton: FloatingActionButton(
// child: Icon(Icons.chat),
// onPressed: controller.handleChat,
// ),
// floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
)),
);
} }
} }
import 'package:get/get.dart';
import 'controller.dart';
class AssistantBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<AssistantController>(() => AssistantController());
}
}
import 'package:get/get.dart';
class AssistantController extends GetxController {
AssistantController();
_initData() {
update(["assistant"]);
}
void onTap() {}
// @override
// void onInit() {
// super.onInit();
// }
@override
void onReady() {
super.onReady();
_initData();
}
// @override
// void onClose() {
// super.onClose();
// }
}
library assistant;
export './controller.dart';
export './view.dart';
export './bindings.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class AssistantPage extends GetView<AssistantController> {
const AssistantPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return GridWidget();
}
@override
Widget build(BuildContext context) {
return GetBuilder<AssistantController>(
init: AssistantController(),
id: "assistant",
builder: (_) {
return Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
// appBar: AppBar(title: const Text("assistant"), elevation: 0),
body: SafeArea(
child: _buildView(),
),
);
},
);
}
}
This diff is collapsed.
library widgets;
// export 'news_page_list.dart';
export 'grid.dart';
...@@ -36,22 +36,6 @@ class ChatPageController extends GetxController { ...@@ -36,22 +36,6 @@ class ChatPageController extends GetxController {
/// 事件 /// 事件
void sendMessage(types.PartialText message) async { void sendMessage(types.PartialText message) async {
// 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 = types.TextMessage( final textMessage = types.TextMessage(
author: _user, author: _user,
createdAt: DateTime.now().millisecondsSinceEpoch, createdAt: DateTime.now().millisecondsSinceEpoch,
...@@ -59,17 +43,7 @@ class ChatPageController extends GetxController { ...@@ -59,17 +43,7 @@ class ChatPageController extends GetxController {
text: "${message.text}", text: "${message.text}",
); );
// final loadingMessage = types.TextMessage(
// author: receiveUser,
// createdAt: DateTime.now().millisecondsSinceEpoch,
// id: const Uuid().v4(),
// text: "loading",
// status: types.Status.sending,
// // "sending",
// );
_addMessage(textMessage); _addMessage(textMessage);
// _addMessage(loadingMessage);
try { try {
String? result = await NewsAPI.sendMessage( String? result = await NewsAPI.sendMessage(
......
...@@ -55,39 +55,3 @@ class ChatPage extends GetView<ChatPageController> { ...@@ -55,39 +55,3 @@ class ChatPage extends GetView<ChatPageController> {
final _user = const types.User( final _user = const types.User(
id: '82091008-a4aa-4a89-ae75-a22bf8d6f3aa', id: '82091008-a4aa-4a89-ae75-a22bf8d6f3aa',
); );
// Container(
// height: double.infinity,
// width: double.infinity,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: Image.asset("assets/images/bg.png").image,
// fit: BoxFit.cover),
// ),
// child: Chat(
// // onAttachmentPressed: _handleAttachmentPressed,
// // bubbleBuilder: _bubbleBuilder,
// theme: const DefaultChatTheme(
// // #1e1c39//#1e1c39#1e1c39#1e1c39
// // rgba(30, 28, 57, 1.00)
// backgroundColor: Color.fromRGBO(30, 28, 57, 0),
// // inputBackgroundColor: Colors.red,
// ),
// messages: controller.messageList,
// // messages: controller.state.messageList,
// // onAttachmentPressed: _handleAttachmentPressed,
// // onMessageTap: _handleMessageTap,
// // onPreviewDataFetched: _handlePreviewDataFetched,
// // onSendPressed: _handleSendPressed,
// showUserAvatars: true,
// showUserNames: true,
// // UserStore.to.isLogin
// // user: _user,
// l10n: const ChatL10nEn(
// inputPlaceholder: '请输入你的问题,并寻求解答...',
// attachmentButtonAccessibilityLabel: '继续',
// emptyChatPlaceholder: '暂无聊天信息',
// sendButtonAccessibilityLabel: '发送'),
// onSendPressed: controller.sendMessage, user: _user,
// )
\ No newline at end of file
...@@ -20,60 +20,19 @@ class ChartComponent extends StatelessWidget { ...@@ -20,60 +20,19 @@ class ChartComponent extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
// controller. // controller.
return Obx(() => Chat( return Obx(() => Chat(
// onAttachmentPressed: _handleAttachmentPressed,
// bubbleBuilder: _bubbleBuilder,
theme: const DefaultChatTheme( theme: const DefaultChatTheme(
// #1e1c39//#1e1c39#1e1c39#1e1c39
// rgba(30, 28, 57, 1.00)
backgroundColor: Color.fromRGBO(30, 28, 57, 0), backgroundColor: Color.fromRGBO(30, 28, 57, 0),
// inputBackgroundColor: Colors.red,
), ),
messages: controller.messageList, messages: controller.messageList,
// messages: controller.state.messageList,
// onAttachmentPressed: _handleAttachmentPressed,
// onMessageTap: _handleMessageTap,
// onPreviewDataFetched: _handlePreviewDataFetched,
// onSendPressed: _handleSendPressed,
showUserAvatars: true, showUserAvatars: true,
showUserNames: true, showUserNames: true,
// UserStore.to.isLogin
// user: _user,
l10n: const ChatL10nEn( l10n: const ChatL10nEn(
inputPlaceholder: '请输入你的问题,并寻求解答...', inputPlaceholder: '请输入你的问题,并寻求解答...',
attachmentButtonAccessibilityLabel: '继续', attachmentButtonAccessibilityLabel: '继续',
emptyChatPlaceholder: '暂无聊天信息', emptyChatPlaceholder: '暂无聊天信息',
sendButtonAccessibilityLabel: '发送'), sendButtonAccessibilityLabel: '发送'),
onSendPressed: controller.sendMessage, user: _user, onSendPressed: controller.sendMessage,
user: _user,
)); ));
// Obx(
// () => true
// ? Text("1321")
// : Chat(
// // onAttachmentPressed: _handleAttachmentPressed,
// // bubbleBuilder: _bubbleBuilder,
// theme: const DefaultChatTheme(
// // #1e1c39//#1e1c39#1e1c39#1e1c39
// // rgba(30, 28, 57, 1.00)
// backgroundColor: Color.fromRGBO(30, 28, 57, 0),
// // inputBackgroundColor: Colors.red,
// ),
// messages: controller.messageList,
// // messages: controller.state.messageList,
// // onAttachmentPressed: _handleAttachmentPressed,
// // onMessageTap: _handleMessageTap,
// // onPreviewDataFetched: _handlePreviewDataFetched,
// // onSendPressed: _handleSendPressed,
// showUserAvatars: true,
// showUserNames: true,
// // UserStore.to.isLogin
// // user: _user,
// l10n: const ChatL10nEn(
// inputPlaceholder: '请输入你的问题,并寻求解答...',
// attachmentButtonAccessibilityLabel: '继续',
// emptyChatPlaceholder: '暂无聊天信息',
// sendButtonAccessibilityLabel: '发送'),
// onSendPressed: controller.sendMessage, user: _user,
// ),
// );
} }
} }
import 'package:get/get.dart';
import 'controller.dart';
class CreationDetailBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<CreationDetailController>(() => CreationDetailController());
}
}
import 'package:chart/common/entities/detail.dart';
import 'package:get/get.dart';
import 'index.dart';
class CreationDetailController extends GetxController {
static CreationDetailController get to => Get.put(CreationDetailController());
CreationDetailController();
final state = CreationDetailState();
// final
// tap
void handleTap(int index) {
Get.snackbar(
"标题",
"消息",
);
}
void updateState(String title, List<DetailData> items) {
state.title = title;
state.detailList.value = [];
state.detailList.addAll(items);
}
/// 在 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 creation_detail;
export './state.dart';
export './controller.dart';
export './bindings.dart';
export './view.dart';
import 'package:chart/common/entities/detail.dart';
import 'package:get/get.dart';
class CreationDetailState {
// title
final _title = "".obs;
set title(value) => _title.value = value;
get title => _title.value;
RxList detailList = [].obs;
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'index.dart';
import 'widgets/widgets.dart';
class CreationDetailPage extends GetView<CreationDetailController> {
const CreationDetailPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return const HelloWidget();
}
@override
Widget build(BuildContext context) {
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(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
title: Text('${controller.state.title}'),
elevation: 0),
body: Container(
child: SafeArea(
child: _buildView(),
)),
)),
);
},
);
}
}
import 'package:chart/common/entities/detail.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gradient_borders/gradient_borders.dart';
import '../index.dart';
/// hello
class HelloWidget extends GetView<CreationDetailController> {
const HelloWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Obx(() => Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: controller.state.detailList.map((element) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${element.label}'),
TextField(
decoration: InputDecoration(
isDense: true,
hintText: '${element.placeHolder}',
filled: true,
// fillColor: fillColor ?? Colors.grey[100],
contentPadding: const EdgeInsets.only(
left: 18,
top: 15,
bottom: 15,
),
// suffixIcon: IconButton(
// onPressed: sendMessage,
// icon: Icon(
// Icons.send,
// size: 30,
// ),
// // rgba(123, 238, 251, 1.00)
// // rgba(122, 239, 251, 1.00)
// color: Color.fromRGBO(123, 238, 251, 1),
// ),
// Icon(Icons.abc_rounded),
// border: const InputBorder()
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(10),
// borderSide: const BorderSide(
// width: 10,
// style: BorderStyle.solid,
// ),
// ),
// rgba(116, 112, 249, 1.00)
enabledBorder: const GradientOutlineInputBorder(
// rgba(140, 197, 208, 1.00)
// borderRadius: BorderRadius.circular(10),
gradient: LinearGradient(colors: [
Color(0xFFb05ddd),
Color(0xFFb05ddd),
]),
width: 1,
),
disabledBorder: const GradientOutlineInputBorder(
// rgba(140, 197, 208, 1.00)
// borderRadius: BorderRadius.circular(10),
// ignore: prefer_const_literals_to_create_immutables
gradient: LinearGradient(colors: [
Color(0xFFb05ddd),
Color(0xFFb05ddd),
]),
width: 1,
),
// OutlineInputBorder(
// borderRadius:
// BorderRadius.circular(10),
// borderSide: const BorderSide(
// width: 5,
// style: BorderStyle.solid,
// ),
// ),
focusedBorder: const GradientOutlineInputBorder(
// rgba(140, 197, 208, 1.00)
// borderRadius: BorderRadius.circular(10),
gradient: LinearGradient(colors: [
Color(0xFFb05ddd),
Color(0xFFb05ddd),
]),
width: 1,
),
// focusedBorder: OutlineInputBorder(
// borderRadius: BorderRadius.circular(10),
// borderSide: const BorderSide(
// width: 5,
// style: BorderStyle.solid,
// ),
// ),
),
style: TextStyle(
// color: AppColors.primaryText,
fontWeight: FontWeight.w400,
fontSize: 14,
),
maxLines: 1,
// autocorrect: false, // 自动纠正
// obscureText: isPassword, // 隐藏输入内容, 密码框
),
],
);
}).toList(),
// children: controller.state.detailList
// .map((element) => element.label)
// .toList()
// children: [
// Text('${controller.state.detailList.length}'),
// ],
)));
}
}
library widgets;
export './hello.dart';
import 'package:get/get.dart';
import 'controller.dart';
class CreationBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<CreationController>(() => CreationController());
}
}
import 'package:chart/common/apis/apis.dart';
import 'package:chart/common/entities/selectAllEntity.dart';
import 'package:chart/common/routers/names.dart';
import 'package:chart/pages/creation-detail/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 CreationController extends GetxController {
CreationController();
final count = 0.obs;
final list = [].obs;
// RxList<Chat.ChatMessage>
_initData() async {
// ignore: invalid_use_of_protected_member
if (list.value.isEmpty) {
SelectAllEntity entity = await UserAPI.selectAll();
if (entity.status == 200) {
// list.addAll();
list.addAll(entity.data!);
}
}
// update(["creation"]);
}
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.getDetailParamsByDetailId(item.classifyId);
EasyLoading.dismiss();
CreationDetailController.to.updateState(item.detailName, res.data!);
Get.toNamed(AppRoutes.CREATION_PAGE_DETAIL);
//
}
void increment() {
count.value = count.value + 1;
// count.update((val) {
// print(val);
// val! + 1;
// });
}
// @override
// void onInit() {
// super.onInit();
// }
@override
void onReady() {
super.onReady();
_initData();
}
// @override
// void onClose() {
// super.onClose();
// }
}
library creation;
export './controller.dart';
export './view.dart';
export './bindings.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'index.dart';
import 'widgets/grid.dart';
class CreationPage extends GetView<CreationController> {
const CreationPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return GridWidget();
// return Obx(() => Center(
// child: InkWell(
// onTap: () => controller.increment(),
// child: Text('${controller.count}', style: TextStyle(fontSize: 40)),
// ),
// ));
}
@override
Widget build(BuildContext context) {
return GetBuilder<CreationController>(
init: CreationController(),
id: "creation",
builder: (_) {
return Scaffold(
backgroundColor: Color.fromARGB(0, 29, 33, 60),
// appBar: AppBar(
// backgroundColor: Color.fromARGB(255, 29, 33, 60),
// // title: const Text(
// // "创作",
// // ),
// elevation: 0),
body: SafeArea(
child: _buildView(),
),
);
},
);
}
}
This diff is collapsed.
library widgets;
// export 'news_page_list.dart';
export 'grid.dart';
...@@ -20,23 +20,6 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -20,23 +20,6 @@ class ChatNewPage extends GetView<ChatNewController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final c = Get.put(ChatPageController());
// Text(
// "${controller.state.page}",
// style: TextStyle(
// color: AppColors.primaryElementText,
// fontFamily: 'Montserrat',
// fontSize: 18,
// fontWeight: FontWeight.w600,
// ),
// )
// final c = Get.put(ChatNewController());
// return WillPopScope(
// onWillPop: () async {
// 禁止返回
// return false;
// },
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
return false; return false;
...@@ -52,11 +35,6 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -52,11 +35,6 @@ class ChatNewPage extends GetView<ChatNewController> {
), ),
onPressed: () { onPressed: () {
controller.share(); controller.share();
// Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application);
// Navigator.of(context).pop();
//_nextPage(-1);
}, },
) )
], ],
...@@ -83,11 +61,6 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -83,11 +61,6 @@ class ChatNewPage extends GetView<ChatNewController> {
onPressed: () { onPressed: () {
// Get.back(); // Get.back();
controller.closeChat(); controller.closeChat();
// Get.offAll(ApplicationPage());
// await Get.off(ApplicationPage());
// Get.toNamed(AppRoutes.Application);
// Navigator.of(context).pop();
//_nextPage(-1);
}, },
)), )),
body: Container( body: Container(
...@@ -104,33 +77,9 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -104,33 +77,9 @@ class ChatNewPage extends GetView<ChatNewController> {
child: Chat.DashChat( child: Chat.DashChat(
inputOptions: Chat.InputOptions( inputOptions: Chat.InputOptions(
inputDisabled: controller.state.isLoading, inputDisabled: controller.state.isLoading,
// controller.state.isLoading,
// alwaysShowSend: true,
// sendButtonBuilder: (send) => const Text("data"),
// showTraillingBeforeSend: true,
inputTextStyle: TextStyle(color: Colors.white), inputTextStyle: TextStyle(color: Colors.white),
inputToolbarStyle: BoxDecoration( inputToolbarStyle: BoxDecoration(
color: Color.fromRGBO(36, 40, 64, 1.00), color: Color.fromRGBO(36, 40, 64, 1.00),
//
// color: LinearGradient(
// width: 5,
// colors: [Colors.red, Colors.yellow],
// begin: Alignment.topLeft,
// end: Alignment.bottomRight,
// ),
// Color.fromRGBO(36, 40, 64, 1.00),
// border: Border.all(
// width: 5,
// color: LinearGradient(
// colors: [Colors.red, Colors.yellow],
// begin: Alignment.topLeft,
// end: Alignment.bottomRight,
// ),
// ),
// c
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(16), topLeft: Radius.circular(16),
topRight: Radius.circular(16)), topRight: Radius.circular(16)),
...@@ -138,88 +87,17 @@ class ChatNewPage extends GetView<ChatNewController> { ...@@ -138,88 +87,17 @@ class ChatNewPage extends GetView<ChatNewController> {
inputToolbarMargin: EdgeInsets.all(0), inputToolbarMargin: EdgeInsets.all(0),
sendButtonBuilder: null, sendButtonBuilder: null,
inputToolbarPadding: inputToolbarPadding:
// symmetric(horizontal: 10, vertical: 20)
EdgeInsets.only(top: 15, right: 15, left: 15, bottom: 35), EdgeInsets.only(top: 15, right: 15, left: 15, bottom: 35),
// inputToolbarPadding : const EdgeInsets.all(8.0),
// this.inputToolbarMargin = const EdgeInsets.only(top: 8.0),
// textController:
// sendButtonBuilder:
// () => TextButton(
// child: const Text("13213"),
// onPressed: (send) => {send()},
// )
// inputTextStyle: TextStyle(color: Colors.red),
// inputDecoration: InputDecoration(
// isDense: true,
// filled: true,
// fillColor: Colors.red,
// // contentPadding: const EdgeInsets.only(
// // left: 18,
// // top: 10,
// // bottom: 10,
// // ),
// // border: OutlineInputBorder(
// // borderRadius: BorderRadius.circular(25),
// // borderSide: const BorderSide(
// // width: 0,
// // style: BorderStyle.none,
// // ),
// // ),
// ),
), ),
// ${controller.state.messageList.length}条消息
currentUser: _user, currentUser: _user,
onSend: controller.sendMessage, onSend: controller.sendMessage,
// messageListOptions:
// const MessageListOptions(loadEarlierBuilder: Text("2131")),
messages: controller.state.messageList, messages: controller.state.messageList,
// messageListOptions: MessageListOptions(
// chatFooterBuilder: Container(
// color: Colors.red,
// width: double.infinity,
// height: 100.00,
// child: Text("footer")),
// ),
messageOptions: Chat.MessageOptions( messageOptions: Chat.MessageOptions(
onPressMessage: controller.tabMessage, onPressMessage: controller.tabMessage,
// containerColor: Colors.black, // containerColor: Colors.black,
), ),
), ),
))));
// Column(children: [
// ]),
// Chat(
// // onAttachmentPressed: _handleAttachmentPressed,
// // bubbleBuilder: _bubbleBuilder,
// theme: const DefaultChatTheme(
// // #1e1c39//#1e1c39#1e1c39#1e1c39
// // rgba(30, 28, 57, 1.00)
// backgroundColor: Color.fromRGBO(30, 28, 57, 0),
// // inputBackgroundColor: Colors.red,
// ),
// messages: controller.state.messageList.value,
// // messages: controller.state.messageList,
// // onAttachmentPressed: _handleAttachmentPressed,
// // onMessageTap: _handleMessageTap,
// // onPreviewDataFetched: _handlePreviewDataFetched,
// // onSendPressed: _handleSendPressed,
// showUserAvatars: true,
// showUserNames: true,
// // UserStore.to.isLogin
// // user: _user,
// l10n: const ChatL10nEn(
// inputPlaceholder: '请输入你的问题,并寻求解答...',
// attachmentButtonAccessibilityLabel: '继续',
// emptyChatPlaceholder: '暂无聊天信息',
// sendButtonAccessibilityLabel: '发送'),
// onSendPressed: controller.sendMessage, user: _user,
// ),
)
// Obx(() => )),
)));
} }
} }
......
import 'package:get/get.dart';
import 'controller.dart';
class HomeBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<HomeController>(() => HomeController());
}
}
This diff is collapsed.
library home;
export './controller.dart';
export './view.dart';
export './bindings.dart';
export './state.dart';
// import 'dart:ffi';
import 'package:chart/common/entities/entities.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import 'package:get/get.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
Chat.ChatUser _userPlaceHolder = Chat.ChatUser(
id: '0',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
class ChatPageState {
// 新闻翻页 // List<types.Message>
RxList<Chat.ChatMessage> messageList = <Chat.ChatMessage>[
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "【有志者,事竟成】用英文怎么说",
customProperties: {"title": '语言翻译', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "请帮我列出双色球的预测方法?",
customProperties: {"title": '难题破解', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "外星人真实存在吗?",
customProperties: {"title": '宇宙奥义', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "三星堆文化来自何方?",
customProperties: {"title": '历史谜题', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "若xy-x+y=0,且xy>0,则1/x-1/y的值为多少?",
customProperties: {"title": '学习工作', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "怎么做辣椒炒肉?",
customProperties: {"title": '美食烹饪', 'icon': 'a'}),
Chat.ChatMessage(
user: _userPlaceHolder,
createdAt: DateTime.now(),
// id: const Uuid().v4(),
text: "身高180cm,体重180斤,那么BMI值是多少?",
customProperties: {"title": '健康养身', 'icon': 'a'})
].obs;
// get _messageList =>
final _page = "AI聊天".obs;
set page(value) => _page.value = value;
get page => _page.value;
final RxBool _isLoading = false.obs;
set isLoading(value) => _isLoading.value = value;
get isLoading => _isLoading.value;
final _conversionId = 0.obs;
set conversionId(value) => _conversionId.value = value;
get conversionId => _conversionId.value;
final _isNext = 1.obs;
set isNext(value) => _isNext.value = value;
get isNext => _isNext.value;
// RxList<NewsItem> newsList = <NewsItem>[].obs;
}
import 'package:chart/common/routers/routes.dart';
import 'package:chart/common/values/values.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
import 'package:gradient_widgets/gradient_widgets.dart';
import '../../../common/widgets/app.dart';
import 'index.dart';
import 'package:chart/package/chat_dash/dash_chat_2.dart' as Chat;
import 'widgets/widgets.dart';
class HomePage extends GetView<HomeController> {
// 内容页
// Widget _buildView() {
// return HellowordWidget();
// }
@override
Widget build(BuildContext context) {
final cc = Get.put(HomeController());
return WillPopScope(
onWillPop: () async {
return false;
},
child: Obx(() => Scaffold(
backgroundColor: Color.fromARGB(0, 0, 0, 0),
appBar: transparentAppBar(
actions: [
IconButton(
tooltip: '分享',
icon: const Icon(
Icons.share,
color: AppColors.primaryElementText,
),
onPressed: () {
controller.share();
},
)
],
title: RichText(
text: TextSpan(children: [
TextSpan(
text: "${controller.state.page}",
style: TextStyle(
color: AppColors.primaryElementText,
fontFamily: 'Montserrat',
fontSize: 18,
fontWeight: FontWeight.w600,
)),
TextSpan(
text: "${controller.state.messageList.length}",
style: TextStyle(fontSize: 0)),
])),
leading: GradientButton(
// increaseHeightBy: -5,
// increaseWidthBy: -5,
elevation: 0,
shadowColor: Colors.black,
gradient: const LinearGradient(
colors: [
Color.fromARGB(255, 223, 188, 134),
Color.fromARGB(255, 244, 218, 129),
Color.fromARGB(255, 248, 228, 127)
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
child: Row(children: const [
Icon(
Icons.add_circle,
color: Colors.black,
size: 35,
),
SizedBox(
width: 10,
),
Text("订阅",
style: TextStyle(
color: Color.fromARGB(255, 95, 54, 0),
fontSize: 16))
]),
callback: () {})
// IconButton(
// tooltip: '返回上一页',
// icon: const Icon(
// Icons.arrow_back,
// color: AppColors.primaryElementText,
// ),
// onPressed: () {
// // Get.back();
// controller.closeChat();
// },
// ),
),
body: Container(
width: double.infinity,
height: double.infinity,
// color: Color.fromARGB(0, 255, 255, 0),
// color: Colors.red,
// Color.argb(255, 29, 33, 60)
// color: Color.fromARGB(0, 29, 33, 60),
// color: Color.fromARGB(255, 26, 27, 46),
child: 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(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),
),
currentUser: _user,
onSend: cc.sendMessage,
messages: cc.state.messageList,
messageOptions: Chat.MessageOptions(
onPressMessage: cc.tabMessage,
// containerColor: Colors.black,
),
),
))));
}
}
Chat.ChatUser _user = Chat.ChatUser(
id: '1',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
import 'package:flutter/material.dart';
import 'package:chart/common/values/values.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../index.dart';
class GridWidget extends GetView<HomeController> {
@override
Widget build(BuildContext context) {
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,
),
),
],
),
),
);
}
}
library widgets;
// export 'news_page_list.dart';
export 'chat.dart';
import 'package:get/get.dart';
import 'controller.dart';
class MyBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<MyController>(() => MyController());
}
}
import 'package:get/get.dart';
class MyController extends GetxController {
MyController();
_initData() {
update(["my"]);
}
void onTap() {}
// @override
// void onInit() {
// super.onInit();
// }
@override
void onReady() {
super.onReady();
_initData();
}
// @override
// void onClose() {
// super.onClose();
// }
}
library my;
export './controller.dart';
export './view.dart';
export './bindings.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'index.dart';
class MyPage extends GetView<MyController> {
const MyPage({Key? key}) : super(key: key);
// 主视图
Widget _buildView() {
return const Center(
child: Text("MyPage"),
);
}
@override
Widget build(BuildContext context) {
return GetBuilder<MyController>(
init: MyController(),
id: "my",
builder: (_) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 29, 33, 60),
appBar: AppBar(
elevation: 0,
title: const Text("我的"),
bottomOpacity: 0.1,
backgroundColor: Color.fromARGB(255, 29, 33, 60),
),
body: SafeArea(
child: _buildView(),
),
);
},
);
}
}
...@@ -22,13 +22,6 @@ packages: ...@@ -22,13 +22,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0" version: "5.0.0"
alipay_kit_ios:
dependency: "direct main"
description:
name: alipay_kit_ios
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
animated_text_kit: animated_text_kit:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -763,6 +756,13 @@ packages: ...@@ -763,6 +756,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
loading_animation_widget:
dependency: "direct main"
description:
name: loading_animation_widget
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0+4"
logging: logging:
dependency: transitive dependency: transitive
description: description:
......
...@@ -112,13 +112,14 @@ dependencies: ...@@ -112,13 +112,14 @@ dependencies:
social_login_buttons: ^1.0.7 social_login_buttons: ^1.0.7
flutter_markdown: ^0.6.14 flutter_markdown: ^0.6.14
alipay_kit: 5.0.0 alipay_kit: 5.0.0
alipay_kit_ios: 5.0.0 # alipay_kit_ios: 5.0.0
pointycastle: ^3.1.1 pointycastle: ^3.1.1
eventsource: ^0.4.0 eventsource: ^0.4.0
flutter_client_sse: ^1.0.0 flutter_client_sse: ^1.0.0
highlight: ^0.7.0 highlight: ^0.7.0
device_info_plus: ^8.1.0 device_info_plus: ^8.1.0
app_settings: ^4.2.0 app_settings: ^4.2.0
loading_animation_widget: ^1.2.0+4
# package:bubble/bubble.dart # 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