Flutter Component
Flutter Component
body: TextButton(
child: Text('Click hare!'),
onPressed: (){
print('The Button is Tapped!');
},
onLongPress: (){
print('This is long press!!');
},
)
);
Elevated Button
ElevatedButton(
child: Text('Button'),
onPressed: (){
print('Button Pressed!');
},
)
Outlined Button
OutlinedButton(
child: Text('Button'),
onPressed: (){
print('Button Pressed!');
},
)
Add Images
Center(
child: Container(
width: 100,
height: 100,
child: Image.asset('assets/images/new.jpg')) ,
)
Container(
//width: 300,
// height: 300,
color: Colors.yellow,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text('R1', style: TextStyle(fontSize: 30),),
Text('R2', style: TextStyle(fontSize: 30),),
Text('R3', style: TextStyle(fontSize: 30),),
Text('R4', style: TextStyle(fontSize: 30),),
Text('R4', style: TextStyle(fontSize: 30),)
],
),
Text('A', style: TextStyle(fontSize: 30),),
Text('B', style: TextStyle(fontSize: 30),),
Text('C', style: TextStyle(fontSize: 30),),
Text('D', style: TextStyle(fontSize: 30),),
Text('E', style: TextStyle(fontSize: 30),),
ElevatedButton(onPressed: (){
}, child: Text('Roshan'))
],
),
)
InkWell
Center(
child: InkWell(
onTap: (){
print('Hello World');
},
onDoubleTap: (){
print('Double Tap');
},
onLongPress: (){
print('Long press');
},
child: Container(
width: 200,
height: 200,
color: Colors.yellow,
child: Center(child: InkWell(
onTap: (){
print('text tapped');
},
child: Text('Tap Me',style: TextStyle(fontSize: 30,fontWeight:
FontWeight.w500),))),
),
),
)
Scroll
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: SingleChildScrollView(
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsets.only(bottom: 11),
child: Row(
children: [
Container(
margin: EdgeInsets.only(left: 11),
width: 200,
height: 200,
color: Colors.red,
),
Container(
margin: EdgeInsets.only(left: 11),
width: 200,
height: 200,
color: Colors.yellow,
),
Container(
margin: EdgeInsets.only(left: 11),
height: 200,
width: 200,
color: Colors.blue,
),
Container(
margin: EdgeInsets.only(left: 11),
height: 200,
width: 200,
color: Colors.grey,
),
],
),
),
),
Container(
margin: EdgeInsets.only(bottom: 11),
height: 200,
color: Colors.yellow,
),
Container(
margin: EdgeInsets.only(bottom: 11),
height: 200,
color: Colors.green,
),
Container(
margin: EdgeInsets.only(bottom: 11),
height: 200,
color: Colors.grey,
),
Container(
margin: EdgeInsets.only(bottom: 11),
height: 200,
color: Colors.blue,
)
],
),
),
),
)
List view
ListView.separated(itemBuilder:(context,index){
return Text(arrNames[index],);
},
itemCount: arrNames.length,
separatorBuilder: (context,index){
return Divider(height: 100,thickness: 2,);
},
)