Я хотел показать результат или контент в полноэкранном режиме после нажатия на Список рекомендуемых на панели поиска, а не под панелью поиска, как показано на приведенном ниже снимке экрана ...
Пытался развлечь скучное шоу, но не смог понять, как они его достигли ?.
Заранее спасибо !!!
import 'package:flutter/material.dart';
import 'urls_index.dart';
import 'ContentPage.dart';
class DataSearch extends SearchDelegate<String> {
var names = new urlsindexs();
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = "";
},
),
];
}
@override
Widget buildLeading(BuildContext context) {
return IconButton(
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: transitionAnimation,
),
onPressed: () {
close(context, null);
});
}
@override
Widget buildResults(BuildContext context) {
return ContentPage();
}
@override
Widget buildSuggestions(BuildContext context) {
// TODO: implement buildSuggestions
var abc = query.isEmpty
? names.websitename
: names.websitename
.where((p) => p.toUpperCase().startsWith(query.toUpperCase()))
.toList();
return ListView.builder(
itemBuilder: (context, index) => ListTile(
onTap: () {
showResults(context);
},
title: RichText(
text: TextSpan(
text: abc[index].substring(0, query.length),
style: TextStyle(
color: Colors.black54, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: abc[index].substring(query.length),
style: TextStyle(color: Colors.grey))
]),
),
),
itemCount: abc.length,
);
}
}
Получение этого: https://ibb.co/vYW4G3x
Хотел добиться этого: https://ibb.co/pzBpNPK (без панели поиска)
решено!
Что я изменил ...
import 'package:flutter/material.dart';
import 'urls_index.dart';
class DataSearch extends SearchDelegate<String> {
var names = new urlsindexs();
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = "";
},
),
];
}
@override
Widget buildLeading(BuildContext context) {
// TODO: implement buildLeading
return IconButton(
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: transitionAnimation,
),
onPressed: () {
close(context, null);
});
}
@override
Widget buildResults(BuildContext context) {
// TODO: implement buildResults
var abc = query.isEmpty
? names.websitename
: names.websitename
.where((p) => p.toUpperCase().startsWith(query.toUpperCase()))
.toList();
return ListView.builder(
itemBuilder: (context, index) => ListTile(
onTap: () {
showResults(context);
},
title: RichText(
text: TextSpan(
text: abc[index].substring(0, query.length),
style: TextStyle(
color: Colors.black54, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: abc[index].substring(query.length),
style: TextStyle(color: Colors.grey))
]),
),
),
itemCount: abc.length,
);
}
@override
Widget buildSuggestions(BuildContext context) {
// TODO: implement buildSuggestions
var abc = query.isEmpty
? names.websitename
: names.websitename
.where((p) => p.toUpperCase().startsWith(query.toUpperCase()))
.toList();
return ListView.builder(
itemBuilder: (context, index) => ListTile(
onTap: () {
// showResults(context);
Navigator.of(context).pushNamed("/Store1");
},
title: RichText(
text: TextSpan(
text: abc[index].substring(0, query.length),
style: TextStyle(
color: Colors.black54, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: abc[index].substring(query.length),
style: TextStyle(color: Colors.grey))
]),
),
),
itemCount: abc.length,
);
}
}