Created
June 20, 2020 11:54
-
-
Save VB10/75d81588c373c250a10692752746827f to your computer and use it in GitHub Desktop.
image types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| main(List<String> args) { | |
| runApp(MaterialApp( | |
| home: new Scaffold( | |
| appBar: AppBar( | |
| title: Text("Flutter Dersleri"), | |
| ), | |
| floatingActionButton: FloatingActionButton( | |
| onPressed: () {}, | |
| child: Icon(Icons.add), | |
| ), | |
| body: Column( | |
| children: <Widget>[containerImageTypes(), rowImageTypeWidget(), Expanded(child: fadeInImage())], | |
| ), | |
| ), | |
| )); | |
| } | |
| Widget fadeInImage() { | |
| return Container( | |
| margin: EdgeInsets.all(2), | |
| color: Colors.red, | |
| child: Column( | |
| children: <Widget>[ | |
| Expanded( | |
| child: FadeInImage.assetNetwork( | |
| placeholder: "assets/images/loading.gif", | |
| image: | |
| "https://images.unsplash.com/photo-1592572234384-e5aa65e51860?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80"), | |
| ), | |
| Text("FadeinImage"), | |
| ], | |
| ), | |
| ); | |
| } | |
| Row rowImageTypeWidget() { | |
| return Row( | |
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
| children: <Widget>[ | |
| Expanded( | |
| child: Container( | |
| margin: EdgeInsets.all(2), | |
| color: Colors.red, | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
| children: <Widget>[ | |
| Container( | |
| child: Image.asset("assets/images/flutterlogo.png"), | |
| ), | |
| Text("Asset İmage"), | |
| ], | |
| ), | |
| ), | |
| ), | |
| Expanded( | |
| child: Container( | |
| margin: EdgeInsets.all(2), | |
| color: Colors.red, | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
| children: <Widget>[ | |
| Container( | |
| child: Image.network( | |
| "https://images.unsplash.com/photo-1592572234384-e5aa65e51860?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80"), | |
| ), | |
| Text("Network Image"), | |
| ], | |
| ), | |
| ), | |
| ), | |
| Expanded( | |
| child: Container( | |
| margin: EdgeInsets.all(2), | |
| color: Colors.red, | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
| children: <Widget>[ | |
| Container( | |
| child: CircleAvatar( | |
| backgroundImage: NetworkImage( | |
| "https://images.unsplash.com/photo-1592572234384-e5aa65e51860?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80"), | |
| ), | |
| ), | |
| Text("Circle avatar"), | |
| ], | |
| ), | |
| ), | |
| ) | |
| ], | |
| ); | |
| } | |
| Container containerImageTypes() { | |
| return Container( | |
| alignment: Alignment.center, | |
| child: Text( | |
| "Image Türleri", | |
| style: TextStyle(fontSize: 25), | |
| ), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment