title: Switch - case in flutter
body: <p>I dont know why i cant send data of &quot;altMenuIndex&quot; to &quot;degisenMenu()&quot;.
  When i change inside of switch manually, it works. But when i change like &quot;int altMenuIndex = 2&quot;, it doesnt work.</p>
  <p>The codes below show the &quot;default&quot; value.</p>
  <pre><code>class AltMenuDegistir {
    int altMenuIndex = 1;
    AltMenuDegistir({this.altMenuIndex});
  
    degisenMenu() {
      switch (altMenuIndex) {
        case 1:
          return Kutuphane();
          break;
        case 2:
          return KitapAra();
          break;
        case 3:
          return TalebeEkle();
          break;
        case 4:
          return TalebeAra();
          break;
        default:
          return Container(
            child: Center(
              child: Text(&quot;Bir şeyler ters gitti!&quot;),
            ),
          );
      }
    }
  }
  </code></pre>