Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter sliverAppBar

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}
class MyApp extends StatefulWidget {
  const MyApp({ Key? key }) : super(key: key);

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
      
    );
  }
}
class HomePage extends StatefulWidget {
  const HomePage({ Key? key }) : super(key: key);

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

class _HomePageState extends State<HomePage> {
  var sona= ['manush','ShoyTan'];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: [
          SliverAppBar(
            backgroundColor: Colors.blue.withOpacity(0.7),
            leading: Icon(Icons.menu),
            actions: [
              
              Icon(Icons.notifications),
              Icon(Icons.search),
              // Shohel Rana Shanto
              ],
            pinned: true,
           
          
            expandedHeight: 200,
            floating: true,
            flexibleSpace: FlexibleSpaceBar(
              
              title: Text('Flutter Sliver'),
                centerTitle: true,
                background: Image(image: NetworkImage('https://pfps.gg/assets/banners/2547-illusion-gif.gif'), fit: BoxFit.cover,),

              ),
              
            ),

         SliverList(
           
           delegate: SliverChildBuilderDelegate(
        
           (context,index){
             
             return Card(
               color: Colors.pink[100*(index%9+1)],
               child: ListTile(title: Text(sona[index]),),
             );
           },
           childCount: sona.length ,
           addAutomaticKeepAlives: false,
         )),
         SliverGrid(
           
           delegate: SliverChildBuilderDelegate(
        
           (context,index){
             
             return Card(
               color: Colors.green[100*(index%9+1)],
               child: ListTile(title: Text("shohel$index"),),
             );
           },
           childCount: 100,
         ),
         gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
         ),
        ],
      ),
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: get length of map flutter 
Dart :: string to int in dart 
Dart :: convert string date to datetime and format 
Dart :: dart object to map 
Dart :: how to do type casting in dart for string 
Dart :: dart time 
Dart :: for in dart 
Dart :: flutter list to map 
Dart :: Named parameters dart 
Dart :: how to make an empty splash screen in flutter 
Dart :: price discount cross flutter text 
Dart :: how to use future Dropownitem list in flutter 
Dart :: getting date from 12am dart 
Dart :: dart class 
Dart :: flutter get global context 
Dart :: flutter widget destructor 
Dart :: function in dart 
Dart :: english_words.dart 
Dart :: parse int to string in flutter 
Dart :: @override dart 
Dart :: android studio not detecting new package in flutter 
Dart :: how to define format snippet of class name as file name in dart : flutter 
Dart :: toolbar image dart 
Dart :: add sound to my flutter app 
Dart :: convert data type dart 
Dart :: limited box flutter 
Swift :: How to convert radians to degrees swift ui 
Swift :: swift stackview content inset 
Swift :: how to flip or toggle boolean value in swift 
Swift :: run a function only once swift 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =