smart_executer 2.2.0 copy "smart_executer: ^2.2.0" to clipboard
smart_executer: ^2.2.0 copied to clipboard

A powerful Flutter package for executing async operations with built-in error handling, loading dialogs, retry logic, and Result pattern support.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:smart_executer/smart_executer.dart';

import 'core/app_router.dart';
import 'core/app_theme.dart';

void main() {
  // Initialize SmartExecuter configuration
  SmartExecuterConfig.initialize(
    enableLogging: kDebugMode,
    defaultErrorMessage: () => 'Something went wrong. Please try again.',
    noConnectionMessage: () => 'No internet connection. Please check your network.',
    sessionExpiredMessage: () => 'Your session has expired. Please sign in again.',
    sessionExpiredTitle: () => 'Session Expired',
    checkConnectionByDefault: false,
    globalErrorHandler: (exception) async {
      debugPrint(
          'Global error [${exception.exceptionType.name}]: ${exception.message}');
      if (exception.metadata.hasData) {
        debugPrint('Metadata: ${exception.metadata.toMap()}');
      }
    },
  );

  runApp(const SmartExecuterDemo());
}

class SmartExecuterDemo extends StatelessWidget {
  const SmartExecuterDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Smart Executer',
      debugShowCheckedModeBanner: false,
      theme: AppTheme.light,
      routerConfig: appRouter,
    );
  }
}
1
likes
0
points
370
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful Flutter package for executing async operations with built-in error handling, loading dialogs, retry logic, and Result pattern support.

Repository (GitHub)
View/report issues

Topics

#async #error-handling #loading #network #dio

License

unknown (license)

Dependencies

connectivity_plus, dio, flutter, logger

More

Packages that depend on smart_executer