Browse Source

neon, neon_files, neon_news, settings: use specific WIdgets instead of containers

pull/421/head
Nikolas Rimikis 2 years ago
parent
commit
120cba33d5
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 2
      packages/neon/neon/lib/src/widgets/text_settings_tile.dart
  2. 2
      packages/neon/neon_files/lib/dialogs/choose_folder.dart
  3. 6
      packages/neon/neon_files/lib/pages/details.dart
  4. 4
      packages/neon/neon_files/lib/widgets/browser_view.dart
  5. 3
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  6. 2
      packages/neon/neon_news/lib/widgets/folders_view.dart
  7. 2
      packages/settings/lib/src/widgets/checkbox_settings_tile.dart
  8. 2
      packages/settings/lib/src/widgets/dropdown_button_settings_tile.dart

2
packages/neon/neon/lib/src/widgets/text_settings_tile.dart

@ -14,7 +14,7 @@ class NeonTextSettingsTile extends SettingsTile {
final TextStyle? style;
@override
Widget build(final BuildContext context) => Container(
Widget build(final BuildContext context) => Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
),

2
packages/neon/neon_files/lib/dialogs/choose_folder.dart

@ -58,7 +58,7 @@ class FilesChooseFolderDialog extends StatelessWidget {
],
),
)
: Container(),
: const SizedBox(),
),
],
),

6
packages/neon/neon_files/lib/pages/details.dart

@ -35,9 +35,9 @@ class FilesDetailsPage extends StatelessWidget {
),
DataTable(
headingRowHeight: 0,
columns: [
DataColumn(label: Container()),
DataColumn(label: Container()),
columns: const [
DataColumn(label: SizedBox()),
DataColumn(label: SizedBox()),
],
rows: [
for (final entry in {

4
packages/neon/neon_files/lib/widgets/browser_view.dart

@ -43,7 +43,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
builder: (final context, final downloadTasksSnapshot) => !pathSnapshot.hasData ||
!uploadTasksSnapshot.hasData ||
!downloadTasksSnapshot.hasData
? Container()
? const SizedBox()
: BackButtonListener(
onBackButtonPressed: () async {
final path = pathSnapshot.requireData;
@ -72,7 +72,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
stream: uploadTask.progress,
builder: (final context, final uploadTaskProgressSnapshot) =>
!uploadTaskProgressSnapshot.hasData
? Container()
? const SizedBox()
: _buildFile(
context: context,
details: FileDetails(

3
packages/neon/neon_news/lib/widgets/feeds_view.dart

@ -51,8 +51,7 @@ class NewsFeedsView extends StatelessWidget {
? Theme.of(context).textTheme.titleMedium!.copyWith(color: Theme.of(context).disabledColor)
: null,
),
subtitle:
feed.unreadCount! > 0 ? Text(AppLocalizations.of(context).articlesUnread(feed.unreadCount!)) : Container(),
subtitle: feed.unreadCount! > 0 ? Text(AppLocalizations.of(context).articlesUnread(feed.unreadCount!)) : null,
leading: NewsFeedIcon(
feed: feed,
borderRadius: const BorderRadius.all(Radius.circular(8)),

2
packages/neon/neon_news/lib/widgets/folders_view.dart

@ -55,7 +55,7 @@ class NewsFoldersView extends StatelessWidget {
? Text(
AppLocalizations.of(context).articlesUnread(unreadCount),
)
: Container(),
: null,
leading: SizedBox.square(
dimension: 48,
child: Stack(

2
packages/settings/lib/src/widgets/checkbox_settings_tile.dart

@ -12,7 +12,7 @@ class CheckBoxSettingsTile extends InputSettingsTile<ToggleOption> {
builder: (final context, final value) => StreamBuilder<bool>(
stream: option.enabled,
builder: (final context, final enabledSnapshot) => !enabledSnapshot.hasData
? Container()
? const SizedBox()
: CheckboxListTile(
title: Text(option.label(context)),
value: value,

2
packages/settings/lib/src/widgets/dropdown_button_settings_tile.dart

@ -34,7 +34,7 @@ class DropdownButtonSettingsTile<T> extends InputSettingsTile<SelectOption<T>> {
: Theme.of(context).textTheme.titleMedium!.copyWith(color: Theme.of(context).disabledColor),
),
trailing: valuesSnapshot.hasData
? Container(
? ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth * 0.5,
),

Loading…
Cancel
Save