Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilian Schulte committed Jan 11, 2024
1 parent 2024582 commit 9e33bf6
Show file tree
Hide file tree
Showing 41 changed files with 69 additions and 75 deletions.
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/elements/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Button extends StatefulComponent {
this.hideIcon = false,
this.dialog = false,
this.iconAffinity = IconAffinity.left,
Key? key,
}) : super(key: key);
super.key,
});

final String? id;
final String? label;
Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/elements/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void closeDialog(BuildContext context, {required String slotId, dynamic result})
}

class Dialog extends StatelessComponent {
const Dialog({required this.title, required this.content, required this.actions, Key? key}) : super(key: key);
const Dialog({required this.title, required this.content, required this.actions, super.key});

final String title;
final Component content;
Expand All @@ -68,7 +68,7 @@ class Dialog extends StatelessComponent {
}

class DialogSlot extends StatefulComponent {
const DialogSlot({required this.slotId, Key? key}) : super(key: key);
const DialogSlot({required this.slotId, super.key});

final String slotId;

Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/elements/hidden.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class Hidden extends StatelessComponent {
required this.hidden,
required this.child,
this.visibilityMode = false,
Key? key,
}) : super(key: key);
super.key,
});

final bool hidden;
final Component child;
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/elements/markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InlineBrackets extends InlineSyntax {
}

