Update main.dart

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

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

Loading…
Cancel
Save