Browse Source

Remove unnecessary Row and Flexible widget

vishnukvmd 2 năm trước cách đây
mục cha
commit
811e67b780
1 tập tin đã thay đổi với 50 bổ sung56 xóa
  1. 50 56
      lib/ui/viewer/search/search_widget.dart

+ 50 - 56
lib/ui/viewer/search/search_widget.dart

@@ -59,65 +59,59 @@ class _SearchWidgetState extends State<SearchWidget> {
         child: Column(
           children: [
             const SizedBox(height: 8),
-            Row(
-              children: [
-                Flexible(
-                  child: Container(
-                    color: Theme.of(context).colorScheme.defaultBackgroundColor,
-                    child: TextFormField(
-                      style: Theme.of(context).textTheme.subtitle1,
-                      decoration: InputDecoration(
-                        hintText: 'Search for albums, locations & files',
-                        filled: true,
-                        contentPadding: const EdgeInsets.symmetric(
-                          horizontal: 16,
-                          vertical: 14,
-                        ),
-                        border: UnderlineInputBorder(
-                          borderSide: BorderSide.none,
-                          borderRadius: BorderRadius.circular(8),
-                        ),
-                        focusedBorder: const UnderlineInputBorder(
-                          borderSide: BorderSide.none,
-                        ),
-                        prefixIcon: Hero(
-                          tag: "search_icon",
-                          child: Icon(
-                            Icons.search,
-                            color: Theme.of(context)
-                                .colorScheme
-                                .iconColor
-                                .withOpacity(0.5),
-                          ),
-                        ),
-                        suffixIcon: IconButton(
-                          onPressed: () {
-                            Navigator.pop(context);
-                          },
-                          icon: Icon(
-                            Icons.close,
-                            color: Theme.of(context)
-                                .colorScheme
-                                .iconColor
-                                .withOpacity(0.5),
-                          ),
-                        ),
-                      ),
-                      onChanged: (value) async {
-                        final List<SearchResult> allResults =
-                            await getSearchResultsForQuery(value);
-                        if (mounted) {
-                          setState(() {
-                            results.clear();
-                            results.addAll(allResults);
-                          });
-                        }
-                      },
-                      autofocus: true,
+            Container(
+              color: Theme.of(context).colorScheme.defaultBackgroundColor,
+              child: TextFormField(
+                style: Theme.of(context).textTheme.subtitle1,
+                decoration: InputDecoration(
+                  hintText: 'Search for albums, locations & files',
+                  filled: true,
+                  contentPadding: const EdgeInsets.symmetric(
+                    horizontal: 16,
+                    vertical: 14,
+                  ),
+                  border: UnderlineInputBorder(
+                    borderSide: BorderSide.none,
+                    borderRadius: BorderRadius.circular(8),
+                  ),
+                  focusedBorder: const UnderlineInputBorder(
+                    borderSide: BorderSide.none,
+                  ),
+                  prefixIcon: Hero(
+                    tag: "search_icon",
+                    child: Icon(
+                      Icons.search,
+                      color: Theme.of(context)
+                          .colorScheme
+                          .iconColor
+                          .withOpacity(0.5),
+                    ),
+                  ),
+                  suffixIcon: IconButton(
+                    onPressed: () {
+                      Navigator.pop(context);
+                    },
+                    icon: Icon(
+                      Icons.close,
+                      color: Theme.of(context)
+                          .colorScheme
+                          .iconColor
+                          .withOpacity(0.5),
                     ),
                   ),
                 ),
-              ],
+                onChanged: (value) async {
+                  final List<SearchResult> allResults =
+                      await getSearchResultsForQuery(value);
+                  if (mounted) {
+                    setState(() {
+                      results.clear();
+                      results.addAll(allResults);
+                    });
+                  }
+                },
+                autofocus: true,
+              ),
             ),
             results.isNotEmpty
                 ? SearchSuggestionsWidget(results)