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,
  };
}

No comments: