Package: http
Making API calls is essential in most applications. The http package provides an easy way to handle GET, POST, PUT, and DELETE requests.
import 'package:http/http.dart' as http;
Future<void> fetchData() async {
final response = await http.get(Uri.parse('https://api.example.com/data'));
if (response.statusCode == 200) {
print('Data: ${response.body}');
}
}
Package: dio
If you need more control over your API requests with features like interceptors, logging, and timeout handling, dio is an excellent alternative to http.
Package: provider
State management is crucial in Flutter apps. The provider package offers an efficient way to manage app state with minimal boilerplate code.
import 'package:provider/provider.dart';
class Counter with ChangeNotifier {
int _count = 0;
int get count => _count;
void increment() {
_count++;
notifyListeners();
}
}
Package: hive
For local storage, hive is lightweight, fast, and does not require additional dependencies like SQLite.
Package: shared_preferences
Ideal for storing small amounts of data like user preferences, authentication tokens, and theme settings.
import 'package:shared_preferences/shared_preferences.dart';
Future<void> saveData() async {
final prefs = await SharedPreferences.getInstance();
await prefs.setString('username', 'JohnDoe');
}
Package: flutter_bloc
For large-scale applications, flutter_bloc offers predictable state management with an event-driven approach.
Package: url_launcher
This package helps launch URLs, emails, or even phone calls directly from your Flutter app.
import 'package:url_launcher/url_launcher.dart';
void launchURL() async {
final Uri url = Uri.parse("https://flutter.dev");
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
}
Package: flutter_local_notifications
Integrate local notifications seamlessly for better user engagement.
Package: path_provider
Used for retrieving device file paths, useful for storing files, images, or cache data.
Package: lottie
Animations can elevate UI/UX, and lottie allows you to add beautiful JSON-based animations easily.
Lottie.asset('assets/animation.json');
(content writing, photography and videography)
(Branding & Strategic Communication)