class Markdown extends StatefulComponent {
const Markdown({required this.markdown, this.blockSyntaxes, Key? key}) : super(key: key);
const Markdown({required this.markdown, this.blockSyntaxes, super.key});

final String markdown;

Expand Down
6 changes: 3 additions & 3 deletions apps/jaspr_pad/lib/components/elements/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../utils/node_reader.dart';
import 'button.dart';

class MenuItem extends StatelessComponent {
const MenuItem({required this.label, Key? key}) : super(key: key);
const MenuItem({required this.label, super.key});

final String label;

Expand All @@ -30,7 +30,7 @@ class MenuItem extends StatelessComponent {
}

class Menu extends StatelessComponent {
const Menu({required this.items, required this.onItemSelected, Key? key}) : super(key: key);
const Menu({required this.items, required this.onItemSelected, super.key});

final List<MenuItem> items;
final void Function(int) onItemSelected;
Expand All @@ -43,7 +43,7 @@ class Menu extends StatelessComponent {
}

class MenuElement extends StatelessElement {
MenuElement(Menu component) : super(component);
MenuElement(Menu super.component);

@override
Menu get component => super.component as Menu;
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/elements/snackbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../utils/node_reader.dart';
final snackBarProvider = StateProvider<String?>((ref) => null);

class SnackBar extends StatefulComponent {
const SnackBar({Key? key}) : super(key: key);
const SnackBar({super.key});

@override
State createState() => SnackBarState();
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/elements/splitter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../adapters/html.dart' as html;
import '../utils/node_reader.dart';

class Splitter extends StatefulComponent {
const Splitter({required this.children, this.horizontal = true, this.initialSizes, Key? key}) : super(key: key);
const Splitter({required this.children, this.horizontal = true, this.initialSizes, super.key});

final List<Component> children;
final bool horizontal;
Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/elements/tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class TabBar extends StatefulComponent {
required this.onSelected,
required this.tabs,
this.leading,
Key? key,
}) : super(key: key);
super.key,
});

final String id;
final int selected;
Expand Down
3 changes: 1 addition & 2 deletions apps/jaspr_pad/lib/components/elements/textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import '../../adapters/mdc.dart';
import '../utils/node_reader.dart';

class TextField extends StatefulComponent {
const TextField({required this.label, this.placeholder, this.onChange, this.expand = false, Key? key})
: super(key: key);
const TextField({required this.label, this.placeholder, this.onChange, this.expand = false, super.key});

final String label;
final String? placeholder;
Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/playground/editing/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Editor extends StatefulComponent {
required this.documents,
this.onDocumentChanged,
this.onSelectionChanged,
Key? key,
}) : super(key: key);
super.key,
});

final String? activeDoc;
final List<EditorDocument> documents;
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/playground/footer.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:jaspr/jaspr.dart';

class PlaygroundFooter extends StatelessComponent {
const PlaygroundFooter({Key? key}) : super(key: key);
const PlaygroundFooter({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/components/playground/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../elements/button.dart';
import '../elements/menu.dart';

class PlaygroundHeader extends StatelessComponent {
const PlaygroundHeader({Key? key}) : super(key: key);
const PlaygroundHeader({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down Expand Up @@ -100,7 +100,7 @@ class PlaygroundHeader extends StatelessComponent {
}

class SamplesMenuButton extends StatelessComponent with SyncProviderDependencies {
const SamplesMenuButton({Key? key}) : super(key: key);
const SamplesMenuButton({super.key});

@override
Iterable<SyncProvider> get preloadDependencies => [syncSamplesProvider];
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/playground/main_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'panels/output_panel.dart';
import 'panels/tutorial_panel.dart';

class MainSection extends StatelessComponent {
const MainSection({Key? key}) : super(key: key);
const MainSection({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'execution_service.dart';
import 'execution_service.imports.dart';

class ExecutionIFrame extends StatelessComponent {
const ExecutionIFrame({Key? key}) : super(key: key);
const ExecutionIFrame({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:jaspr_riverpod/jaspr_riverpod.dart';
import '../output/execution_service.dart';

class ConsolePanel extends StatelessComponent {
const ConsolePanel({Key? key}) : super(key: key);
const ConsolePanel({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../../providers/docu_provider.dart';
import '../../elements/markdown.dart';

class DocumentPanel extends StatelessComponent {
const DocumentPanel({Key? key}) : super(key: key);
const DocumentPanel({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand All @@ -19,7 +19,7 @@ class DocumentPanel extends StatelessComponent {
}

class _DocumentHintMarkdown extends StatefulComponent {
const _DocumentHintMarkdown(this.info, {Key? key}) : super(key: key);
const _DocumentHintMarkdown(this.info);

final HoverInfo info;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../../providers/edit_provider.dart';
import '../../../providers/issues_provider.dart';

class IssuesPanel extends StatelessComponent {
const IssuesPanel({Key? key}) : super(key: key);
const IssuesPanel({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand All @@ -19,7 +19,7 @@ class IssuesPanel extends StatelessComponent {
}

class IssueItem extends StatelessComponent {
const IssueItem(this.issue, {Key? key}) : super(key: key);
const IssueItem(this.issue, {super.key});

final Issue issue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '../../../providers/project_provider.dart';
import '../output/execution_iframe.dart';

class OutputPanel extends StatelessComponent {
const OutputPanel({Key? key}) : super(key: key);
const OutputPanel({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum OutputTabsState { closed, ui, issues, docs, console }
final tabsStateProvider = StateProvider((ref) => OutputTabsState.closed);

class OutputSplitView extends StatelessComponent {
const OutputSplitView({required this.child, Key? key}) : super(key: key);
const OutputSplitView({required this.child, super.key});

final Component child;

Expand Down Expand Up @@ -50,7 +50,7 @@ class OutputSplitView extends StatelessComponent {
}

class EditorTabs extends StatelessComponent {
const EditorTabs({Key? key}) : super(key: key);
const EditorTabs({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down Expand Up @@ -127,7 +127,7 @@ class EditorTabs extends StatelessComponent {
}

class EditorTab extends StatelessComponent {
const EditorTab({required this.id, required this.label, required this.value, Key? key}) : super(key: key);
const EditorTab({required this.id, required this.label, required this.value, super.key});

final String id;
final String label;
Expand Down Expand Up @@ -156,7 +156,7 @@ class EditorTab extends StatelessComponent {
}

class EditorTabWindow extends StatelessComponent {
const EditorTabWindow({Key? key}) : super(key: key);
const EditorTabWindow({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../../elements/hidden.dart';
import '../../elements/markdown.dart';

class TutorialPanel extends StatelessComponent {
const TutorialPanel({Key? key}) : super(key: key);
const TutorialPanel({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/lib/components/playground/playground.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'header.dart';
import 'main_section.dart';

class Playground extends StatelessComponent {
const Playground({Key? key}) : super(key: key);
const Playground({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
4 changes: 2 additions & 2 deletions apps/jaspr_pad/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
..addMiddleware((handler) {
var router = Router(notFoundHandler: handler);
router.mount('/api', apiRouter);
return router;
return router.call;
});
}

Expand All @@ -50,7 +50,7 @@ Handler get apiRouter {
router.get('/tutorial/<stepId>', getTutorial);
router.get('/download', downloadProject);

return router;
return router.call;
}

Handler mappedHandler<R, T>(FutureOr<R> Function(T request) handler) {
Expand Down
8 changes: 4 additions & 4 deletions apps/jaspr_pad/samples/bulma/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Button extends StatelessComponent {
this.isLoading = false,
this.isBlock = false,
this.isDisabled = false,
Key? key,
}) : super(key: key);
super.key,
});

final Component child;
final VoidCallback onPressed;
Expand Down Expand Up @@ -45,7 +45,7 @@ class Button extends StatelessComponent {
}

class IconLabel extends StatelessComponent {
const IconLabel({required this.icon, required this.label, Key? key}) : super(key: key);
const IconLabel({required this.icon, required this.label, super.key});

final String icon;
final String label;
Expand All @@ -63,7 +63,7 @@ class IconLabel extends StatelessComponent {

/// Bulma Button Group Component
class ButtonGroup extends StatelessComponent {
const ButtonGroup({required this.children, this.isAttached = false, Key? key}) : super(key: key);
const ButtonGroup({required this.children, this.isAttached = false, super.key});

final List<Button> children;
final bool isAttached;
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/samples/bulma/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class App extends StatelessComponent {
}

class BulmaLogo extends StatelessComponent {
const BulmaLogo({Key? key}) : super(key: key);
const BulmaLogo({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
16 changes: 6 additions & 10 deletions apps/jaspr_pad/samples/bulma/navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:jaspr/jaspr.dart';
/// Supports a limited subset of the available options
/// See https://bulma.io/documentation/components/navbar/ for a detailed description
class NavBar extends StatelessComponent {
const NavBar({this.brand, this.menu, Key? key}) : super(key: key);
const NavBar({this.brand, this.menu, super.key});

final NavbarBrand? brand;
final NavbarMenu? menu;
Expand All @@ -22,7 +22,7 @@ class NavBar extends StatelessComponent {
}

class NavbarBrand extends StatelessComponent {
const NavbarBrand({required this.children, Key? key}) : super(key: key);
const NavbarBrand({required this.children, super.key});

final List<Component> children;

Expand All @@ -33,7 +33,7 @@ class NavbarBrand extends StatelessComponent {
}

class NavbarMenu extends StatelessComponent {
const NavbarMenu({required this.items, this.endItems = const [], Key? key}) : super(key: key);
const NavbarMenu({required this.items, this.endItems = const [], super.key});

final List<Component> items;
final List<Component> endItems;
Expand All @@ -51,13 +51,9 @@ class NavbarMenu extends StatelessComponent {
}

class NavbarItem extends StatelessComponent {
const NavbarItem({required this.child, this.href, Key? key})
: items = null,
super(key: key);
const NavbarItem({required this.child, this.href, super.key}) : items = null;

const NavbarItem.dropdown({required this.child, required this.items, Key? key})
: href = null,
super(key: key);
const NavbarItem.dropdown({required this.child, required this.items, super.key}) : href = null;

final Component child;
final String? href;
Expand All @@ -80,7 +76,7 @@ class NavbarItem extends StatelessComponent {
}

class NavbarDivider extends StatelessComponent {
const NavbarDivider({Key? key}) : super(key: key);
const NavbarDivider({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
2 changes: 1 addition & 1 deletion apps/jaspr_pad/samples/bulma/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'colors.dart';
/// Supports a limited subset of the available options
/// See https://bulma.io/documentation/elements/progress/ for a detailed description
class ProgressBar extends StatelessComponent {
const ProgressBar({this.child, this.value, this.max = 100, this.color, Key? key}) : super(key: key);
const ProgressBar({this.child, this.value, this.max = 100, this.color, super.key});

final Component? child;
final double? value;
Expand Down
Loading

0 comments on commit 9e33bf6

Please sign in to comment.