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;
kEnvScaffoldKey.currentState?.closeDrawer();
},
onSecondaryTap: () {
ref.read(selectedEnvironmentIdStateProvider.notifier).state = id;
},
focusNode: ref.watch(nameTextFieldFocusNodeProvider),
onChangedNameEditor: (value) {
value = value.trim();

View File

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

View File

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

View File

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