Skip to content

Commit

Permalink
Merge pull request #32 from fujidaiti/dev
Browse files Browse the repository at this point in the history
Release 1.0.0-rc.1
  • Loading branch information
fujidaiti authored May 16, 2023
2 parents df6abd9 + f1d3371 commit f09f00c
Show file tree
Hide file tree
Showing 23 changed files with 834 additions and 623 deletions.
1 change: 1 addition & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
10 changes: 5 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:example/src/adaptive_padding_example.dart';
import 'package:example/src/complex_example/complex_example.dart';
import 'package:example/src/custom_snap_offsets_example.dart';
import 'package:example/src/custom_snap_insets_example.dart';
import 'package:example/src/gutter_example.dart';
import 'package:example/src/modal_dialog_example.dart';
import 'package:example/src/overshoot_effect_example.dart';
Expand Down Expand Up @@ -34,8 +34,8 @@ class Home extends StatelessWidget {

@override
Widget build(BuildContext context) {
void pushRoute(Widget widget) => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => widget));
void pushRoute(Widget widget) =>
Navigator.of(context).push(MaterialPageRoute(builder: (_) => widget));

return ListView(
children: [
Expand All @@ -48,8 +48,8 @@ class Home extends StatelessWidget {
onTap: () => pushRoute(const OvershootEffectExample()),
),
ListTile(
title: const Text("Custom Snap Offsets Example"),
onTap: () => pushRoute(const CustomSnapOffsetsExample()),
title: const Text("Custom Snap Insets Example"),
onTap: () => pushRoute(const CustomSnapInsetsExample()),
),
ListTile(
title: const Text("Gutter Example"),
Expand Down
9 changes: 6 additions & 3 deletions example/lib/src/adaptive_padding_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class AdaptivePaddingExample extends StatefulWidget {
const AdaptivePaddingExample({super.key});

@override
State<AdaptivePaddingExample> createState() =>
_AdaptivePaddingExampleState();
State<AdaptivePaddingExample> createState() => _AdaptivePaddingExampleState();
}

class _AdaptivePaddingExampleState extends State<AdaptivePaddingExample> {
Expand All @@ -16,7 +15,11 @@ class _AdaptivePaddingExampleState extends State<AdaptivePaddingExample> {
@override
void initState() {
super.initState();
controller = ExprollablePageController(overshootEffect: true);
controller = ExprollablePageController(
viewportConfiguration: ViewportConfiguration(
overshootEffect: true,
),
);
}

@override
Expand Down
4 changes: 3 additions & 1 deletion example/lib/src/complex_example/album_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class _AlbumDetailsDialogState extends ConsumerState<AlbumDetailsDialog> {
super.initState();
controller = ExprollablePageController(
initialPage: widget.index,
overshootEffect: true,
viewportConfiguration: ViewportConfiguration(
overshootEffect: true,
),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@ import 'package:example/src/common.dart';
import 'package:exprollable_page_view/exprollable_page_view.dart';
import 'package:flutter/material.dart';

class CustomSnapOffsetsExample extends StatefulWidget {
const CustomSnapOffsetsExample({super.key});
class CustomSnapInsetsExample extends StatefulWidget {
const CustomSnapInsetsExample({super.key});

@override
State<CustomSnapOffsetsExample> createState() =>
_CustomSnapOffsetsExampleState();
State<CustomSnapInsetsExample> createState() =>
_CustomSnapInsetsExampleState();
}

class _CustomSnapOffsetsExampleState extends State<CustomSnapOffsetsExample> {
class _CustomSnapInsetsExampleState extends State<CustomSnapInsetsExample> {
late final ExprollablePageController controller;

@override
void initState() {
super.initState();
controller = ExprollablePageController.withAdditionalSnapOffsets(
const [ViewportOffset.fractional(0.5)],
controller = ExprollablePageController(
viewportConfiguration: ViewportConfiguration(
extraSnapInsets: [
ViewportInset.fractional(0.5),
],
),
);
}

Expand Down
4 changes: 3 additions & 1 deletion example/lib/src/overshoot_effect_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class _OvershootEffectExampleState extends State<OvershootEffectExample> {
// Make sure that your Scaffold has a bottom navigation bar,
// and Scaffold.extendBody is set true. You should avoid using
// SafeArea for the top of the screen for better visual effect.
overshootEffect: true,
viewportConfiguration: ViewportConfiguration(
overshootEffect: true,
),
);
}

Expand Down
12 changes: 4 additions & 8 deletions maps_example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ class _MapsExampleState extends State<MapsExample> {
@override
void initState() {
super.initState();
const peekOffset = ViewportOffset.fractional(0.7);
const peekInset = ViewportInset.fractional(0.7);
_pageController = ExprollablePageController(
maxViewportOffset: peekOffset,
initialViewportOffset: peekOffset,
snapViewportOffsets: [
ViewportOffset.expanded,
// ViewportOffset.shrunk,
peekOffset,
],
viewportConfiguration: ViewportConfiguration(
extraSnapInsets: [peekInset],
),
);
}

Expand Down
1 change: 1 addition & 0 deletions maps_example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies:
path: ../package
http: ^0.13.5
json_serializable: ^6.6.1
json_annotation: ^4.8.1

dev_dependencies:
flutter_test:
Expand Down
8 changes: 8 additions & 0 deletions package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.0-rc.1 17-05-2023

This version contains some breaking changes (see the migraiton guide in README).

- The behavior of the viewport is now more customizable (#24)
- Terminology was reorganized and some classes and properties were renamed accordingly
- Some improvements in the documents

## 1.0.0-beta.8 05-05-2023

- Fix #25, #26
Expand Down
Loading

0 comments on commit f09f00c

Please sign in to comment.