🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / FLUTTER / Basit Hero Animations Kullanımı ayrıca SliverAppBar ile kullanımı

1-) FLUTTER - Basit Hero Animations Kullanımı ayrıca SliverAppBar ile kullanımı

 

EKRAN GÖRÜNTÜSÜ

 

 

kaynak : https://youtu.be/GsmP-NzXXa0

 

 

screen1.dart

 

child: Hero(
  tag:
'location-img-${logo}',
  child:
Image.asset(
    
"assets/images/${logo}.png",
    height:
150,
  ),
),

 

screen2.dart

 

child: Hero(
  tag:
'location-img-${widget.currentModel.logo}',
  child:
Image.asset(
    
"assets/images/${widget.currentModel.logo}.png",height: 150,),
)

 

GELİŞMİŞ BUNA BAKABİLİRSİN AYRICA

 

import 'package:flutter/material.dart';

import '../anasayfa_model.dart';

class GeciciPage extends StatefulWidget {
  
AnasayfaModel currentModel;

  
GeciciPage({required this.currentModel, Key? key}) : super(key: key);

  
@override
  
_MemnuniyetMainPageState createState() => _MemnuniyetMainPageState();
}

class _MemnuniyetMainPageState extends State<GeciciPage> {
  
@override
  
Widget build(BuildContext context) {
    
return SafeArea(
      child:
Container(
        child:
CustomScrollView(
          slivers: <
Widget>[
            
SliverAppBar(
              expandedHeight:
100.0,
              pinned:
true,
              flexibleSpace:
FlexibleSpaceBar(
                title:
Column(
                  mainAxisAlignment:
MainAxisAlignment.end,
                  crossAxisAlignment:
CrossAxisAlignment.start,
                  children:  <
Widget>[
                    
Text(widget.currentModel.ad,style: TextStyle(fontSize: 13)),
                    
Text('', style: TextStyle(fontSize: 10)),
                  ],
                ),
                background:
Hero(
                  tag:
'location-img-${widget.currentModel.logo}',
                  child:
Image.asset(
                    
"assets/images/${widget.currentModel.logo}.png",
                    height:
70,
                    alignment:
Alignment.centerRight,
                  ),
                ),
              ),
            ),
            
SliverList(
              delegate:
SliverChildBuilderDelegate(
                    (_,
int index) {
                  
return Container();
                },
                childCount:
1,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

 

 2022 Mart 02 Çarşamba
 590