flutter_build_mode 1.1.1 copy "flutter_build_mode: ^1.1.1" to clipboard
flutter_build_mode: ^1.1.1 copied to clipboard

A package that extends the use of the 3 build modes, release, profile, and debug, for Flutter apps!

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_build_mode/flutter_build_mode.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('BuildMode example'),
        ),
        body: Center(
          child: Text('Current build mode is ${_currentBuildMode()}'),
        ),
      ),
    );
  }

  String _currentBuildMode() {
    if (BuildMode.isRelease) {
      return 'Release Mode';
    }
    if (BuildMode.isProfile) {
      return 'Profile Mode';
    }

    return 'Debug Mode';
  }
}
2
likes
160
pub points
35%
popularity

Publisher

verified publisherokaryo.io

A package that extends the use of the 3 build modes, release, profile, and debug, for Flutter apps!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_build_mode