Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 32

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -45,7 +45,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.examples"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
10 changes: 1 addition & 9 deletions examples/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -18,15 +19,6 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
2 changes: 1 addition & 1 deletion examples/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
Expand Down
53 changes: 53 additions & 0 deletions examples/lib/examples/reorderable_list.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:examples/common.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';

class ReorderablePage extends StatelessWidget {
ReorderablePage({
Key? key,
}) : super(key: key);

final List<StaggeredGridTile> widgets = [
const StaggeredGridTile.count(
crossAxisCellCount: 2,
mainAxisCellCount: 2,
child: Tile(index: 0),
),
const StaggeredGridTile.count(
crossAxisCellCount: 2,
mainAxisCellCount: 1,
child: Tile(index: 1),
),
const StaggeredGridTile.count(
crossAxisCellCount: 1,
mainAxisCellCount: 1,
child: Tile(index: 2),
),
const StaggeredGridTile.count(
crossAxisCellCount: 1,
mainAxisCellCount: 1,
child: Tile(index: 3),
),
const StaggeredGridTile.count(
crossAxisCellCount: 4,
mainAxisCellCount: 2,
child: Tile(index: 4),
),
];

@override
Widget build(BuildContext context) {
return AppScaffold(
title: 'Reorderable',
child: ReorderableStaggeredLayout(
crossAxisCount: 4,
mainAxisSpacing: 4,
crossAxisSpacing: 4,
children: widgets,
onReorder: (int oldIndex, int newIndex) {
widgets.insert(newIndex, widgets.removeAt(oldIndex));
},
),
);
}
}
20 changes: 13 additions & 7 deletions examples/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:examples/common.dart';
import 'package:examples/examples/reorderable_list.dart';
import 'package:examples/pages/aligned.dart';
import 'package:examples/pages/masonry.dart';
import 'package:examples/pages/quilted.dart';
Expand Down Expand Up @@ -41,37 +42,42 @@ class HomePage extends StatelessWidget {
mainAxisSpacing: 16,
crossAxisSpacing: 16,
),
children: const [
MenuEntry(
children: [
const MenuEntry(
title: 'Staggered',
imageName: 'staggered',
destination: StaggeredPage(),
),
MenuEntry(
const MenuEntry(
title: 'Masonry',
imageName: 'masonry',
destination: MasonryPage(),
),
MenuEntry(
const MenuEntry(
title: 'Quilted',
imageName: 'quilted',
destination: QuiltedPage(),
),
MenuEntry(
const MenuEntry(
title: 'Woven',
imageName: 'woven',
destination: WovenPage(),
),
MenuEntry(
const MenuEntry(
title: 'Staired',
imageName: 'staired',
destination: StairedPage(),
),
MenuEntry(
const MenuEntry(
title: 'Aligned',
imageName: 'aligned',
destination: AlignedPage(),
),
MenuEntry(
title: 'Reorderable',
imageName: 'quilted',
destination: ReorderablePage(),
),
],
),
);
Expand Down
20 changes: 13 additions & 7 deletions examples/lib/main_examples.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:examples/common.dart';
import 'package:examples/examples/aligned.dart';
import 'package:examples/examples/masonry.dart';
import 'package:examples/examples/quilted.dart';
import 'package:examples/examples/reorderable_list.dart';
import 'package:examples/examples/staggered.dart';
import 'package:examples/examples/staired.dart';
import 'package:examples/examples/woven.dart';
Expand Down Expand Up @@ -41,37 +42,42 @@ class HomePage extends StatelessWidget {
mainAxisSpacing: 16,
crossAxisSpacing: 16,
),
children: const [
MenuEntry(
children: [
const MenuEntry(
title: 'Staggered',
imageName: 'staggered',
destination: StaggeredPage(),
),
MenuEntry(
const MenuEntry(
title: 'Masonry',
imageName: 'masonry',
destination: MasonryPage(),
),
MenuEntry(
const MenuEntry(
title: 'Quilted',
imageName: 'quilted',
destination: QuiltedPage(),
),
MenuEntry(
const MenuEntry(
title: 'Woven',
imageName: 'woven',
destination: WovenPage(),
),
MenuEntry(
const MenuEntry(
title: 'Staired',
imageName: 'staired',
destination: StairedPage(),
),
MenuEntry(
const MenuEntry(
title: 'Aligned',
imageName: 'aligned',
destination: AlignedPage(),
),
MenuEntry(
title: 'Reorderable',
imageName: 'reorderable',
destination: ReorderablePage(),
),
],
),
);
Expand Down
3 changes: 1 addition & 2 deletions examples/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: examples
description: A new Flutter project.
description: Example for collection of Flutter grids layouts (staggered, masonry, quilted, woven, etc.).
publish_to: 'none'
version: 1.0.0+1

Expand All @@ -9,7 +9,6 @@ environment:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_lints: any
flutter_staggered_grid_view:
path: ../
Expand Down
1 change: 1 addition & 0 deletions lib/flutter_staggered_grid_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library flutter_staggered_grid_view;

export 'src/layouts/quilted.dart';
export 'src/layouts/reorderable_staggered_layout.dart';
export 'src/layouts/staired.dart';
export 'src/layouts/woven.dart';
export 'src/rendering/sliver_masonry_grid.dart';
Expand Down
Loading