Sticky Grid View For Flutter

Overview

Features

Listing images in gridview wrapped listview gives bad performance (display optimization fails), because ListView only optimizes certain self. It does not bother to optimize its own widgets. Therefore, the elements of the GridView are excluded from this state.

In addition, StickyGridView optimizes itself and all its sub-elements and prevents delays.

Usage

// First, create the header list.
// And then create the Map<String, List<GridImage>> map.
List<String> headers = [
    'Flags 1',
    'Flags 2',
    'Flags 3',
    'Flags 4',
    'Flags 5',
    'Flags 6'
  ];
  Map<String, List<GridImage>> map = {};
Future<void> initMap() async {
  double width = 28;
  double height = 20;
  for (int i = 0; i < headers.length; i++) {
    List<GridImage> gridImages = [];
    double y = i * height;
    int range = 5 + Random().nextInt(11);
    for (int j = 0; j < range; j++) {
      double x = j * width;
      GridImage gridImage = GridImage.fromAssetPart(
          'assets/images/all_flags.png', x, y, width, height);
      await gridImage.initUiImage();
      gridImages.add(gridItem);
    }
    map[headers[i]] = gridImages;
  }
}
Widget build(BuildContext context) {
  return StickyGridView(
      crossAxisCount: 6,
      map: map,
      headers: headers,
      onClick: (section, index) {
        ScaffoldMessenger.of(context).showSnackBar(SnackBar(
          content: Text('Section: $section, index: $index , header: ${headers[section]}'), duration: const Duration(milliseconds: 500),));
      });
}
You might also like...

A grid that supports both dragging and tapping to select its items

A grid that supports both dragging and tapping to select its items

drag_select_grid_view A grid that supports both dragging and tapping to select its items. Basic usage DragSelectGridView constructor is very similar t

Dec 11, 2022

Flutter agenda - Flutter Agenda View Package (pub.dev)

Flutter agenda - Flutter Agenda View Package (pub.dev)

Flutter Agenda View Agenda Widget Package for Flutter Features Image Video Recor

Apr 15, 2022

A periodic table app with 3D view of the elements built using flutter.

A periodic table app with 3D view of the elements built using flutter.

A flutter app which takes you on a 3d visualisation of the 118 elements of the periodic table. promo.mp4 Tech Stack Deployed using How it all began It

Nov 16, 2022

Flutter Split View and Drawer Navigation example

Flutter Split View and Drawer Navigation example

Flutter Split View and Drawer Navigation example This repo contains the source code for this tutorial: Responsive layouts in Flutter: Split View and D

Nov 17, 2022

Flutter Insert, Update, Delete and add form view dynamic

salesapp Insert, Update, Delete and form view add dynamic. Getting Started This project is a starting point for a Flutter application. A few resources

Dec 22, 2021

A flutter list view which can drag & move item to change order.

A flutter list view which can drag & move item to change order.

draggable_flutter_list A flutter list view which can drag & move item to change order. some codes come from flutter_list_drag_and_drop fix flutter_lis

Sep 22, 2022

Search and view popular Youtube videos with Youtube API in Flutter App

Search and view popular Youtube videos with Youtube API in Flutter App

getx_bottom_nav_sample The sample of AnimatedBottomNavBar with GetX 주요 Package 설명 1.url_launcher url_launcher pub.dev flutter 에서 인앱, 외부 브라우저로 연길 시켜 주는

Dec 25, 2021

A Flutter package for paginating a list view

A Flutter package for paginating a list view

paging A Flutter package for paginating a list view Installation Add this to your package's pubspec.yaml file dependencies: ... paging: ^latest.ve

Dec 12, 2022

Enhanced PDF view for Flutter.

Enhanced PDF view for Flutter.

flutter_cached_pdfview A package to show Native PDF View for iOS and Android, support Open from a different resource like Path, Asset or Url and Cache

Dec 30, 2022
Owner
null
A grid-based layout system for Flutter, inspired by CSS Grid Layout

Flutter Layout Grid A powerful grid layout system for Flutter, optimized for complex user interface design. Click images to see their code ✨ Featuring

Felt 307 Dec 24, 2022
A grid-based layout system for Flutter, inspired by CSS Grid Layout

Flutter Layout Grid A powerful grid layout system for Flutter, optimized for complex user interface design. Click images to see their code ✨ Featuring

Felt 307 Dec 24, 2022
Flutter package for displaying grid view of daily task like Github-Contributions.

flutter_annual_task flutter_annual_task Flutter package for displaying grid view of daily task like Github-Contributions. Example Usage Make sure to c

HuanSuh 24 Sep 21, 2022
UTS Mobile Programming membuat Grid view

uts_181021450006 A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

null 1 Mar 30, 2022
Flutter list view - An unofficial list view for flutter

Flutter List View I don't like official list view. There are some features don't

null 24 Dec 15, 2022
Swipeable button view - Create Ripple Animated Pages With Swipeable Button View

swipeable_button_view You can create ripple animated pages with swipeable_button

cemreonur 3 Apr 22, 2022
-UNDER DEVELOPMENT- a project built demonstrating model view view model architecture

mvvm_project A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Atuoha Anthony 4 Nov 28, 2022
Gol grid - a cellular automata flutter widget

GolGrid Conway's Game of Life in a flutter widget. A GolGrid is a rendering of a GridWorld controlled by a Thumper. Example The example contains two a

Jeff Regan 4 Mar 25, 2022
Flutter widget that arrange buttons in a grid.

flutter_grid_button Flutter widget that arrange buttons in a grid. It is useful for making a number pad, calculator, and so on. Getting Started To use

zuvola 11 Jan 10, 2022
Create a Grid Layout of IoT (Internet of Things) devices in a particular house.

Create a Grid Layout of IoT (Internet of Things) devices in a particular house. Keep it simple to just 4-6 devices. Each device will have an icon on its own. When you press the icon, toggle the image and toggle the text underneath between on and off.

null 0 Dec 30, 2021