custom_api_services 0.0.2
custom_api_services: ^0.0.2 copied to clipboard
A Dio-based network manager with caching, authentication, offline support, progress tracking, and error handling for Flutter/Dart apps.
example/lib/main.dart
import 'package:custom_api_services_example/home_screen.dart';
import 'package:flutter/material.dart';
import 'package:custom_api_services/custom_api_services.dart';
late ApiServices customApiService;
late CustomApiServices globalInstance;
void main() {
WidgetsFlutterBinding.ensureInitialized();
customApiService = ApiServices(enableCache: true);
globalInstance = CustomApiServices(
baseUrl: 'https://www.staging2.clickawaygrocer.com.au/wp-json/mobileapp/v1',
// baseUrl: 'http://52.66.76.36/api',
// baseUrl: 'https://staging.tigratem.com/api',
enableCache: true,
);
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(home: HomeScreen());
}
}