fixes env card

This commit is contained in:
Ashita Prasad
2024-10-21 06:54:48 +05:30
parent 048e99d5e4
commit 576d543309
4 changed files with 14 additions and 16 deletions

View File

@ -193,6 +193,9 @@ class EnvironmentItem extends ConsumerWidget {
ref.read(selectedEnvironmentIdStateProvider.notifier).state = id; ref.read(selectedEnvironmentIdStateProvider.notifier).state = id;
kEnvScaffoldKey.currentState?.closeDrawer(); kEnvScaffoldKey.currentState?.closeDrawer();
}, },
onSecondaryTap: () {
ref.read(selectedEnvironmentIdStateProvider.notifier).state = id;
},
focusNode: ref.watch(nameTextFieldFocusNodeProvider), focusNode: ref.watch(nameTextFieldFocusNodeProvider),
onChangedNameEditor: (value) { onChangedNameEditor: (value) {
value = value.trim(); value = value.trim();

View File

@ -96,6 +96,7 @@ class SidebarEnvironmentCard extends StatelessWidget {
focusNode: focusNode, focusNode: focusNode,
style: Theme.of(context).textTheme.bodyMedium, style: Theme.of(context).textTheme.bodyMedium,
onTapOutside: (_) { onTapOutside: (_) {
FocusScope.of(context).unfocus();
onTapOutsideNameEditor?.call(); onTapOutsideNameEditor?.call();
}, },
onFieldSubmitted: (value) { onFieldSubmitted: (value) {

View File

@ -117,17 +117,15 @@ class SidebarRequestCard extends StatelessWidget {
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
), ),
), ),
kIsMobile Visibility(
? Visibility( visible: isSelected && !inEditMode,
visible: isSelected && !inEditMode, child: SizedBox(
child: SizedBox( width: 28,
width: 28, child: ItemCardMenu(
child: ItemCardMenu( onSelected: onMenuSelected,
onSelected: onMenuSelected, ),
), ),
), ),
)
: kSizedBoxEmpty,
], ],
), ),
), ),

View File

@ -349,11 +349,7 @@ void main() {
await tester.pump(); await tester.pump();
await tester.tap(find.byType(RequestItem)); await tester.tap(find.byType(RequestItem));
await tester.pump(); await tester.pump();
// await tester.tap(find.byIcon(Icons.more_vert).at(1)); await tester.tap(find.byIcon(Icons.more_vert).at(1));
await tester.tap(
find.byType(RequestItem),
buttons: kSecondaryButton,
);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
// Tap on the "Rename" option in the menu // Tap on the "Rename" option in the menu