Open berkeresvan opened 6 months ago
import 'package:flutter/material.dart'; import 'package:tabs/sayfa1.dart'; import 'package:tabs/sayfa2.dart'; import 'package:tabs/sayfa3.dart';
void main() { runApp(const MyApp()); }
class MyApp extends StatelessWidget { const MyApp({super.key});
@override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } }
class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title});
final String title;
@override State createState() => _MyHomePageState(); }
class _MyHomePageState extends State { @override Widget build(BuildContext context) { return DefaultTabController( length: 3, child: Scaffold( appBar: AppBar( backgroundColor: Colors.green, title: Text(widget.title), bottom: TabBar( tabs: [ Tab( text: "Bir", ), Tab( icon: Icon( Icons.looks_two, color: Colors.cyanAccent, ), ), Tab( text: "üç", icon: Icon(Icons.looks_3), ) ], indicatorColor: Colors.pink, labelColor: Colors.orange, ), ), body: TabBarView(children: [ Sayfa1(), Sayfa2(), Sayfa3(), ]), ), ); } }
import 'package:flutter/material.dart';
class Sayfa1 extends StatefulWidget { const Sayfa1({super.key});
@override State createState() => _Sayfa1State(); }
class _Sayfa1State extends State { @override Widget build(BuildContext context) { return Center( child: Text( "Sayfa 1", style: TextStyle(color: Colors.black54, fontSize: 30), ), ); } }
import 'package:flutter/material.dart'; import 'package:tabs/sayfa1.dart'; import 'package:tabs/sayfa2.dart'; import 'package:tabs/sayfa3.dart';
void main() { runApp(const MyApp()); }
class MyApp extends StatelessWidget { const MyApp({super.key});
@override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } }
class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title});
final String title;
@override State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.green,
title: Text(widget.title),
bottom: TabBar(
tabs: [
Tab(
text: "Bir",
),
Tab(
icon: Icon(
Icons.looks_two,
color: Colors.cyanAccent,
),
),
Tab(
text: "üç",
icon: Icon(Icons.looks_3),
)
],
indicatorColor: Colors.pink,
labelColor: Colors.orange,
),
),
body: TabBarView(children: [
Sayfa1(),
Sayfa2(),
Sayfa3(),
]),
),
);
}
}