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,
),
),
],
);
}
}
No comments:
Post a Comment