mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Create search field
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
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/global_search_field.dart';
 | 
			
		||||
import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart';
 | 
			
		||||
import 'package:comunic/ui/widgets/tablet_mode/tablet_appbar_widget.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
@@ -39,7 +40,9 @@ class _TabletRouteState extends State<TabletRoute> {
 | 
			
		||||
          child: Column(
 | 
			
		||||
            children: <Widget>[
 | 
			
		||||
              CurrentUserPanel(),
 | 
			
		||||
              Container(height: 20),
 | 
			
		||||
              Container(height: 10),
 | 
			
		||||
              GlobalSearchField(),
 | 
			
		||||
              Container(height: 10),
 | 
			
		||||
              Expanded(child: MembershipsPanel())
 | 
			
		||||
            ],
 | 
			
		||||
          ),
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								lib/ui/widgets/tablet_mode/global_search_field.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								lib/ui/widgets/tablet_mode/global_search_field.dart
									
									
									
									
									
										Normal 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,
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user