DeveloperBreeze

Dart Development Tutorials, Guides & Insights

Unlock 3+ expert-curated dart tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your dart skills on DeveloperBreeze.

Tutorial
dart

دليل شامل: تطوير تطبيقات باستخدام إطار العمل Flutter

flutter doctor
  • سيعرض هذا الأمر قائمة بالأدوات المطلوبة. أكمل تثبيت أي أدوات مفقودة.

Dec 12, 2024
Read More
Tutorial
dart

Building an Advanced Weather App with Flutter and Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../providers/weather_provider.dart';

class WeatherScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final weatherProvider = Provider.of<WeatherProvider>(context);

    return Scaffold(
      appBar: AppBar(
        title: Text('Weather App'),
      ),
      body: Center(
        child: weatherProvider.weather == null
            ? Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    'Enter City Name',
                    style: TextStyle(fontSize: 24),
                  ),
                  Padding(
                    padding: const EdgeInsets.all(16.0),
                    child: TextField(
                      onSubmitted: (value) {
                        weatherProvider.fetchWeather(value);
                      },
                      decoration: InputDecoration(
                        border: OutlineInputBorder(),
                        labelText: 'City',
                      ),
                    ),
                  ),
                ],
              )
            : Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    weatherProvider.weather!.cityName,
                    style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
                  ),
                  SizedBox(height: 16),
                  Text(
                    '${weatherProvider.weather!.temperature}°C',
                    style: TextStyle(fontSize: 56),
                  ),
                  SizedBox(height: 16),
                  Image.network(
                    'http://openweathermap.org/img/wn/${weatherProvider.weather!.icon}@2x.png',
                  ),
                  SizedBox(height: 16),
                  Text(
                    weatherProvider.weather!.description,
                    style: TextStyle(fontSize: 24),
                  ),
                ],
              ),
      ),
    );
  }
}

Run the app using:

Aug 12, 2024
Read More
Tutorial
dart

Introduction to Flutter and Dart

Or, use the built-in run feature in your IDE to start the app on an emulator or a connected device.

  • MyApp Class: This is the root widget of the application. It sets up the theme and the home page of the app.
  • MyHomePage Class: A stateful widget that manages the app’s state, including the counter value.
  • _incrementCounter Method: Updates the state of the app by increasing the counter each time the button is pressed.
  • Scaffold Widget: Provides the basic material design layout structure, including an app bar and a body for the main content.

Aug 12, 2024
Read More