• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

I have an error like this, when using the Youtube data API;

E/flutter ( 4770): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: 'No filter selected. Expected one of: id, mine, channelId'
E/flutter ( 4770): #0      APIService.fetchVideosFromPlaylist (package:niro_speaks/services/api_services.dart:81:7)
E/flutter ( 4770): 
E/flutter ( 4770): #1      APIService.fetchChannel (package:niro_speaks/services/api_services.dart:38:30)
E/flutter ( 4770): 

 

This is how i am geting the api and implemented in the api_services.dart

Future fetchChannel({String channelId}) async {

    Map parameters = {

      'part': 'snippet, contentDetails, statistics',

      'id': channelId,

      'key': API_KEY,

    };

    Uri uri = Uri.https(

      _baseUrl,

      '/youtube/v3/channels',

      parameters,

    );

    Map headers = {

      HttpHeaders.contentTypeHeader: 'application/json',

    };



    // Get Channel

    var response = await http.get(uri, headers: headers);

    if (response.statusCode == 200) {

      Map data = json.decode(response.body)['items'][0];

      Channel channel = Channel.fromMap(data);



      // Fetch first batch of videos from uploads playlist

      channel.videos = await fetchVideosFromPlaylist(

        playlistId: channel.uploadPlaylistId,

      );

      return channel;

    } else {

      throw json.decode(response.body)['error']['message'];

    }

  }

Anyone please help me to troubleshoot this error?

Download script demo [LINK] [Origin]
Download script demo [LINK 2] [Onedrive] Download script demo [LINK 2] [Google drive]