“Refresh Indicator Flutter” Kode Jawaban

halaman penyegaran flutter

// Just insert this code to button to refresh page

Navigator.pushAndRemoveUntil(
  context,
  MaterialPageRoute(builder: (context) => MainPage()), // this mainpage is your page to refresh
  (Route<dynamic> route) => false,
);

// Example
IconButton(
	onPressed: () {
    	Navigator.pushAndRemoveUntil(
  			context,
  			MaterialPageRoute(builder: (context) => MyMainPage()), // this mymainpage is your page to refresh
  			(Route<dynamic> route) => false,
		);
    },
    icon: const Icon(Icons.refresh),
),
jaturon

Tarik flutter untuk menyegarkan widget

RefreshIndicator(
                onRefresh: () {},
                child: Container()
                )
Solo developer

menyegarkan layar flutter

Navigator.pushAndRemoveUntil(
  context,
  MaterialPageRoute(builder: (context) => MainPage()),
  (Route<dynamic> route) => false,
);
Blue-eyed Beaver

Refresh Indicator Flutter

final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =
      GlobalKey<RefreshIndicatorState>();

body: RefreshIndicator(
        key: _refreshIndicatorKey,
        color: Colors.white,
        backgroundColor: Colors.blue,
        strokeWidth: 4.0,
        onRefresh: () async {
          // Replace this delay with the code to be executed during refresh
          // and return a Future when code finishs execution.
          return Future<void>.delayed(const Duration(seconds: 3));
        },
        // Pull from top to show refresh indicator.
        child: ListView.builder(
          itemCount: 25,
          itemBuilder: (BuildContext context, int index) {
            return ListTile(
              title: Text('Item $index'),
            );
          },
        ),
      ),
Timur Turbil

Jawaban yang mirip dengan “Refresh Indicator Flutter”

Pertanyaan yang mirip dengan “Refresh Indicator Flutter”

Lebih banyak jawaban terkait untuk “Refresh Indicator Flutter” di Dart

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya