Update main.dart

master
jack ning 3 years ago
parent 01d8b06e7b
commit 31a0cd7c76

@ -30,6 +30,11 @@ void main() {
String _subDomain = "vip";
//
BytedeskKefu.init(_appKey, _subDomain);
// 使:
// BytedeskKefu.initWithUsernameAndNicknameAndAvatar('myuniappusername', '我是美女', 'https://bytedesk.oss-cn-shenzhen.aliyuncs.com/avatars/girl.png', subDomain, appKey);
// BytedeskKefu.initWithUsername('myuniappusername',subDomain, appKey); // username
// /使 initWithUsernameAndNicknameinitWithUsernameAndNicknameAndAvatar
// bytedesk_kefu/bytedesk_kefu.dart
}
class MyApp extends StatefulWidget {
@ -63,44 +68,44 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
context: context,
tiles: [
ListTile(
title: Text('联系客服'),
trailing: Icon(Icons.keyboard_arrow_right),
title: const Text('联系客服'),
trailing: const Icon(Icons.keyboard_arrow_right),
onTap: () {
//
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new ChatTypePage();
.push(MaterialPageRoute(builder: (context) {
return const ChatTypePage();
}));
},
),
ListTile(
title: Text('用户信息'), //
trailing: Icon(Icons.keyboard_arrow_right),
title: const Text('用户信息'), //
trailing: const Icon(Icons.keyboard_arrow_right),
onTap: () {
// anonymousLogin
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new UserInfoPage();
.push(MaterialPageRoute(builder: (context) {
return UserInfoPage();
}));
},
),
ListTile(
title: Text('在线状态'), // 线
trailing: Icon(Icons.keyboard_arrow_right),
title: const Text('在线状态'), // 线
trailing: const Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new OnlineStatusPage();
.push(MaterialPageRoute(builder: (context) {
return OnlineStatusPage();
}));
},
),
ListTile(
title: Text('历史会话'), //
trailing: Icon(Icons.keyboard_arrow_right),
title: const Text('历史会话'), //
trailing: const Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new HistoryThreadPage();
.push(MaterialPageRoute(builder: (context) {
return HistoryThreadPage();
}));
},
),
@ -121,14 +126,17 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// },
// ),
ListTile(
title: Text('消息提示'),
trailing: Icon(Icons.keyboard_arrow_right),
title: const Text('消息提示'),
trailing: const Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new SettingPage();
.push(MaterialPageRoute(builder: (context) {
return SettingPage();
}));
},
),
const ListTile(
title: Text('技术支持: QQ-3群: 825257535'),
)
],
).toList()),
@ -209,7 +217,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
title: '客服会话');
},
);
}, duration: Duration(milliseconds: 4000));
}, duration: const Duration(milliseconds: 4000));
}
} else if (event.message.type == BytedeskConstants.MESSAGE_TYPE_IMAGE) {
print('图片消息:' + event.message.imageUrl!);

Loading…
Cancel
Save