1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 06:49:22 +00:00

Create search field

This commit is contained in:
Pierre HUBERT 2020-05-08 16:06:10 +02:00
parent 2311af8219
commit af079cc4b0
2 changed files with 47 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import 'package:comunic/ui/routes/main_route/main_route.dart'; import 'package:comunic/ui/routes/main_route/main_route.dart';
import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart'; import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart';
import 'package:comunic/ui/widgets/tablet_mode/global_search_field.dart';
import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart'; import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart';
import 'package:comunic/ui/widgets/tablet_mode/tablet_appbar_widget.dart'; import 'package:comunic/ui/widgets/tablet_mode/tablet_appbar_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -39,7 +40,9 @@ class _TabletRouteState extends State<TabletRoute> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
CurrentUserPanel(), CurrentUserPanel(),
Container(height: 20), Container(height: 10),
GlobalSearchField(),
Container(height: 10),
Expanded(child: MembershipsPanel()) Expanded(child: MembershipsPanel())
], ],
), ),

View File

@ -0,0 +1,43 @@
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Global search field
///
/// @author Pierre Hubert
const _MainSearchColor = Color(0xFF999990);
class GlobalSearchField extends StatefulWidget {
@override
_GlobalSearchFieldState createState() => _GlobalSearchFieldState();
}
class _GlobalSearchFieldState extends State<GlobalSearchField> {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
color: Color(0xFF374850),
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: TextField(
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
hintText: tr("Search..."),
hintStyle: TextStyle(color: _MainSearchColor),
suffixIcon: Icon(
Icons.search,
color: _MainSearchColor,
),
focusedBorder: InputBorder.none,
border: InputBorder.none,
alignLabelWithHint: false,
),
),
),
),
);
}
}