Thursday, March 26, 2026

sınav öncesi olabilirlik çalışması

 

import 'package:flutter/material.dart';
import 'package:flutter_application_6/customscrool.dart';
import "data.dart";

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scrollBehavior: MyCustomScrollBehavior(),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Color.fromARGB(255, 1, 128, 105),
          title: Text(
            "WhatsApp",
            style: TextStyle(color: Colors.white),
          ),
          actions: [
            Icon(
              Icons.camera_front,
              color: Colors.white,
            ),
            SizedBox(
              width: 10,
            ),
            Icon(
              Icons.portable_wifi_off_outlined,
              color: Colors.white,
            ),
            SizedBox(
              width: 10,
            ),
            Icon(
              Icons.menu,
              color: Colors.white,
            ),
            SizedBox(
              width: 10,
            ),
          ],
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    "Status",
                    style: TextStyle(
                      fontSize: 24,
                      fontWeight: FontWeight.w600,
                    ),
                  ),
                  Icon(Icons.menu),
                ],
              ),
              SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: Padding(
                  padding: const EdgeInsets.only(
                    right: 15,
                    top: 15,
                  ),
                  child: Row(
                    children: [
                      hikaye(),
                      hikaye(name: "Recep ÖZEN"),
                      hikaye(),
                      hikaye(),
                      hikaye(),
                      hikaye(),
                      hikaye(),
                      hikaye(),
                    ],
                  ),
                ),
              ),
              Divider(),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    "Channel",
                    style: TextStyle(
                      fontSize: 24,
                      fontWeight: FontWeight.w600,
                    ),
                  ),
                  Icon(Icons.add),
                ],
              ),
              Expanded(
                child: ListView.builder(
                  itemBuilder: (context, index) {
                    var a = datalist[index];
                    return haber(title: a["title"], content: a["content"]);
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  Container haber({
    String? title,
    String? content,
    String? haberimg,
    String? yazarimg,
  }) {
    return Container(
      margin: EdgeInsets.only(top: 25),
      child: Column(
        children: [
          Row(
            children: [
              CircleAvatar(),
              SizedBox(
                width: 15,
              ),
              Text(
                title ?? "Haber Başlığı",
                style: TextStyle(
                  fontSize: 24,
                  fontWeight: FontWeight.w600,
                ),
              ),
            ],
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              SizedBox(
                width: 270,
                child: Text(
                  content ??
                      "İsteğe bağlı tanımlama bilgilerini, sosyal medya bağlantıları gibi web sitelerimizde deneyiminizi iyileştirmek ve çevrimiçi etkinliğinize dayalı olarak kişiselleştirilmiş reklamlar görüntülemek için kullanırız. İsteğe bağlı tanımlama bilgilerini reddederseniz yalnızca",
                  style: TextStyle(fontSize: 18),
                  overflow: TextOverflow.ellipsis,
                  maxLines: 3,
                ),
              ),
              Container(
                width: 70,
                height: 70,
                color: Colors.amber,
              ),
            ],
          ),
          Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Padding(
                padding: const EdgeInsets.only(top: 4),
                child: Icon(
                  Icons.donut_large,
                  size: 8,
                ),
              ),
              Text(
                "unread",
                style: TextStyle(color: Colors.green),
              ),
            ],
          ),
          Divider(),
        ],
      ),
    );
  }

  Widget hikaye({String? img, String? name}) {
    return Column(
      children: [
        Container(
          margin: EdgeInsets.only(left: 15),
          padding: EdgeInsets.all(2),
          width: 70,
          height: 70,
          decoration: BoxDecoration(
            // color: Colors.black,
            shape: BoxShape.circle,
            border: Border.all(color: Colors.green, width: 3),
          ),
          child: ClipRRect(
            borderRadius: BorderRadiusGeometry.circular(100),
            child: Image.network(
              img ??
                  "https://lh3.googleusercontent.com/a/ACg8ocJ1ozVoF0R9OH26B8nPKFZ8H2U6ielA2DfsNJLLNbwow5xkFVw_=s288-c-no",
            ),
          ),
        ),
        SizedBox(
          height: 5,
        ),
        SizedBox(
          width: 70,
          child: Text(
            name ?? "Ad Soyad adasdas dasdasd",
            style: TextStyle(fontSize: 12),
            overflow: TextOverflow.ellipsis,
          ),
        ),
      ],
    );
  }
}


import 'dart:ui';

import 'package:flutter/material.dart';

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
  };
}

Thursday, March 12, 2026

instamsı

 import 'package:flutter/material.dart';

