Skip to content

Commit

Permalink
Update example and web demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Aug 27, 2024
1 parent 9b9e43c commit 73d7c84
Show file tree
Hide file tree
Showing 8 changed files with 2,637 additions and 1,374 deletions.
5 changes: 3 additions & 2 deletions example/lib/about/views/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void showAppAboutDialog(BuildContext context) {
TextSpan(
style: aboutTextStyle,
text: 'The ${AppData.title(context)} application demonstrates '
'features of the ${AppData.packageName} custom key colors '
'features\n'
'of the ${AppData.packageName} custom key colors '
'ColorScheme generation package.\n\n'
'To learn more, check out the package on ',
),
Expand All @@ -65,7 +66,7 @@ void showAppAboutDialog(BuildContext context) {
),
TextSpan(
style: aboutTextStyle,
text: '. It also includes the source '
text: '.\nIt also includes the source '
'code of this application.\n\n',
),
TextSpan(
Expand Down
6 changes: 3 additions & 3 deletions example/lib/core/constants/app_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ sealed class AppData {
// Version of the WEB build, usually same as package, but it also has a
// build numbers.
static const String versionMajor = '3';
static const String versionMinor = '1';
static const String versionPatch = '2';
static const String versionMinor = '2';
static const String versionPatch = '0';
static const String versionBuild = '01';
static const String version = '$versionMajor.$versionMinor.$versionPatch '
'Build-$versionBuild';
static const String packageVersion =
'$versionMajor.$versionMinor.$versionPatch';
static const String flutterVersion = '3.22.3 (canvaskit)';
static const String flutterVersion = '3.24.1 (canvaskit)';
static const String copyright = '© 2022-2024';
static const String author = 'Mike Rydstrom';
static const String license = 'BSD 3-Clause License';
Expand Down
32 changes: 18 additions & 14 deletions example/lib/core/views/universal/list_tile_reveal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

/// A custom [ListTile] that has a built-in animated custom leading action
/// after the [leading] widget built in as a part of [title] that
/// reveals the [subtitle] when clicked.
/// reveals the [subtitleReveal] when clicked.
///
/// This is useful when a more compact look is desired where more information
/// is provided as an optional user based reveal action. The purpose is to make
Expand All @@ -16,11 +16,12 @@ class ListTileReveal extends StatefulWidget {
this.title,
this.leading,
this.subtitle,
this.subtitleReveal,
this.trailing,
this.contentPadding,
this.onTap,
this.dense,
this.subtitleDense,
this.revealDense,
this.enabled = true,
this.isOpen,
this.duration = const Duration(milliseconds: 200),
Expand All @@ -44,6 +45,11 @@ class ListTileReveal extends StatefulWidget {
/// Typically a [Text] widget.
final Widget? subtitle;

/// Additional content displayed below the subtitle in a reveal animation.
///
/// Typically a [Text] widget.
final Widget? subtitleReveal;

/// A widget to display after the title.
///
/// Typically an [Icon] widget.
Expand All @@ -57,7 +63,8 @@ class ListTileReveal extends StatefulWidget {

/// The [ListTileReveal]'s internal padding.
///
/// Insets a [ListTileReveal]'s contents: its [leading], [title], [subtitle],
/// Insets a [ListTileReveal]'s contents: its [leading], [title],
/// [subtitleReveal],
/// and [trailing] widgets.
///
/// If null, `EdgeInsets.symmetric(horizontal: 16.0)` is used.
Expand All @@ -78,13 +85,10 @@ class ListTileReveal extends StatefulWidget {
/// Dense list tiles default to a smaller height.
final bool? dense;

/// Whether this list tile subtitle is dense.
///
/// Dense list tiles default to a smaller height. The subtitle is also dense
/// if dense is true.
/// Whether the used reveal part of the ListTile is dense.
///
/// If not defined defaults to false.
final bool? subtitleDense;
/// If not defined, defaults to true.
final bool? revealDense;

/// Set to true to open the info section of the ListTile, to false to close
/// it.
Expand Down Expand Up @@ -133,7 +137,7 @@ class _ListTileRevealState extends State<ListTileReveal> {
crossAxisAlignment: WrapCrossAlignment.center,
children: <Widget>[
if (widget.title != null) widget.title!,
if (widget.subtitle != null && widget.enabled)
if (widget.subtitleReveal != null && widget.enabled)
IconButton(
iconSize: 20,
// ignore: avoid_bool_literals_in_conditional_expressions
Expand All @@ -144,6 +148,7 @@ class _ListTileRevealState extends State<ListTileReveal> {
),
],
),
subtitle: widget.subtitle,
trailing: widget.trailing,
onTap: widget.enabled ? widget.onTap : null,
),
Expand All @@ -156,11 +161,10 @@ class _ListTileRevealState extends State<ListTileReveal> {
child: child,
);
},
child: (_isOpen && widget.subtitle != null && widget.enabled)
child: (_isOpen && widget.subtitleReveal != null && widget.enabled)
? ListTile(
dense: (widget.dense ?? false) ||
(widget.subtitleDense ?? false),
subtitle: widget.subtitle,
dense: widget.revealDense ?? true,
subtitle: widget.subtitleReveal,
onTap: widget.enabled ? _handleTap : null,
)
: const SizedBox.shrink(),
Expand Down
Loading

0 comments on commit 73d7c84

Please sign in to comment.