Flutter design

sourav mandal
May 8, 2022
Stack(
alignment: Alignment.center,
textDirection: TextDirection.rtl,
fit: StackFit.loose,
overflow: Overflow.visible,
clipBehavior: Clip.hardEdge,
children: <Widget>[]
),

gradient

gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Colors.blue,
Colors.red,
],
)

Tabbar

DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.flight)),
Tab(icon: Icon(Icons.directions_transit)),
Tab(icon: Icon(Icons.directions_car)),
],
),
title: Text('Tabs Demo'),
),
body: TabBarView(
children: [
Icon(Icons.flight, size: 350),
Icon(Icons.directions_transit, size: 350),
Icon(Icons.directions_car, size: 350),
],
),
),
);

alert box

showAlertDialog(BuildContext context,{topic,description,onCancel,onContinue}) {
// set up the buttons
Widget cancelButton = TextButton(
child: Text("Cancel"),
onPressed: onCancel,
);
Widget continueButton = TextButton(
child: Text("Continue"),
onPressed: onContinue,
);
// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: Text(topic),
content: Text(description),
actions: [
cancelButton,
continueButton,
],
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}

--

--

sourav mandal

just a coder who forgets things so makes blogs so he can remember later