Upgrade Skill Di ITBOX Jadi Lebih Hemat
Special Diskon 50%
Sampai 16 November 2026!
Hari
Jam
Menit
Detik
GARUDABOX

Error Pada saat seting Login

Beranda › Forums › Belajar Flutter Mobile Apps Tingkat Menengah › Error Pada saat seting Login

Tagged: 

  • This topic has 3 replies, 2 voices, and was last updated 3 years ago by Anonymous.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #222715
    akmalullah.id
    Participant

      Helo coach David,
      pada materi fluter auth, ini setelah setting handler lalu setting login.dart. dan pada saat menambahkan toggleVIew di key error. berikut kodedan errornya :
      code :
      import ‘package:flutter/material.dart’;

      class Login extends StatefulWidget {
      final Function? toggleView();
      const Login({super.key,this.toggleView});

      @override
      State<Login> createState() => _LoginState();
      }

      class _LoginState extends State<Login> {
      @override
      Widget build(BuildContext context) {
      return const Placeholder();
      }
      }

      Keterangan Errornya :
      Can’t have modifier ‘final’ here.
      ‘toggleView’ must have a method body because ‘Login’ isn’t abstract.
      ‘super’ can’t be used as an identifier because it’s a keyword.
      Expected to find ‘}’.

      #222746
      Anonymous

        coba const nya dihapus bagian depan login ya

        #222747
        akmalullah.id
        Participant

          Masih error coach .
          Sudah dicoba ganti seperti ini :

          class Login extends StatefulWidget {
          final Function? toggleView();
          Login({super.key,this.toggleView});

          @override
          State<Login> createState() => _LoginState();
          }

          Pesan Errornya masih sama seperti sebelumnya..

          #223744
          Anonymous

            tambahkan required dideaon this.toggleView ya

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.
          Shopping cart0
          There are no products in the cart!
          Continue shopping