Skip to content
Merged
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
29 changes: 15 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
name: '⚙️ CI'
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
unit-tests:
strategy:
matrix:
channel:
- beta
- stable
name: 'Testing [${{matrix.channel}}] 🧪'
runs-on: ubuntu-latest
name: 'Testing 🧪'
runs-on: ubuntu-slim
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
channel: stable
cache: true
- run: flutter config --no-analytics --suppress-analytics
- name: Package tests
Expand All @@ -28,9 +25,9 @@ jobs:
working-directory: example
dart-lints:
name: 'Linting 📝'
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
Expand All @@ -42,11 +39,15 @@ jobs:
run: flutter analyze
working-directory: example
dart-format:
if: false # FIXME: format behaves differently in CI
name: "Formating ✅"
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: "Package format"
run: dart format --output show --set-exit-if-changed .
- name: "Example format"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.2

* Follow latest flutter lints

## 1.0.1

* fix focus traversal
Expand Down
11 changes: 9 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
# Prevent code errors:
Expand All @@ -13,7 +15,6 @@ linter:
- type_annotate_public_apis
- eol_at_end_of_file
- package_api_docs
- public_member_api_docs

# Style
- avoid_escaping_inner_quotes
Expand All @@ -40,4 +41,10 @@ linter:
- use_colored_box
- use_decorated_box
- use_if_null_to_convert_nulls_to_bools
- use_to_and_as_if_applicable
- use_to_and_as_if_applicable

analyzer:
language:
strict-inference: true
strict-raw-types: true
strict-casts: true
10 changes: 9 additions & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
# Prevent code errors:
Expand Down Expand Up @@ -39,4 +41,10 @@ linter:
- use_colored_box
- use_decorated_box
- use_if_null_to_convert_nulls_to_bools
- use_to_and_as_if_applicable
- use_to_and_as_if_applicable

analyzer:
language:
strict-inference: true
strict-raw-types: true
strict-casts: false
6 changes: 3 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ void main() {
runApp(MaterialApp(
title: 'InlineTabView examples',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
appBarTheme: AppBarTheme(color: Colors.teal)),
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: Scaffold(
appBar: AppBar(title: Text('InlineTabView examples')),
body: const InlineTabViewExample(),
Expand Down
82 changes: 49 additions & 33 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,47 @@ packages:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.1"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.1"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "1.3.3"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -65,68 +73,76 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.1"
version: "1.0.2"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
name: lints
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.18.0"
path:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -139,18 +155,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.4"
string_scanner:
dependency: transitive
description:
Expand All @@ -171,18 +187,18 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.11"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
Expand All @@ -192,5 +208,5 @@ packages:
source: hosted
version: "14.2.5"
sdks:
dart: ">=3.5.3 <4.0.0"
dart: ">=3.10.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: example
description: "A new Flutter project."
publish_to: 'none' # Remove this line if you wish to publish to pub.d
version: 1.0.0+1
version: 1.0.1+2

environment:
sdk: ^3.5.3
Expand All @@ -13,6 +13,7 @@ dependencies:
path: ../

dev_dependencies:
flutter_lints: ^6.0.0
flutter_test:
sdk: flutter

Expand Down
18 changes: 13 additions & 5 deletions lib/src/inline_tab_view_render_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ class InlineTabViewRenderObject extends RenderBox

// avoid oob scroll
if (controller.index == 0 && offset < 0 ||
controller.index == (controller.length - 1) && offset > 0) offset = 0;
controller.index == (controller.length - 1) && offset > 0) {
offset = 0;
}

if (!controller.indexIsChanging) controller.offset = offset;
markNeedsPaint();
Expand All @@ -127,8 +129,9 @@ class InlineTabViewRenderObject extends RenderBox
nextTab?.layout(constraints, parentUsesSize: true);
previousTab?.layout(constraints, parentUsesSize: true);
visitChildren((RenderObject child) {
if (child == selectedTab || child == nextTab || child == previousTab)
if (child == selectedTab || child == nextTab || child == previousTab) {
return;
}
child.layout(constraints);
});

Expand Down Expand Up @@ -238,14 +241,19 @@ class InlineTabViewRenderObject extends RenderBox
final primaryRightBorder =
_relativeCentralDrawPosition + (primaryChild.size.width / 2);

if (primaryRightBorder > 0.0 && primaryLeftBorder < size.width)
if (primaryRightBorder > 0.0 && primaryLeftBorder < size.width) {
visitor(primaryChild);
}
if (nextChild != null &&
primaryRightBorder + size.width > 0.0 &&
primaryLeftBorder + size.width < size.width) visitor(nextChild);
primaryLeftBorder + size.width < size.width) {
visitor(nextChild);
}
if (previousChild != null &&
primaryRightBorder - size.width > 0.0 &&
primaryLeftBorder - size.width < size.width) visitor(previousChild);
primaryLeftBorder - size.width < size.width) {
visitor(previousChild);
}
}

@override
Expand Down
Loading