share_my_apk 1.1.4 copy "share_my_apk: ^1.1.4" to clipboard
share_my_apk: ^1.1.4 copied to clipboard

Build and upload Flutter Android APKs to Diawi, Gofile.io, and Firebase App Distribution. Production-ready CLI tool with security hardening, comprehensive error handling, and extensive testing.

example/main.dart

import 'package:share_my_apk/share_my_apk.dart';
import 'package:logging/logging.dart';

void main() async {
  // Configure logging to see detailed output from the tool.
  _setupLogging();

  final logger = Logger('main');

  try {
    // 1. Initialize the Flutter build service.
    final apkBuilder = FlutterBuildService();

    // 2. Build the APK.
    // This assumes you are running the command from the root of a Flutter project.
    final apkPath = await apkBuilder.build(
      release: true,
      customName: 'MyAwesomeApp',
      environment: 'production',
    );

    logger.info('βœ… APK built successfully: $apkPath');

    // 3. Upload the APK to a service (e.g., Gofile.io).
    final uploader = UploadServiceFactory.create('gofile');
    final downloadLink = await uploader.upload(apkPath);

    logger.info('πŸš€ Upload successful!');
    logger.info('πŸ”— Download Link: $downloadLink');
  } catch (e) {
    logger.severe('❌ An error occurred: $e');
  }
}

/// Configures logging to display all messages with timestamps.
void _setupLogging() {
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) {
    final logger = Logger('main');
    final timestamp = record.time.toIso8601String().substring(0, 19);
    logger.info('[$timestamp] ${record.level.name}: ${record.message}');
  });
}
2
likes
150
points
19
downloads

Publisher

verified publisherwebmobtech.com

Weekly Downloads

Build and upload Flutter Android APKs to Diawi, Gofile.io, and Firebase App Distribution. Production-ready CLI tool with security hardening, comprehensive error handling, and extensive testing.

Repository (GitHub)
View/report issues
Contributing

Topics

#apk-builder #android #upload #flutter #cli

Documentation

API reference

License

MIT (license)

Dependencies

args, http, intl, logging, meta, path, process_run, yaml

More

Packages that depend on share_my_apk