Skip to content

Instantly share code, notes, and snippets.

@anqit
anqit / main.dart
Created February 25, 2023 03:39
Boolean compound assignment operators should short-circuit if possible
bool longComp() {
print('doing long computation');
return true;
}
void main() {
var t = true;
var f = false;
t |= longComp(); // prints 'doing long computation'
import 'package:flutter/material.dart';
// import 'package:flutter/cupertino.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});