Browse Source

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

pull/421/head
Nikolas Rimikis 1 year 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; final TextStyle? style;
@override @override
Widget build(final BuildContext context) => Container( Widget build(final BuildContext context) => Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 16, 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( DataTable(
headingRowHeight: 0, headingRowHeight: 0,
columns: [ columns: const [
DataColumn(label: Container()), DataColumn(label: SizedBox()),
DataColumn(label: Container()), DataColumn(label: SizedBox()),
], ],
rows: [ rows: [
for (final entry in { 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 || builder: (final context, final downloadTasksSnapshot) => !pathSnapshot.hasData ||
!uploadTasksSnapshot.hasData || !uploadTasksSnapshot.hasData ||
!downloadTasksSnapshot.hasData !downloadTasksSnapshot.hasData
? Container() ? const SizedBox()
: BackButtonListener( : BackButtonListener(
onBackButtonPressed: () async { onBackButtonPressed: () async {
final path = pathSnapshot.requireData; final path = pathSnapshot.requireData;
@ -72,7 +72,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
stream: uploadTask.progress, stream: uploadTask.progress,
builder: (final context, final uploadTaskProgressSnapshot) => builder: (final context, final uploadTaskProgressSnapshot) =>
!uploadTaskProgressSnapshot.hasData !uploadTaskProgressSnapshot.hasData
? Container() ? const SizedBox()
: _buildFile( : _buildFile(
context: context, context: context,
details: FileDetails( 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) ? Theme.of(context).textTheme.titleMedium!.copyWith(color: Theme.of(context).disabledColor)
: null, : null,
), ),
subtitle: subtitle: feed.unreadCount! > 0 ? Text(AppLocalizations.of(context).articlesUnread(feed.unreadCount!)) : null,
feed.unreadCount! > 0 ? Text(AppLocalizations.of(context).articlesUnread(feed.unreadCount!)) : Container(),
leading: NewsFeedIcon( leading: NewsFeedIcon(
feed: feed, feed: feed,
borderRadius: const BorderRadius.all(Radius.circular(8)), 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( ? Text(
AppLocalizations.of(context).articlesUnread(unreadCount), AppLocalizations.of(context).articlesUnread(unreadCount),
) )
: Container(), : null,
leading: SizedBox.square( leading: SizedBox.square(
dimension: 48, dimension: 48,
child: Stack( 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>( builder: (final context, final value) => StreamBuilder<bool>(
stream: option.enabled, stream: option.enabled,
builder: (final context, final enabledSnapshot) => !enabledSnapshot.hasData builder: (final context, final enabledSnapshot) => !enabledSnapshot.hasData
? Container() ? const SizedBox()
: CheckboxListTile( : CheckboxListTile(
title: Text(option.label(context)), title: Text(option.label(context)),
value: value, 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), : Theme.of(context).textTheme.titleMedium!.copyWith(color: Theme.of(context).disabledColor),
), ),
trailing: valuesSnapshot.hasData trailing: valuesSnapshot.hasData
? Container( ? ConstrainedBox(
constraints: BoxConstraints( constraints: BoxConstraints(
maxWidth: constraints.maxWidth * 0.5, maxWidth: constraints.maxWidth * 0.5,
), ),

Loading…
Cancel
Save