flutter_build_mode 1.1.1 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!
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';
}
}