Posts

Showing posts from February, 2023

All constructer of Scaffold class in flutter

  import 'package:flutter/material.dart' ; class practiingflutter extends StatefulWidget { const practiingflutter ({ Key ? key}) : super (key: key); @override State < practiingflutter > createState () => _practiingflutterState (); } class _practiingflutterState extends State < practiingflutter > { @override Widget build ( BuildContext context) { int _selectedIndex = 0 ; const List < Widget > _widgetOptions = < Widget >[ Text ( 'Home Page' , style: TextStyle (fontSize: 35 , fontWeight: FontWeight . bold )), Text ( 'Search Page' , style: TextStyle (fontSize: 35 , fontWeight: FontWeight . bold )), Text ( 'Profile Page' , style: TextStyle (fontSize: 35 , fontWeight: FontWeight . bold )), ]; void _onItemTapped ( int index) { setState(() { _selectedIndex = index; }); } return Scaffold ( // COnstructoer and properties of Scaffold appBar: AppBar ( ...

UI for login screen in flutter

  import 'package:flutter/material.dart' ; class loginPage extends StatefulWidget { const loginPage ({ Key ? key}) : super (key: key); @override State < loginPage > createState () => _loginPageState (); } class _loginPageState extends State < loginPage > { @override Widget build ( BuildContext context) { return Scaffold ( body: Container ( width: double . infinity , height: double . infinity , decoration: BoxDecoration ( gradient: LinearGradient ( colors: [ Color ( 0xFF92fe9d ), Color ( 0xFF00c9ff ) ], ) ), child: Center ( child: Container ( decoration: BoxDecoration ( borderRadius: BorderRadius . circular ( 10 ), boxShadow:[ BoxShadow ( blurRadius: 15 ), ], color: Colors . yellow , ), ...

Code for making a search box in flutter

Container ( padding: EdgeInsets . symmetric (horizontal: 15 ), decoration: BoxDecoration ( color: Colors . white , borderRadius: BorderRadius . circular ( 20 ) ), child: TextField ( decoration: InputDecoration ( contentPadding: EdgeInsets . all ( 0 ), prefixIcon: Icon ( Icons . search ,color: tdBlack ,size: 20 ,), prefixIconConstraints: BoxConstraints ( maxHeight: 20 , minWidth: 25 , ), border: InputBorder . none , hintText: 'Search' , hintStyle: TextStyle (color: tdGrey ) ), ), ),