Skip to content
代码片段 群组 项目
提交 c52d6ee9 编辑于 作者: miaolu's avatar miaolu 提交者: Neil Wang
浏览文件

feat: #259 用户分享议题"

上级 34c34df5
未找到相关分支
未找到相关标签
无相关合并请求
......@@ -29,7 +29,7 @@ class HomeAppBarRequiredParams {
titleTextStyle: titleTextStyle,
actions: actions,
orElseLeading: InkWell(
child: const Icon(Icons.menu),
child: const Icon(Icons.density_medium),
onTap: () {
GlobalKeys.rootScaffoldKey.currentState?.openDrawer();
},
......
......@@ -74,20 +74,23 @@ class _DiscussionsPageState extends State<DiscussionsPage> {
showLeading: true,
actions: [
Container(
margin: const EdgeInsets.only(right: 12, top: 16),
margin: const EdgeInsets.only(right: 12),
child: PopupMenuButton<String>(
padding: EdgeInsets.zero,
position: PopupMenuPosition.under,
itemBuilder: (context) => ['copy link', 'copy title and link']
itemBuilder: (context) => ['Copy Link', 'Copy Title & Link']
.map((item) => PopupMenuItem<String>(
onTap: () {
Clipboard.setData(ClipboardData(text: item == 'copy link' ? _model.issueDetail.webUrl : _model.issueDetail.title + _model.issueDetail.webUrl));
Clipboard.setData(ClipboardData(text: item == 'Copy Link' ? _model.issueDetail.webUrl : _model.issueDetail.title + _model.issueDetail.webUrl));
Toast.success(context, 'Link copied to clipboard');
},
value: item,
child: Text(item)))
child: Text(
item,
textAlign: TextAlign.center,
)))
.toList(),
child: const Text('Copy'),
child: const Icon(Icons.open_in_new, color: Color(0xFF66696D)),
)),
],
);
......
......@@ -45,7 +45,7 @@ void main() {
child: MaterialApp(home: Scaffold(key: GlobalKeys.rootScaffoldKey, drawer: const HomeDrawer(), body: element['body'] as Widget))));
await tester.pumpAndSettle();
await tester.tap(find.byIcon(Icons.menu));
await tester.tap(find.byIcon(Icons.density_medium));
await tester.pumpAndSettle();
expect(find.byType(Drawer), findsOneWidget);
......
......@@ -45,7 +45,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(TodoListPage), findsOneWidget);
await tester.tap(find.byIcon(Icons.menu));
await tester.tap(find.byIcon(Icons.density_medium));
await tester.pumpAndSettle();
expect(find.byType(Drawer), findsOneWidget);
......@@ -104,7 +104,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(TodoListPage), findsOneWidget);
await tester.tap(find.byIcon(Icons.menu));
await tester.tap(find.byIcon(Icons.density_medium));
await tester.pumpAndSettle();
await tester.tap(find.text('Post-Sales service'));
......@@ -151,7 +151,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(TodoListPage), findsOneWidget);
await tester.tap(find.byIcon(Icons.menu));
await tester.tap(find.byIcon(Icons.density_medium));
await tester.pumpAndSettle();
await tester.tap(find.text('Post-Sales service'));
......
......@@ -57,7 +57,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: Projects()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsOneWidget);
expect(find.byIcon(Icons.density_medium), findsOneWidget);
UserProvider().fullReset();
TokenProvider().fullReset();
......@@ -69,7 +69,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: Projects()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsNothing);
expect(find.byIcon(Icons.density_medium), findsNothing);
UserProvider().fullReset();
TokenProvider().fullReset();
......
......@@ -22,7 +22,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: Resources()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsOneWidget);
expect(find.byIcon(Icons.density_medium), findsOneWidget);
UserProvider().fullReset();
TokenProvider().fullReset();
......@@ -35,7 +35,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: Resources()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsNothing);
expect(find.byIcon(Icons.density_medium), findsNothing);
UserProvider().fullReset();
TokenProvider().fullReset();
......
......@@ -78,20 +78,20 @@ void main() {
));
await tester.pumpAndSettle();
expect(find.text('Copy'), findsOneWidget);
await tester.tap(find.text('Copy'));
expect(find.byIcon(Icons.open_in_new), findsOneWidget);
await tester.tap(find.byIcon(Icons.open_in_new));
await tester.pumpAndSettle();
expect(find.text("copy link"), findsOneWidget);
expect(find.text("copy title and link"), findsOneWidget);
expect(find.text("Copy Link"), findsOneWidget);
expect(find.text("Copy Title & Link"), findsOneWidget);
await tester.tap(find.text('copy link'));
await tester.tap(find.text('Copy Link'));
for (int i = 0; i < 5; i++) {
await tester.pumpAndSettle(const Duration(seconds: 1));
}
await tester.tap(find.text('Copy'));
await tester.tap(find.byIcon(Icons.open_in_new));
await tester.pumpAndSettle();
await tester.tap(find.text('copy title and link'));
await tester.tap(find.text('Copy Title & Link'));
for (int i = 0; i < 5; i++) {
await tester.pumpAndSettle(const Duration(seconds: 1));
}
......
......@@ -76,7 +76,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: TodoListPage()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsOneWidget);
expect(find.byIcon(Icons.density_medium), findsOneWidget);
UserProvider().fullReset();
TokenProvider().fullReset();
......@@ -88,7 +88,7 @@ void main() {
child: const MaterialApp(home: Scaffold(body: TodoListPage()))));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.menu), findsNothing);
expect(find.byIcon(Icons.density_medium), findsNothing);
UserProvider().fullReset();
TokenProvider().fullReset();
......@@ -106,7 +106,7 @@ void main() {
child: MaterialApp(home: Scaffold(key: GlobalKeys.rootScaffoldKey, drawer: const HomeDrawer(), body: const TodoListPage()))));
await tester.pumpAndSettle();
await tester.tap(find.byIcon(Icons.menu));
await tester.tap(find.byIcon(Icons.density_medium));
await tester.pumpAndSettle();
expect(find.byType(Drawer), findsOneWidget);
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
想要评论请 注册