FadeInImage.assetNetwork

FadeInImage.assetNetwork

FadeInImage.assetNetwork( placeholder, image )

açıklama

İnternetten resmi çekerken yukleniyor şeklinde gösterebilmeyi sağlar.

konum

MaterialApp({ title,theme, home: Scaffold({ appBar, body: Center(child:FadeInImage.assetNetwork(
                                    placeholder: "images/tenor.gif",
                                    image: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQT9m_TzOh3o0QnCYqqk5L6soJkqzJuRek7zFGKA6Mz1YariG3T',
                                  ),), }), })

parametreler

 FadeInImage.assetNetwork(
                                    placeholder: "images/tenor.gif",
                                    image: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQT9m_TzOh3o0QnCYqqk5L6soJkqzJuRek7zFGKA6Mz1YariG3T',
                                  ),

örnek uygulama

fading-in-asset-orn

/*
pubspec.yaml dosyasına aşağıdaki loading.gif satırı girilir. 
 flutter:
   assets:
+    - assets/loading.gif

*/

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final title = 'Fade in images';

    return MaterialApp(
      title: title,
      home: Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: Center(
          child: FadeInImage.assetNetwork(
            placeholder: 'assets/loading.gif',
            image: 'https://picsum.photos/250?image=9',
          ),
        ),
      ),
    );
  }
}

Bir cevap yazın

KAPAT
%d blogcu bunu beğendi: