Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Safety Migrated #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
13 changes: 13 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/home/jinosh/Documents/flutter_2.0.4/flutter"
export "FLUTTER_APPLICATION_PATH=/home/jinosh/Programming/My_Packages/configurable_expansion_tile/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
41 changes: 20 additions & 21 deletions lib/configurable_expansion_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class ConfigurableExpansionTile extends StatefulWidget {
/// be specified for the animated transitions/states. [children] are revealed
/// when the expansion tile is expanded.
const ConfigurableExpansionTile(
{Key key,
{Key? key,
this.headerBackgroundColorStart = Colors.transparent,
this.onExpansionChanged,
this.children = const <Widget>[],
this.initiallyExpanded = false,
@required this.header,
required this.header,
this.animatedWidgetFollowingHeader,
this.animatedWidgetPrecedingHeader,
this.expandedBackgroundColor,
Expand All @@ -35,15 +35,14 @@ class ConfigurableExpansionTile extends StatefulWidget {
this.borderAnimationTween,
this.animatedWidgetTurnTween,
this.animatedWidgetTween})
: assert(initiallyExpanded != null),
super(key: key);
: super(key: key);

/// Called when the tile expands or collapses.
///
/// When the tile starts expanding, this function is called with the value
/// true. When the tile starts collapsing, this function is called with
/// the value false.
final ValueChanged<bool> onExpansionChanged;
final ValueChanged<bool>? onExpansionChanged;

/// The widgets that are displayed when the tile expands.
///
Expand All @@ -56,10 +55,10 @@ class ConfigurableExpansionTile extends StatefulWidget {
final Color headerBackgroundColorStart;

/// The [Color] the header will transition to on expand
final Color headerBackgroundColorEnd;
final Color? headerBackgroundColorEnd;

/// The [Color] of the background of the [children] when expanded
final Color expandedBackgroundColor;
final Color? expandedBackgroundColor;

/// Specifies if the list tile is initially expanded (true) or collapsed (false, the default).
final bool initiallyExpanded;
Expand All @@ -68,13 +67,13 @@ class ConfigurableExpansionTile extends StatefulWidget {
final Widget header;

/// An optional widget to replace [header] with if the list is expanded
final Widget headerExpanded;
final Widget? headerExpanded;

/// A widget to rotate following the [header] (ie an arrow)
final Widget animatedWidgetFollowingHeader;
final Widget? animatedWidgetFollowingHeader;

/// A widget to rotate preceding the [header] (ie an arrow)
final Widget animatedWidgetPrecedingHeader;
final Widget? animatedWidgetPrecedingHeader;

/// The duration of the animations
final Duration kExpand;
Expand All @@ -92,16 +91,16 @@ class ConfigurableExpansionTile extends StatefulWidget {
final bool bottomBorderOn;

/// Header transition tween
final Animatable<double> headerAnimationTween;
final Animatable<double>? headerAnimationTween;

/// Border animation tween
final Animatable<double> borderAnimationTween;
final Animatable<double>? borderAnimationTween;

/// Tween for turning [animatedWidgetFollowingHeader] and [animatedWidgetPrecedingHeader]
final Animatable<double> animatedWidgetTurnTween;
final Animatable<double>? animatedWidgetTurnTween;

/// [animatedWidgetFollowingHeader] and [animatedWidgetPrecedingHeader] transition tween
final Animatable<double> animatedWidgetTween;
final Animatable<double>? animatedWidgetTween;

static final Animatable<double> _easeInTween =
CurveTween(curve: Curves.easeIn);
Expand All @@ -117,12 +116,12 @@ class ConfigurableExpansionTile extends StatefulWidget {

class _ConfigurableExpansionTileState extends State<ConfigurableExpansionTile>
with SingleTickerProviderStateMixin {
AnimationController _controller;
Animation<double> _iconTurns;
Animation<double> _heightFactor;
late AnimationController _controller;
late Animation<double> _iconTurns;
late Animation<double> _heightFactor;

Animation<Color> _borderColor;
Animation<Color> _headerColor;
late Animation<Color?> _borderColor;
Animation<Color?>? _headerColor;

final ColorTween _borderColorTween = ColorTween();
final ColorTween _headerColorTween = ColorTween();
Expand Down Expand Up @@ -175,10 +174,10 @@ class _ConfigurableExpansionTileState extends State<ConfigurableExpansionTile>
PageStorage.of(context)?.writeState(context, _isExpanded);
});
if (widget.onExpansionChanged != null)
widget.onExpansionChanged(_isExpanded);
widget.onExpansionChanged!(_isExpanded);
}

Widget _buildChildren(BuildContext context, Widget child) {
Widget _buildChildren(BuildContext context, Widget? child) {
final Color borderSideColor = _borderColor.value ?? widget.borderColorStart;
final Color headerColor =
_headerColor?.value ?? widget.headerBackgroundColorStart;
Expand Down
62 changes: 38 additions & 24 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -45,28 +66,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.3+1"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -78,55 +92,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.1"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.8"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.0.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author: Tyler Matthews <matthews.tyl@gmail.com>
homepage: https://github.com/matthewstyler/configurable_expansion_tile

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
5 changes: 0 additions & 5 deletions test/configurable_expansion_tile_test.dart

This file was deleted.