This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WidgetsFlutterBinding - DEBUG MODE | |
[root] | |
└View(state: _ViewState#7a937) | |
└RawView | |
└_RawViewInternal-[_DeprecatedRawViewKey EngineFlutterWindow#b1dd3](renderObject: _ReusableRenderView#4ed98) | |
└_ViewScope | |
└_PipelineOwnerScope | |
└_MediaQueryFromView(state: _MediaQueryFromViewState#6203c) | |
└MediaQuery(MediaQueryData(size: Size(1200.0, 1444.0), devicePixelRatio: 1.0, textScaler: no scaling, platformBrightness: Brightness.dark, padding: EdgeInsets.zero, viewPadding: EdgeInsets.zero, viewInsets: EdgeInsets.zero, systemGestureInsets: EdgeInsets.zero, alwaysUse24HourFormat: false, accessibleNavigation: false, | |
highContrast: false, onOffSwitchLabels: false, disableAnimations: false, invertColors: false, boldText: false, navigationMode: traditional, gestureSettings: DeviceGestureSettings(touchSlop: null), displayFeatures: [], supportsShowingSystemContextMenu: false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/semantics.dart'; | |
void main() { | |
runApp(MyApp()); | |
SemanticsBinding.instance.ensureSemantics(); | |
} | |
// Shared label | |
const _fieldLabel = 'Enter Text'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:js_interop'; | |
import 'package:flutter/material.dart'; | |
import 'package:web/web.dart' as web; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
for (final day in List<int>.generate(365, (n) => n)) { | |
print('day $day, week ${day ~/ 7}, 28-day period ${day ~/ 28}'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The names for the values computed for each [BenchmarkMetric]. | |
enum BenchmarkMetricComputation { | |
/// The name for the computed value tracking the average value of the measured | |
/// samples without outliers. | |
average, | |
/// The name for the computed value tracking the average of outlier samples. | |
outlierAverage, | |
/// The name for the computed value tracking the outlier average divided by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class BenchmarkMetricComputation { | |
const BenchmarkMetricComputation(this.name); | |
final String name; | |
/// The name for the computed value tracking the average value of the measured | |
/// samples without outliers. | |
static const NamedMetricComputation average = NamedMetricComputation('average'); | |
/// The name for the computed value tracking the average of outlier samples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pragma('dart2js:tryInline') | |
bool get assertionsEnabled { | |
var enabled = false; | |
assert(enabled = true); | |
return enabled; | |
} | |
// Elsewhere | |
void main() { | |
if (assertionsEnabled) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@widget Counter { | |
final int initialValue; | |
@state { | |
int count = initialValue; | |
String buttonLabel = 'Increment'; | |
} | |
Widget build(context) { | |
return Column(children: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp(name: 'Dash')); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key, required this.name}); | |
final String name; |
NewerOlder