I have referred this Folder Picker .NET MAUI Link for folder picker. but I am not able to specify the particular file type in folder picker.
Like if I specify type as .txt then it should only show the folder which contains .txt files likewise.
public async Task<string> PickFolder()
{
var folderPicker = new WindowsFolderPicker();
// Might be needed to make it work on Windows 10
folderPicker.FileTypeFilter.Add(".txt");
// Get the current window's HWND by passing in the Window object
var hwnd = ((MauiWinUIWindow)App.Current.Windows[0].Handler.PlatformView).WindowHandle;
// Associate the HWND with the file picker
WinRT.Interop.InitializeWithWindow.Initialize(folderPicker, hwnd);
var result = await folderPicker.PickSingleFolderAsync();
return result?.Path;
}