Files
le-kiosque-flutter/lib/ui/view/search/search.dart
T
2021-03-22 17:56:42 +02:00

67 lines
1.9 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:le_kiosque_by_gcs/model/magazine.dart';
import 'package:le_kiosque_by_gcs/ui/view/search/item_mag_search.dart';
class SearchView extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: Removing test data
return Scaffold(
appBar: AppBar(
toolbarHeight: 65,
backgroundColor: Colors.white,
iconTheme: IconThemeData(
color: Color(0xFF545454), //change your color here
),
title: SizedBox(
height: 46,
child: TextField(
maxLines: 1,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(8),
prefixIcon: Icon(
Icons.search,
color: Color(0xFF545454),
),
hintText: 'Rechercher un article',
border: OutlineInputBorder(
borderRadius: const BorderRadius.all(
const Radius.circular(32.0),
),
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
),
filled: true,
fillColor: Colors.grey[200],
),
),
),
),
body: ListView.builder(
itemCount: magazinesTest.length + 1,
itemBuilder: (context, index) {
if (index == 0) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"Recherches récentes",
style: TextStyle(
fontSize: 22,
color: Color(0xFF3B3B3B),
),
),
);
} else {
return ItemMagazineSearch(
magazine: magazinesTest[index - 1],
);
}
},
),
);
}
}