FLUTTER ECOSYSTEM

amjadjamali06/intrinsic_grid_view

사용자 정의 GridView로, IntrinsicGridView는 내재된 너비와 높이를 가진 2차원 배열의 자식을 제공합니다.

intrinsic_grid_view 프로젝트 이미지
Stars
8
Forks
1
최근 푸시(UTC)
2021. 8. 6.
프로젝트 상태
활성
Amjad Jamali GitHub avatar
GITHUB User

Amjad Jamali ↗

Android Native And Flutter Developer...

SapphireJamshoro
언어DartSwiftKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

intrinsic_grid_view

pub package Likes popularity pub points Platform License GitHub code size in bytes GitHub stars

A Custom GridView, IntrinsicGridView provides 2D array of children with Intrinsic width and height.

Having two named Constructors

IntrinsicGridView.vertical scrolls in vertical direction.

IntrinsicGridView.horizontal scrolls in horizontal direction.

GridView vs IntrinsicGridView
Properties GridView IntrinsicGridView
contents overflow Yes No
children width vary with item width No Yes
children height vary with item height No Yes
if any children's height vary,
the adjacent child set new height
No Yes

Usage

  1. Add dependency.

Run this command with Flutter:

$ flutter pub add intrinsic_grid_view

or add following package in your pubspec.yaml file inside the dependencies: section.

dependencies:
  intrinsic_grid_view: ^0.0.2
  1. Importing the library:
import 'package:intrinsic_grid_view/intrinsic_grid_view.dart';
  1. Examples:

IntrinsicGridView.vertical example

https://user-images.githubusercontent.com/84534787/128336736-4869c161-9dc3-45ba-89b1-0a88494af8cf.gif?raw=true

code

      IntrinsicGridView.vertical(
          padding: EdgeInsets.only(top: 16, bottom: 12, left: 12, right: 12),
          // columnCount: 3,
          verticalSpace: 10,
          horizontalSpace: 10,
          children: [
            for (var scientist in scientists)
              _buildWidget(scientist),
          ]
      ), // IntrinsicGridView.vertical

IntrinsicGridView.horizontal example

https://user-images.githubusercontent.com/84534787/128336722-8c9998f4-e8e2-4c6a-ad0a-e7cb7351584f.gif?raw=true

code

      IntrinsicGridView.horizontal(
          padding: EdgeInsets.only(top: 16, bottom: 12, left: 12, right: 12),
          // rowCount: 1,
          verticalSpace: 10,
          horizontalSpace: 10,
          children: [
            for (var scientist in scientists)
              _buildHorizontalWidget(scientist),
          ]
      ), // IntrinsicGridView.horizontal

IntrinsicGridView.vertical + IntrinsicGridView.horizontal example

https://user-images.githubusercontent.com/84534787/128336422-6f6ee3e7-3729-4ed1-9415-f8fc03a9988f.gif?raw=true

code

        Column(
          children: [
            Expanded(
              flex: 3,
              child: Row(
                children: [
                  Expanded(
                    child: IntrinsicGridView.vertical(
                        padding: EdgeInsets.only(top: 16, bottom: 12, left: 12, right: 12),
                        columnCount: 1,
                        verticalSpace: 10,
                        horizontalSpace: 10,
                        children: [
                          for (var scientist in scientists)
                            _buildWidget(scientist),
                        ]
                    ), // IntrinsicGridView.vertical
                  ),

                  Expanded(
                    child: IntrinsicGridView.vertical(
                        padding: EdgeInsets.only(top: 16, bottom: 12, left: 12, right: 12),
                        // columnCount: 3,
                        verticalSpace: 10,
                        horizontalSpace: 10,
                        children: [
                          for (var scientist in scientists)
                            _buildWidget(scientist),
                        ]
                    ), // IntrinsicGridView.vertical
                  ),


                ],
              ),
            ),

            Expanded(
              child: IntrinsicGridView.horizontal(
                  padding: EdgeInsets.only(top: 16, bottom: 12, left: 12, right: 12),
                  // rowCount: 1,
                  verticalSpace: 10,
                  horizontalSpace: 10,
                  children: [
                    for (var scientist in scientists)
                      _buildHorizontalWidget(scientist),
                  ]
              ), // IntrinsicGridView.horizontal
            ),
          ],
        ),

Contributing

Suggestions and Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Developer Team:

Amjad Jamali & Kamran Khan

License

Apache 2.0