import 'package:flutter_application_3/customscrool.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scrollBehavior: MyCustomScrollBehavior(),
      home: const HomePage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Text("Instagram"),
        actions: [
          Icon(Icons.favorite_border),
          Icon(Icons.message_outlined),
          SizedBox(
            width: 10,
          ),
        ],
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              height: 115,
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(width: 1, color: Colors.grey),
                ),
              ),
              child: SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: Row(
                  children: [
                    Profil(),
                    Profil(),
                    Profil(),
                    Profil(),
                    Profil(),
                    Profil(),
                    Profil(),
                    Profil(),
                  ],
                ),
              ),
            ),
            Column(
              children: [
                Row(
                  children: [
                    Profil(size: 30, textshow: true),
                    SizedBox(
                      width: 20,
                    ),
                    Text("adasdöas d asd asd"),
                  ],
                ),
                SizedBox(
                  height: 10,
                ),
                Image.network(
                  "https://cdn.dsmcdn.com/ty1447/product/media/images/prod/QC/20240728/23/788ace11-6f23-3499-beb1-d094998d8c7a/1_org_zoom.jpg",
                ),
                Row(
                  children: [],
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget Profil({String? url, String? adsoyad, double? size, bool? textshow}) {
    return Column(
      children: [
        Container(
          margin: EdgeInsets.only(left: 10, top: 10),
          width: size ?? 80,
          height: size ?? 80,
          child: ClipRRect(
            borderRadius: BorderRadius.circular(100),
            child: Image.network(
              url ??
                  "https://yt3.googleusercontent.com/ytc/AIdro_kEoj9ic3VkTNHsnFpLOxFk6ixl5VCMAXZTrLkDXmoCYZE=s176-c-k-c0x00ffffff-no-rj-mo",
              fit: BoxFit.cover,
            ),
          ),
        ),
        if (textshow == null || textshow == false)
          Text(
            adsoyad ?? "Ad Soyad",
            style: TextStyle(
              fontSize: 12,
            ),
          ),
      ],
    );
  }
}

Thursday, March 5, 2026

flutter uygulama



 import 'package:flutter/material.dart';


void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomePage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color.fromARGB(255, 226, 102, 31),
      appBar: AppBar(
        backgroundColor: const Color.fromARGB(255, 226, 102, 31),
        title: Text(
          "Bu başlığımız",
          style: TextStyle(
            fontSize: 18,
            color: Colors.white,
            fontFamily: "Times New Roman",
            letterSpacing: 1.5,
          ),
        ),
        centerTitle: true,
      ),
      body: Center(
        child: Container(
          width: 280,
          height: 350,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(10),
          ),
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: 20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                SizedBox(
                  height: 40,
                ),
                Center(
                  child: Text(
                    "User Profile",
                    style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
                  ),
                ),
                SizedBox(
                  height: 15,
                ),
                Center(
                  child: SizedBox(
                    width: 100,
                    height: 100,
                    child: CircleAvatar(
                      backgroundImage: AssetImage("assets/recep.jpg"),
                    ),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  "Name",
                  style: TextStyle(fontSize: 10),
                ),
                Container(
                  width: double.infinity,
                  padding: EdgeInsets.only(bottom: 5),
                  decoration: BoxDecoration(
                    border: Border(
                      bottom: BorderSide(width: 0.5),
                    ),
                  ),
                  child: Text(
                    "Recep ÖZEN",
                    style: TextStyle(fontSize: 14, fontFamily: "Arial"),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  "Location",
                  style: TextStyle(fontSize: 10),
                ),
                Container(
                  width: double.infinity,
                  padding: EdgeInsets.only(bottom: 5),
                  decoration: BoxDecoration(
                    border: Border(
                      bottom: BorderSide(width: 0.5),
                    ),
                  ),
                  child: Text(
                    "SAKARYA",
                    style: TextStyle(fontSize: 14, fontFamily: "Arial"),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  "Favori Diller",
                  style: TextStyle(fontSize: 10, color: Colors.blue),
                ),
                Container(
                  width: double.infinity,
                  padding: EdgeInsets.only(bottom: 5),
                  decoration: BoxDecoration(
                    border: Border(
                      bottom: BorderSide(width: 0.5),
                    ),
                  ),
                  child: Text(
                    "İngilizce, Boşnakça",
                    style: TextStyle(fontSize: 14, fontFamily: "Arial"),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Tuesday, March 3, 2026

mysl bağlantı .net framework form için

 using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using MySql.Data.MySqlClient;


namespace WindowsFormsApp6

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        

        private void button1_Click(object sender, EventArgs e)

        {

            // Bir veritabanına bağlantı için connectionstring adı verilen bilgi ifadesi gereklidir.

            string connStr = "Server=localhost;Database=dersdb;Uid=root;Pwd=1234;";


            // MySQL kullandığımız için mysql bağlantısı gerekiyor.

            // Tools->Nuget->Manage Nuget tan : Mysql.Data yı projemize ekliyoruz.


            // Eklemeyi yaptı iseniz, artık mysql kütüphanesi kullanılabilir

            // MySqlConnection, verilen Connection String ifadesini kullanarak mysql e bağlantı sağlar


            MySqlConnection conn = new MySqlConnection(connStr);


            // conn.Open() diyerek, bağlantı sağlanabilir, ancak bağlantı kurulamaz ise hata oluşur.

            // dolayısı ile try içinde kullanmak mantıklıdır.


            try

            {

                conn.Open(); // bağlantıyı aç

                // Tamam bağlantıyı sağladık, veritabanında ne yaparız.

                // veritabanında sorgular yapar, gelen verilere göre iş yaparsın.

                // o halde veritabanına sorgu göndermem gerekiyor. 

                // bunu MysqlDataAdapter sağlar.

                string query = "select * from ogrenciler";

                MySqlDataAdapter da = new MySqlDataAdapter(query, conn);

                // yukarıda dataadaptörümüze sorguyu ve bağlantı bilgisini verdik.


                // sorgu neticesinde geriye bir tablo geliyor, 

                // bu durumda bunu tutacak bir tabloya ihtiyacım var.

                DataTable dt = new DataTable();

                da.Fill(dt); // dataadapterdeki sorguyu çalıştır, sonucu dt ye doldur.


                dataGridView1.DataSource = dt;

            }

            catch (Exception)

            {


                // throw; // bunu silmen lazım

            }



        }

    }

}