Posts

Showing posts with the label Dart Example

Border Radius Container Flutter Width Code Example

Example 1: container flutter border radius Container ( decoration : BoxDecoration ( color : Colors . blue , borderRadius : BorderRadius . all ( Radius . circular ( 10 ) ) ) ) Example 2: container border radius flutter Container ( child : Text ( 'This is a Container' , textScaleFactor : 2 , style : TextStyle ( color : Colors . black ) , ) , decoration : BoxDecoration ( borderRadius : BorderRadius . circular ( 10 ) , color : Colors . white , border : Border ( left : BorderSide ( color : Colors . green , width : 3 , ) , ) , ) , height : 50 , ) ,

Border Radius For Card In Flutter Code Example

Example 1: card rounded corners flutter Card ( //Card with circular border shape : RoundedRectangleBorder ( borderRadius : BorderRadius . circular ( 15.0 ) , ) , child : Text ( 'Card with circular border' , textScaleFactor : 1.2 , ) , ) , Card ( //Card with beveled border shape : BeveledRectangleBorder ( borderRadius : BorderRadius . circular ( 10.0 ) , ) , child : Text ( 'Card with Beveled border' , textScaleFactor : 1.2 , ) , ) , Card ( shape : StadiumBorder ( //Card with stadium border side : BorderSide ( color : Colors . black , width : 2.0 , ) , ) , child : Text ( 'Card with Beveled border' , textScaleFactor : 1.2 , ) , ) , Example 2: how to give shape to card in flutter Card ( color : Colors . grey [ 900 ] , shape : RoundedRectangleBorder ( side : BorderSide ( color : Colors . white70 , width : 1 ) , ...

Bold Text In Flutter Code Example

Example 1: flutter text style bold Text ( 'My Card Alert' , style : TextStyle ( fontWeight : FontWeight . bold ) , ) Example 2: flutter font bold Text ( 'Some text' , style : TextStyle ( fontSize : 24 , fontWeight : FontWeight . bold ) , ) Example 3: how to style text in flutter Text ( 'text' style : TextStyle ( ) , ) ,

Card Padding Flutter Code Example

Example: flutter padding const Card ( child : Padding ( padding : EdgeInsets . all ( 16.0 ) , child : Text ( 'Hello World!' ) , ) , )

Checking Network Connectivity Flutter Code Example

Example: flutter check internet connection import 'package:connectivity/connectivity.dart' ; var connectivityResult = await ( Connectivity ( ) . checkConnectivity ( ) ) ; if ( connectivityResult == ConnectivityResult . mobile ) { // I am connected to a mobile network. } else if ( connectivityResult == ConnectivityResult . wifi ) { // I am connected to a wifi network. } //connectivity: any