Skip to content

Commit

Permalink
4.18.0
Browse files Browse the repository at this point in the history
Took 1 hour 24 minutes
  • Loading branch information
Drawner committed Jun 15, 2024
1 parent f832d03 commit fc3e0f6
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

## 4.18.0
June 15, 2024
- getter usingCupertino assigned a local variable
- CupertinoActivityIndicator and CircularProgressIndicator used by default
- Increase test coverage

## 4.17.0
June 06, 2024
- Flag defaults to false: _useInherited = useInherited ?? false;
Expand Down
17 changes: 14 additions & 3 deletions example/test/test_statex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,22 @@ Future<void> testsStateX(WidgetTester tester) async {

/// Test the forEach() function encountering an error
each = stateObj.forEach((con) {
if (con is YetAnotherController) {
throw Exception('Error in forEach()!');
}
var state = con.startState;
state = con.endState;
final states = con.states;
});

/// reversed
each = stateObj.forEach((con) {
var state = con.startState;
state = con.endState;
var overridden = state?.buildOverridden;
overridden = state?.usingCupertino;
overridden = state?.buildFOverridden;
overridden = state?.buildInOverridden;
final states = con.states;
}, reversed: true);

/// Return a controller by its id in a List
final listCon = stateObj.listControllers([keyId]);

Expand Down
20 changes: 15 additions & 5 deletions lib/state_extended.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'dart:ui' show AppExitResponse;

import 'package:flutter/cupertino.dart'
show
CupertinoActivityIndicator,
CupertinoLocalizations,
CupertinoUserInterfaceLevel,
DefaultCupertinoLocalizations;
Expand Down Expand Up @@ -2143,8 +2144,16 @@ mixin FutureBuilderStateMixin on State {
}

// Still no widget
// CupertinoActivityIndicator used if TargetPlatform.iOS or TargetPlatform.macOS
widget ??= const Center(child: CircularProgressIndicator());
if (widget == null) {
if (usingCupertino) {
//
widget = const Center(child: CupertinoActivityIndicator());
} else {
//
widget = const Center(child: CircularProgressIndicator());
}
}
// widget ??= const Center(child: CircularProgressIndicator());

// There was an error instead.
} else {
Expand Down Expand Up @@ -2195,9 +2204,10 @@ mixin FutureBuilderStateMixin on State {

/// Is the CupertinoApp being used?
bool get usingCupertino =>
context.getElementForInheritedWidgetOfExactType<
CupertinoUserInterfaceLevel>() !=
null;
_usingCupertino ??= context.getElementForInheritedWidgetOfExactType<
CupertinoUserInterfaceLevel>() !=
null;
bool? _usingCupertino;

/// Supply Localizations before displaying the widget
Widget _localizeWidget(BuildContext context, Widget child) {
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "4.0.0"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -154,10 +154,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
matcher:
dependency: transitive
description:
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: state_extended
description: This class extends the capabilities of Flutter's State class and includes a controller.
version: 4.17.0
version: 4.18.0
homepage: https://www.andrioussolutions.com
repository: https://github.com/AndriousSolutions/state_extended

environment:
sdk: ">=2.17.0 <4.0.0"
# sdk: ">=2.17.0 <4.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand All @@ -32,7 +33,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^3.0.0
flutter_lints: ^4.0.0

# Needed here as well for testing
flutter_test:
Expand Down

0 comments on commit fc3e0f6

Please sign in to comment.