Open berkeresvan opened 7 months ago
import 'package:flutter/material.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: Anasayfa(), ); } }
class Anasayfa extends StatefulWidget { @override _AnasayfaState createState() => _AnasayfaState(); }
class _AnasayfaState extends State { bool kontrol = false;
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Kodlama Teknikleri"), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Visibility(visible: kontrol, child: Text("Merhaba")), ElevatedButton( onPressed: () { setState(() { kontrol = true; }); }, child: Text("durum 1")), ElevatedButton( onPressed: () { setState(() { kontrol = false; }); }, child: Text("durum 1")), ], ), ), ); } }
import 'package:flutter/material.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: Anasayfa(), ); } }
class Anasayfa extends StatefulWidget { @override _AnasayfaState createState() => _AnasayfaState(); }
class _AnasayfaState extends State {
bool kontrol = false;
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Kodlama Teknikleri"), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Visibility(visible: kontrol, child: Text("Merhaba")), ElevatedButton( onPressed: () { setState(() { kontrol = true; }); }, child: Text("durum 1")), ElevatedButton( onPressed: () { setState(() { kontrol = false; }); }, child: Text("durum 1")), ], ), ), ); } }