Notes
![]() ![]() Notes - notes.io |
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Yapılacaklar Listesi',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: TodoList(),
);
}
}
class TodoList extends StatefulWidget {
@override
_TodoListState createState() => _TodoListState();
}
class _TodoListState extends State<TodoList> {
List<String> todos = [];
TextEditingController todoController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Yapılacaklar Listesi'),
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
)
),
body: Column(
children: [
Expanded(
child: ListView.builder(
itemCount: todos.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(todos[index]),
trailing: IconButton(
icon: Icon(Icons.delete),
onPressed: () {
setState(() {
todos.removeAt(index);
});
},
),
);
},
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
Expanded(
child: TextField(
controller: todoController,
decoration: InputDecoration(
labelText: 'Yapılacak İş',
),
),
),
SizedBox(width: 8.0),
ElevatedButton(
onPressed: () {
setState(() {
todos.add(todoController.text);
todoController.clear();
});
},
child: Text('Ekle'),
),
],
),
),
],
),
);
}
}
------------------------------------------------------------------------------------------------
Yemek Tarifleri
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Yemek Tarifleri',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: LoginPage(), // Kullanıcı giriş ekranıyla başlayabilir
);
}
}
class LoginPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Giriş Yap'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
decoration: InputDecoration(
labelText: 'Kullanıcı Adı',
),
),
TextField(
obscureText: true,
decoration: InputDecoration(
labelText: 'Şifre',
),
),
ElevatedButton(
onPressed: () {
// Kullanıcı adı ve şifre kontrolü burada yapılabilir
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
},
child: Text('Giriş Yap'),
),
],
),
),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Ana Sayfa'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text('Yemek Tarifleri'),
),
ListTile(
title: Text('Profil'),
onTap: () {
// Profil sayfasına geçiş yapılabilir
},
),
ListTile(
title: Text('Ayarlar'),
onTap: () {
// Ayarlar sayfasına geçiş yapılabilir
},
),
],
),
),
body: Center(
child: Text('Yemek Tarifi Uygulaması'),
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Ana Sayfa',
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
label: 'Ara',
),
BottomNavigationBarItem(
icon: Icon(Icons.favorite),
label: 'Favoriler',
),
],
// Aktif sayfayı belirlemek için bir değişken kullanılabilir
// currentIndex: _selectedIndex,
// onTap: _onItemTapped,
),
);
}
}
-------------------------------------------------------
Tarifli Yemekler
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class Recipe {
final String title;
final String description;
final String imageUrl;
final List<String> ingredients;
final List<String> instructions;
final String category;
Recipe({
required this.title,
required this.description,
required this.imageUrl,
required this.ingredients,
required this.instructions,
required this.category,
});
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Yemek Tarifleri',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
String selectedCategory = 'Tümü'; // Varsayılan olarak tümü kategorisi seçili
final List<Recipe> recipes = [
Recipe(
title: 'Mercimek Çorbası',
description: 'Lezzetli ve besleyici mercimek çorbası tarifi',
imageUrl: 'https://example.com/mercimek_corbasi.jpg',
ingredients: [
'1 su bardağı kırmızı mercimek',
'1 adet soğan',
'1 adet havuç',
'1 yemek kaşığı un',
'1 yemek kaşığı tereyağı',
'5 su bardağı su',
'Tuz, karabiber',
],
instructions: [
'Soğanı ve havucu doğrayın.',
'Tencereye tereyağını ekleyip eritin.',
'Doğranmış soğanı ekleyip pembeleşinceye kadar soteleyin.',
'Doğranmış havucu ekleyip kavurun.',
'Unu ekleyip kavurmaya devam edin.',
'Yıkanmış mercimeği ekleyin ve suyunu ekleyip pişirin.',
'Pişen çorbayı blenderdan geçirip servis yapın.',
],
category: 'Çorbalar',
),
Recipe(
title: 'Ispanaklı Börek',
description: 'Sağlıklı ve lezzetli ıspanaklı börek tarifi',
imageUrl: 'https://example.com/ispanakli_borek.jpg',
ingredients: [
'Yarım kilo ıspanak',
'Yarım kilo yufka',
'200 gram beyaz peynir',
'1 adet yumurta',
'Yarım çay bardağı sıvı yağ',
'Tuz, karabiber',
],
instructions: [
'Ispanağı doğrayıp soteleyin.',
'Beyaz peyniri ekleyip karıştırın.',
'Yufkaları teker teker yağlayarak üst üste koyun.',
'Üzerine ıspanaklı harcı yayın.',
'Rulo şeklinde sarıp yağlanmış tepsiye yerleştirin.',
'Üzerine yumurta sarısı sürüp önceden ısıtılmış fırında pişirin.',
],
category: 'Ev Yemekleri',
),
// Diğer tarifler buraya eklenebilir
];
final List<Recipe> favoriteRecipes = [];
// Kategoriler listesi
final List<String> categories = ['Tümü', 'Ev Yemekleri', 'Tatlılar', 'Çorbalar', 'İçecekler'];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Ana Sayfa'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text('Yemek Tarifleri'),
),
ListTile(
title: Text('Profil'),
onTap: () {
// Profil sayfasına geçiş yapılabilir
},
),
ListTile(
title: Text('Ayarlar'),
onTap: () {
// Ayarlar sayfasına geçiş yapılabilir
},
),
],
),
),
body: Column(
children: [
DropdownButton<String>(
value: selectedCategory,
onChanged: (String? value) {
setState(() {
selectedCategory = value!;
});
},
items: categories.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
Expanded(
child: ListView.builder(
itemCount: recipes.length,
itemBuilder: (context, index) {
final recipe = recipes[index];
if (selectedCategory == 'Tümü' || recipe.category == selectedCategory) {
return ListTile(
title: Text(recipe.title),
subtitle: Text(recipe.description),
leading: CircleAvatar(
backgroundImage: NetworkImage(recipe.imageUrl),
),
trailing: IconButton(
icon: favoriteRecipes.contains(recipe)
? Icon(Icons.favorite, color: Colors.red)
: Icon(Icons.favorite_border),
onPressed: () {
// Favorilere ekleme veya çıkarma işlemi
if (favoriteRecipes.contains(recipe)) {
favoriteRecipes.remove(recipe);
} else {
favoriteRecipes.add(recipe);
}
},
),
onTap: () {
// Tarifin detay sayfasına geçiş yapılabilir
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RecipeDetailPage(recipe: recipe),
),
);
},
);
} else {
return SizedBox.shrink();
}
},
),
),
],
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Ana Sayfa',
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
label: 'Ara',
),
BottomNavigationBarItem(
icon: Icon(Icons.favorite),
label: 'Favoriler',
),
],
// Aktif sayfayı belirlemek için bir değişken kullanılabilir
// currentIndex: _selectedIndex,
// onTap: _onItemTapped,
),
);
}
}
class RecipeDetailPage extends StatelessWidget {
final Recipe recipe;
RecipeDetailPage({required this.recipe});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(recipe.title),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(recipe.imageUrl),
SizedBox(height: 16.0),
Text(
'Malzemeler:',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: recipe.ingredients.map((ingredient) {
return Text('- $ingredient');
}).toList(),
),
SizedBox(height: 16.0),
Text(
'Yapılışı:',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: recipe.instructions.asMap().entries.map((entry) {
return Text('${entry.key + 1}. ${entry.value}');
}).toList(),
),
],
),
),
);
}
}
----------------------------------------------------------------------
Anasayflaı asdfasdfasdf
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class Recipe {
final String title;
final String description;
final String imageUrl;
final List<String> ingredients;
final List<String> instructions;
final String category;
Recipe({
required this.title,
required this.description,
required this.imageUrl,
required this.ingredients,
required this.instructions,
required this.category,
});
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Yemek Tarifleri',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
String selectedCategory = 'Tümü'; // Varsayılan olarak tümü kategorisi seçili
final List<Recipe> recipes = [
Recipe(
title: 'Mercimek Çorbası',
description: 'Lezzetli ve besleyici mercimek çorbası tarifi',
imageUrl: 'https://example.com/mercimek_corbasi.jpg',
ingredients: [
'1 su bardağı kırmızı mercimek',
'1 adet soğan',
'1 adet havuç',
'1 yemek kaşığı un',
'1 yemek kaşığı tereyağı',
'5 su bardağı su',
'Tuz, karabiber',
],
instructions: [
'Soğanı ve havucu doğrayın.',
'Tencereye tereyağını ekleyip eritin.',
'Doğranmış soğanı ekleyip pembeleşinceye kadar soteleyin.',
'Doğranmış havucu ekleyip kavurun.',
'Unu ekleyip kavurmaya devam edin.',
'Yıkanmış mercimeği ekleyin ve suyunu ekleyip pişirin.',
'Pişen çorbayı blenderdan geçirip servis yapın.',
],
category: 'Çorbalar',
),
Recipe(
title: 'Ispanaklı Börek',
description: 'Sağlıklı ve lezzetli ıspanaklı börek tarifi',
imageUrl: 'https://example.com/ispanakli_borek.jpg',
ingredients: [
'Yarım kilo ıspanak',
'Yarım kilo yufka',
'200 gram beyaz peynir',
'1 adet yumurta',
'Yarım çay bardağı sıvı yağ',
'Tuz, karabiber',
],
instructions: [
'Ispanağı doğrayıp soteleyin.',
'Beyaz peyniri ekleyip karıştırın.',
'Yufkaları teker teker yağlayarak üst üste koyun.',
'Üzerine ıspanaklı harcı yayın.',
'Rulo şeklinde sarıp yağlanmış tepsiye yerleştirin.',
'Üzerine yumurta sarısı sürüp önceden ısıtılmış fırında pişirin.',
],
category: 'Ev Yemekleri',
),
// Diğer tarifler buraya eklenebilir
];
final List<Recipe> favoriteRecipes = [];
// Kategoriler listesi
final List<String> categories = ['Tümü', 'Ev Yemekleri', 'Tatlılar', 'Çorbalar', 'İçecekler'];
// Kullanıcının aradığı kelime
String searchText = '';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Ana Sayfa'),
actions: [
IconButton(
icon: Icon(Icons.search),
onPressed: () {
showSearch(context: context, delegate: RecipeSearch(recipes));
},
),
],
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text('Yemek Tarifleri'),
),
ListTile(
title: Text('Profil'),
onTap: () {
// Profil sayfasına geçiş yapılabilir
},
),
ListTile(
title: Text('Ayarlar'),
onTap: () {
// Ayarlar sayfasına geçiş yapılabilir
},
),
],
),
),
body: Column(
children: [
DropdownButton<String>(
value: selectedCategory,
onChanged: (String? value) {
setState(() {
selectedCategory = value!;
});
},
items: categories.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
Expanded(
child: ListView.builder(
itemCount: recipes.length,
itemBuilder: (context, index) {
final recipe = recipes[index];
if ((selectedCategory == 'Tümü' || recipe.category == selectedCategory) &&
(searchText.isEmpty ||
recipe.title.toLowerCase().contains(searchText.toLowerCase()))) {
return ListTile(
title: Text(recipe.title),
subtitle: Text(recipe.description),
leading: CircleAvatar(
backgroundImage: NetworkImage(recipe.imageUrl),
),
trailing: IconButton(
icon: favoriteRecipes.contains(recipe)
? Icon(Icons.favorite, color: Colors.red)
: Icon(Icons.favorite_border),
onPressed: () {
setState(() {
// Favorilere ekleme veya çıkarma işlemi
if (favoriteRecipes.contains(recipe)) {
favoriteRecipes.remove(recipe);
} else {
favoriteRecipes.add(recipe);
}
});
},
),
onTap: () {
// Tarifin detay sayfasına geçiş yapılabilir
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RecipeDetailPage(recipe: recipe),
),
);
},
);
} else {
return SizedBox.shrink();
}
},
),
),
ElevatedButton(
onPressed: () {
// Yeni tarif ekleme sayfasına geçiş yapılabilir
},
child: Text('Tarif Ekle'),
),
],
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Ana Sayfa',
),
BottomNavigationBarItem(
icon: Icon(Icons.search),
label: 'Ara',
),
BottomNavigationBarItem(
icon: Icon(Icons.favorite),
label: 'Favoriler',
),
],
// Aktif sayfayı belirlemek için bir değişken kullanılabilir
// currentIndex: _selectedIndex,
// onTap: _onItemTapped,
),
);
}
}
class RecipeDetailPage extends StatelessWidget {
final Recipe recipe;
RecipeDetailPage({required this.recipe});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(recipe.title),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(recipe.imageUrl),
SizedBox(height: 16.0),
Text(
'Malzemeler:',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: recipe.ingredients.map((ingredient) {
return Text('- $ingredient');
}).toList(),
),
SizedBox(height: 16.0),
Text(
'Yapılışı:',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: recipe.instructions.asMap().entries.map((entry) {
return Text('${entry.key + 1}. ${entry.value}');
}).toList(),
),
],
),
),
);
}
}
// Arama işlevselliği için RecipeSearch sınıfı
class RecipeSearch extends SearchDelegate<Recipe> {
final List<Recipe> recipes;
RecipeSearch(this.recipes);
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = '';
},
)
];
}
@override
Widget buildLeading(BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
close(context, null);
},
);
}
@override
Widget buildResults(BuildContext context) {
final results = recipes.where((recipe) => recipe.title.toLowerCase().contains(query.toLowerCase())).toList();
return ListView.builder(
itemCount: results.length,
itemBuilder: (context, index) {
final recipe = results[index];
return ListTile(
title: Text(recipe.title),
subtitle: Text(recipe.description),
onTap: () {
close(context, recipe);
},
);
},
);
}
@override
Widget buildSuggestions(BuildContext context) {
final results = recipes.where((recipe) => recipe.title.toLowerCase().contains(query.toLowerCase())).toList();
return ListView.builder(
itemCount: results.length,
itemBuilder: (context, index) {
final recipe = results[index];
return ListTile(
title: Text(recipe.title),
subtitle: Text(recipe.description),
onTap: () {
close(context, recipe);
},
);
},
);
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team