From 27cdb00af253a55cae27697333c71a9ca65195c0 Mon Sep 17 00:00:00 2001 From: LZX <1820455493@qq.com> Date: Thu, 17 Sep 2026 19:45:53 +0800 Subject: [PATCH] 1 --- lib/l10n/app_en.arb | 5 +- lib/l10n/app_localizations.dart | 18 + lib/l10n/app_localizations_en.dart | 9 + lib/l10n/app_localizations_zh.dart | 9 + lib/l10n/app_zh.arb | 5 +- lib/widgets/code_editor_drawer.dart | 590 +++++++++++++++++++--------- test/drawer_activity_bar_test.dart | 138 +++++++ 7 files changed, 587 insertions(+), 187 deletions(-) create mode 100644 test/drawer_activity_bar_test.dart diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 854dd13..663075a 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1009,5 +1009,8 @@ } }, "chrootDisabledNoRoot": "Unavailable without Root permission", - "chrootFailedFallbackToProot": "Chroot mount or permission failed, automatically fell back to PRoot" + "chrootFailedFallbackToProot": "Chroot mount or permission failed, automatically fell back to PRoot", + "drawerTabExplorer": "Explorer", + "drawerTabSearch": "Search", + "drawerTabGit": "Source Control" } \ No newline at end of file diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 0942bd0..839b03a 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -3025,6 +3025,24 @@ abstract class AppLocalizations { /// In zh, this message translates to: /// **'Chroot 挂载或权限失败,已自动降级为 PRoot 运行模式'** String get chrootFailedFallbackToProot; + + /// No description provided for @drawerTabExplorer. + /// + /// In zh, this message translates to: + /// **'文件'** + String get drawerTabExplorer; + + /// No description provided for @drawerTabSearch. + /// + /// In zh, this message translates to: + /// **'搜索'** + String get drawerTabSearch; + + /// No description provided for @drawerTabGit. + /// + /// In zh, this message translates to: + /// **'源代码管理'** + String get drawerTabGit; } class _AppLocalizationsDelegate diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 0b2a949..d470d78 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1827,4 +1827,13 @@ class AppLocalizationsEn extends AppLocalizations { @override String get chrootFailedFallbackToProot => 'Chroot mount or permission failed, automatically fell back to PRoot'; + + @override + String get drawerTabExplorer => 'Explorer'; + + @override + String get drawerTabSearch => 'Search'; + + @override + String get drawerTabGit => 'Source Control'; } diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index 7130b41..bd4d758 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -1767,4 +1767,13 @@ class AppLocalizationsZh extends AppLocalizations { @override String get chrootFailedFallbackToProot => 'Chroot 挂载或权限失败,已自动降级为 PRoot 运行模式'; + + @override + String get drawerTabExplorer => '文件'; + + @override + String get drawerTabSearch => '搜索'; + + @override + String get drawerTabGit => '源代码管理'; } diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 9063c95..7bf5bb2 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -1009,5 +1009,8 @@ } }, "chrootDisabledNoRoot": "未授予 Root 权限不可用", - "chrootFailedFallbackToProot": "Chroot 挂载或权限失败,已自动降级为 PRoot 运行模式" + "chrootFailedFallbackToProot": "Chroot 挂载或权限失败,已自动降级为 PRoot 运行模式", + "drawerTabExplorer": "文件", + "drawerTabSearch": "搜索", + "drawerTabGit": "源代码管理" } \ No newline at end of file diff --git a/lib/widgets/code_editor_drawer.dart b/lib/widgets/code_editor_drawer.dart index 3b97205..09b2003 100644 --- a/lib/widgets/code_editor_drawer.dart +++ b/lib/widgets/code_editor_drawer.dart @@ -19,9 +19,16 @@ enum _OpenProjectSource { fromExternal, } -class CodeEditorDrawer extends StatelessWidget { +class CodeEditorDrawer extends StatefulWidget { const CodeEditorDrawer({super.key}); + @override + State createState() => _CodeEditorDrawerState(); +} + +class _CodeEditorDrawerState extends State { + int _selectedIndex = 0; + static ProjectProvider _getProjectProvider( BuildContext context, { bool listen = false, @@ -126,6 +133,393 @@ class CodeEditorDrawer extends StatelessWidget { } } + Widget _buildActivityBarItem({ + required BuildContext context, + required int index, + required IconData icon, + required String label, + }) { + final theme = Theme.of(context); + final isSelected = _selectedIndex == index; + final colorScheme = theme.colorScheme; + + return Tooltip( + message: label, + preferBelow: false, + child: InkWell( + onTap: () { + if (_selectedIndex != index) { + setState(() { + _selectedIndex = index; + }); + } + }, + child: SizedBox( + width: 48, + height: 48, + child: Stack( + alignment: Alignment.center, + children: [ + if (isSelected) + Positioned( + left: 0, + top: 10, + bottom: 10, + width: 3, + child: Container( + decoration: BoxDecoration( + color: colorScheme.primary, + borderRadius: const BorderRadius.only( + topRight: Radius.circular(2), + bottomRight: Radius.circular(2), + ), + ), + ), + ), + Icon( + icon, + size: 22, + color: isSelected + ? colorScheme.primary + : colorScheme.onSurfaceVariant.withValues(alpha: 0.7), + ), + ], + ), + ), + ), + ); + } + + Widget _buildActivityBar( + BuildContext context, + AppLocalizations l10n, + ThemeData theme, + ) { + return Container( + width: 48, + decoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerLow, + border: Border( + right: BorderSide( + color: theme.colorScheme.outlineVariant.withValues(alpha: 0.4), + width: 1, + ), + ), + ), + child: SafeArea( + bottom: true, + right: false, + child: Column( + children: [ + const SizedBox(height: 8), + _buildActivityBarItem( + context: context, + index: 0, + icon: Icons.folder_copy_outlined, + label: l10n.drawerTabExplorer, + ), + const SizedBox(height: 4), + _buildActivityBarItem( + context: context, + index: 1, + icon: Icons.search, + label: l10n.drawerTabSearch, + ), + const SizedBox(height: 4), + _buildActivityBarItem( + context: context, + index: 2, + icon: Icons.alt_route_rounded, + label: l10n.drawerTabGit, + ), + ], + ), + ), + ); + } + + Widget _buildExplorerPage( + BuildContext context, + AppLocalizations l10n, + ThemeData theme, + String? rootPath, + bool hasProject, + ) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + decoration: BoxDecoration( + color: theme.colorScheme.primaryContainer, + ), + child: SafeArea( + bottom: false, + left: false, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text( + l10n.fileDirectory, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + IconButton( + visualDensity: VisualDensity.compact, + icon: const Icon(Icons.refresh), + tooltip: l10n.refreshDirectory, + onPressed: () { + _getProjectProvider(context).refreshTree(); + final runProvider = context.read(); + final root = _getProjectProvider(context).rootPath; + if (root != null && root.isNotEmpty) { + runProvider?.onProjectOpened( + root, + systemName: context.read()?.selectedSystem, + ); + } + }, + ), + PopupMenuButton<_OpenProjectSource>( + icon: const Icon(Icons.folder_open), + tooltip: l10n.openFileDirectory, + itemBuilder: (popupContext) => [ + PopupMenuItem<_OpenProjectSource>( + value: _OpenProjectSource.fromApp, + child: Row( + children: [ + const Icon(Icons.inventory_2_outlined, size: 20), + const SizedBox(width: 8), + Text(l10n.openFromApp), + ], + ), + ), + PopupMenuItem<_OpenProjectSource>( + value: _OpenProjectSource.fromExternal, + child: Row( + children: [ + const Icon(Icons.folder_open_outlined, size: 20), + const SizedBox(width: 8), + Text(l10n.openFromExternal), + ], + ), + ), + ], + onSelected: (source) async { + switch (source) { + case _OpenProjectSource.fromApp: + Navigator.of(context).pop(); + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const ProjectManagementView(), + ), + ); + break; + case _OpenProjectSource.fromExternal: + final hasPermission = await PermissionService + .instance + .ensureStoragePermission(context: context); + if (!hasPermission || !context.mounted) return; + final canProceed = await _getTabProvider( + context, + ).checkUnsavedChanges(context); + if (!canProceed || !context.mounted) return; + _getProjectProvider(context).openDirectory(); + break; + } + }, + ), + IconButton( + visualDensity: VisualDensity.compact, + icon: const Icon(Icons.history), + tooltip: l10n.viewProjectHistory, + onPressed: () { + ProjectHistoryWidget.show( + context, + onSelectHistory: (selectedHistory) async { + final canProceed = await _getTabProvider( + context, + ).checkUnsavedChanges(context); + if (!canProceed || !context.mounted) return; + _getProjectProvider( + context, + ).switchProject(selectedHistory); + }, + ); + }, + ), + ], + ), + Row( + children: [ + Expanded( + child: Text( + hasProject + ? (InternalProjectService.instance + .isInternalProject(rootPath!) + ? p.basename(rootPath) + : rootPath) + : '', + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + if (hasProject) ...[ + const SizedBox(width: 4), + IconButton( + visualDensity: VisualDensity.compact, + style: IconButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + minimumSize: Size.zero, + padding: const EdgeInsets.all(3), + ), + constraints: const BoxConstraints( + minWidth: 24, + minHeight: 24, + ), + iconSize: 18, + icon: const Icon(Icons.note_add_outlined), + tooltip: l10n.newFile, + onPressed: () => _handleNewFile(context, rootPath!), + ), + const SizedBox(width: 2), + IconButton( + visualDensity: VisualDensity.compact, + style: IconButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + minimumSize: Size.zero, + padding: const EdgeInsets.all(3), + ), + constraints: const BoxConstraints( + minWidth: 24, + minHeight: 24, + ), + iconSize: 18, + icon: const Icon(Icons.create_new_folder_outlined), + tooltip: l10n.newFolder, + onPressed: () => + _handleNewFolder(context, rootPath!), + ), + const SizedBox(width: 2), + IconButton( + visualDensity: VisualDensity.compact, + style: IconButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + minimumSize: Size.zero, + padding: const EdgeInsets.all(3), + ), + constraints: const BoxConstraints( + minWidth: 24, + minHeight: 24, + ), + iconSize: 18, + icon: const Icon(Icons.file_upload_outlined), + tooltip: l10n.importFromExternal, + onPressed: () => + _handleImportFiles(context, rootPath!), + ), + ], + ], + ), + ], + ), + ), + ), + ), + const Expanded(child: SafeArea(top: false, left: false, child: FileTreeWidget())), + ], + ); + } + + Widget _buildSearchPlaceholder( + BuildContext context, + AppLocalizations l10n, + ThemeData theme, + ) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + decoration: BoxDecoration( + color: theme.colorScheme.primaryContainer, + ), + child: SafeArea( + bottom: false, + left: false, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 14.0), + child: Row( + children: [ + Expanded( + child: Text( + l10n.drawerTabSearch, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ], + ), + ), + ), + ), + const Expanded(child: SizedBox.shrink()), + ], + ); + } + + Widget _buildGitPlaceholder( + BuildContext context, + AppLocalizations l10n, + ThemeData theme, + ) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + decoration: BoxDecoration( + color: theme.colorScheme.primaryContainer, + ), + child: SafeArea( + bottom: false, + left: false, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 14.0), + child: Row( + children: [ + Expanded( + child: Text( + l10n.drawerTabGit, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ], + ), + ), + ), + ), + const Expanded(child: SizedBox.shrink()), + ], + ); + } + @override Widget build(BuildContext context) { final theme = Theme.of(context); @@ -135,194 +529,20 @@ class CodeEditorDrawer extends StatelessWidget { final hasProject = rootPath != null && rootPath.trim().isNotEmpty; return Drawer( - child: Column( + child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Container( - decoration: BoxDecoration( - color: theme.colorScheme.primaryContainer, - ), - child: SafeArea( - bottom: false, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - l10n.fileDirectory, - style: theme.textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, - ), - ), - const Spacer(), - IconButton( - icon: const Icon(Icons.refresh), - tooltip: l10n.refreshDirectory, - onPressed: () { - _getProjectProvider(context).refreshTree(); - final runProvider = context.read(); - final root = _getProjectProvider(context).rootPath; - if (root != null && root.isNotEmpty) { - // 传入当前真实选中的系统,无系统时不进行任何任务探测 - runProvider?.onProjectOpened( - root, - systemName: context.read()?.selectedSystem, - ); - } - }, - ), - PopupMenuButton<_OpenProjectSource>( - icon: const Icon(Icons.folder_open), - tooltip: l10n.openFileDirectory, - itemBuilder: (popupContext) => [ - PopupMenuItem<_OpenProjectSource>( - value: _OpenProjectSource.fromApp, - child: Row( - children: [ - const Icon(Icons.inventory_2_outlined, size: 20), - const SizedBox(width: 8), - Text(l10n.openFromApp), - ], - ), - ), - PopupMenuItem<_OpenProjectSource>( - value: _OpenProjectSource.fromExternal, - child: Row( - children: [ - const Icon(Icons.folder_open_outlined, size: 20), - const SizedBox(width: 8), - Text(l10n.openFromExternal), - ], - ), - ), - ], - onSelected: (source) async { - switch (source) { - case _OpenProjectSource.fromApp: - Navigator.of(context).pop(); - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const ProjectManagementView(), - ), - ); - break; - case _OpenProjectSource.fromExternal: - final hasPermission = await PermissionService - .instance - .ensureStoragePermission(context: context); - if (!hasPermission || !context.mounted) return; - final canProceed = await _getTabProvider( - context, - ).checkUnsavedChanges(context); - if (!canProceed || !context.mounted) return; - _getProjectProvider(context).openDirectory(); - break; - } - }, - ), - IconButton( - icon: const Icon(Icons.history), - tooltip: l10n.viewProjectHistory, - onPressed: () { - ProjectHistoryWidget.show( - context, - onSelectHistory: (selectedHistory) async { - final canProceed = await _getTabProvider( - context, - ).checkUnsavedChanges(context); - if (!canProceed || !context.mounted) return; - _getProjectProvider( - context, - ).switchProject(selectedHistory); - }, - ); - }, - ), - ], - ), - Row( - children: [ - Expanded( - child: Text( - hasProject - ? (InternalProjectService.instance - .isInternalProject(rootPath) - ? p.basename(rootPath) - : rootPath) - : '', - style: theme.textTheme.bodySmall?.copyWith( - color: theme.colorScheme.onSurfaceVariant, - ), - overflow: TextOverflow.ellipsis, - maxLines: 1, - ), - ), - if (hasProject) ...[ - const SizedBox(width: 6), - IconButton( - visualDensity: VisualDensity.compact, - style: IconButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - minimumSize: Size.zero, - padding: const EdgeInsets.all(3), - ), - constraints: const BoxConstraints( - minWidth: 24, - minHeight: 24, - ), - iconSize: 18, - icon: const Icon(Icons.note_add_outlined), - tooltip: l10n.newFile, - onPressed: () => _handleNewFile(context, rootPath), - ), - const SizedBox(width: 2), - IconButton( - visualDensity: VisualDensity.compact, - style: IconButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - minimumSize: Size.zero, - padding: const EdgeInsets.all(3), - ), - constraints: const BoxConstraints( - minWidth: 24, - minHeight: 24, - ), - iconSize: 18, - icon: const Icon(Icons.create_new_folder_outlined), - tooltip: l10n.newFolder, - onPressed: () => - _handleNewFolder(context, rootPath), - ), - const SizedBox(width: 2), - IconButton( - visualDensity: VisualDensity.compact, - style: IconButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - minimumSize: Size.zero, - padding: const EdgeInsets.all(3), - ), - constraints: const BoxConstraints( - minWidth: 24, - minHeight: 24, - ), - iconSize: 18, - icon: const Icon(Icons.file_upload_outlined), - tooltip: l10n.importFromExternal, - onPressed: () => - _handleImportFiles(context, rootPath), - ), - ], - ], - ), - ], - ), - ), + _buildActivityBar(context, l10n, theme), + Expanded( + child: IndexedStack( + index: _selectedIndex, + children: [ + _buildExplorerPage(context, l10n, theme, rootPath, hasProject), + _buildSearchPlaceholder(context, l10n, theme), + _buildGitPlaceholder(context, l10n, theme), + ], ), ), - const Expanded(child: SafeArea(top: false, child: FileTreeWidget())), ], ), ); diff --git a/test/drawer_activity_bar_test.dart b/test/drawer_activity_bar_test.dart new file mode 100644 index 0000000..597d149 --- /dev/null +++ b/test/drawer_activity_bar_test.dart @@ -0,0 +1,138 @@ +import 'dart:io'; +import 'package:code_editor/l10n/app_localizations.dart'; +import 'package:code_editor/models/project_history.dart'; +import 'package:code_editor/providers/project_provider.dart'; +import 'package:code_editor/providers/run_provider.dart'; +import 'package:code_editor/providers/settings_provider.dart'; +import 'package:code_editor/providers/tab_provider.dart'; +import 'package:code_editor/services/internal_project_service.dart'; +import 'package:code_editor/widgets/code_editor_drawer.dart'; +import 'package:code_editor/widgets/file_tree_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path/path.dart' as p; +import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + late Directory tempBaseDir; + late Directory testProjectDir; + late ProjectProvider projectProvider; + late TabProvider tabProvider; + late SettingsProvider settingsProvider; + late RunProvider runProvider; + + setUp(() async { + SharedPreferences.setMockInitialValues({}); + tempBaseDir = Directory.systemTemp.createTempSync('drawer_tab_test_'); + testProjectDir = Directory(p.join(tempBaseDir.path, 'my_project'))..createSync(); + + InternalProjectService.instance.customProjectsDir = + Directory(p.join(tempBaseDir.path, 'files', 'projects')); + + projectProvider = ProjectProvider(); + tabProvider = TabProvider()..bindProjectProvider(projectProvider); + settingsProvider = SettingsProvider(); + runProvider = RunProvider(); + + await projectProvider.switchProject( + ProjectHistory( + rootPath: testProjectDir.path, + lastOpenedFilePath: null, + ), + ); + }); + + tearDown(() { + InternalProjectService.instance.customProjectsDir = null; + if (tempBaseDir.existsSync()) { + tempBaseDir.deleteSync(recursive: true); + } + }); + + Widget buildTestWidget({Locale locale = const Locale('zh')}) { + return MultiProvider( + providers: [ + ChangeNotifierProvider.value(value: projectProvider), + ChangeNotifierProvider.value(value: tabProvider), + ChangeNotifierProvider.value(value: settingsProvider), + ChangeNotifierProvider.value(value: runProvider), + ], + child: MaterialApp( + localizationsDelegates: const [ + AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: const [ + Locale('zh'), + Locale('en'), + ], + locale: locale, + home: const Scaffold( + drawer: CodeEditorDrawer(), + body: Center(child: Text('Editor Body')), + ), + ), + ); + } + + testWidgets('Activity Bar renders 3 vertical tab buttons and switches pages correctly', (tester) async { + await tester.pumpWidget(buildTestWidget(locale: const Locale('zh'))); + final scaffoldState = tester.state(find.byType(Scaffold)); + scaffoldState.openDrawer(); + await tester.pumpAndSettle(); + + // 1. Initial state: Explorer is active + expect(find.byIcon(Icons.folder_copy_outlined), findsOneWidget); + expect(find.byIcon(Icons.search), findsOneWidget); + expect(find.byIcon(Icons.alt_route_rounded), findsOneWidget); + + // Initial page shows file tree and directory title ("项目") + expect(find.byType(FileTreeWidget), findsOneWidget); + expect(find.text('项目'), findsOneWidget); + + // Tooltips + expect(find.byTooltip('文件'), findsOneWidget); + expect(find.byTooltip('搜索'), findsOneWidget); + expect(find.byTooltip('源代码管理'), findsOneWidget); + + // 2. Tap Search tab + await tester.tap(find.byTooltip('搜索')); + await tester.pumpAndSettle(); + + // IndexedStack index is 1 -> Search page header is visible + final searchHeader = find.text('搜索'); + expect(searchHeader, findsWidgets); // tooltip & header title + + // 3. Tap Git tab + await tester.tap(find.byTooltip('源代码管理')); + await tester.pumpAndSettle(); + + // Git header is visible + final gitHeader = find.text('源代码管理'); + expect(gitHeader, findsWidgets); // tooltip & header title + + // 4. Tap back to Explorer + await tester.tap(find.byTooltip('文件')); + await tester.pumpAndSettle(); + + expect(find.byType(FileTreeWidget), findsOneWidget); + expect(find.text('项目'), findsOneWidget); + }); + + testWidgets('Activity Bar tooltips follow English locale', (tester) async { + await tester.pumpWidget(buildTestWidget(locale: const Locale('en'))); + final scaffoldState = tester.state(find.byType(Scaffold)); + scaffoldState.openDrawer(); + await tester.pumpAndSettle(); + + expect(find.byTooltip('Explorer'), findsOneWidget); + expect(find.byTooltip('Search'), findsOneWidget); + expect(find.byTooltip('Source Control'), findsOneWidget); + }); +}