0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Flutter】継承するWidgetを変更しようとしてextends_non_classエラー

Posted at

操作

  • アプリ全体で状態変化を持たせたくなったのでStatelessWidgetからConsumerWidgetに変更しようとした。
title_list_view.dart
class TitleListView extends StatelessWidget {
  const TitleListView({super.key});

title_list_view.dart
class TitleListView extends ConsumerWidget {
  const TitleListView({super.key});

発生したエラー

Classes can only extend other classes.
Try specifying a different superclass, or removing the extends clause.(extends_non_class)

解決策

  • flutter_riverpodのimport忘れ
title_list_view.dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?