Skip to content

Instantly share code, notes, and snippets.

View Reprevise's full-sized avatar
🏅
Golden

Benjamin Reprevise

🏅
Golden
View GitHub Profile
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyAppOne(),
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyWidget(),
);
void main() {
start(['Jim', 'John', 'Nicole', 'Smith', 'What', 'Best team', 'Dart', 'Flutter', 'C#', 'bungo', 'Odd team']);
}
List<String> teams;
List<List<String>> bracket = [];
int maxRounds;
void start(List<String> origTeams) {
if (origTeams.length < 4) {
@Reprevise
Reprevise / main.dart
Created September 8, 2021 18:36
Example Stack AppBar
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@Reprevise
Reprevise / main.dart
Created September 6, 2023 15:48
FutureOr<T?> analyzer compiler mismatch error
import 'dart:async' show FutureOr;
import 'dart:math' show Random;
final rand = Random();
void main() async {
final hi = await maybeString();
maybeString()?.then((v) => v); // error mismatch here
}
@Reprevise
Reprevise / string_benchmark.dart
Created February 4, 2024 18:01
Various string benchmarks in Dart
import 'dart:math';
import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:characters/characters.dart';
const String _kCharset =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
final Random _random = Random();
String _generateRandomString(int length) {