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
# Measures sound-null-safety migration progress. | |
# | |
# Does so by checking total number of dart files and number of Dart files with the either of the following 3 statements: | |
# - "// @dart=2.9" | |
# - "// ignore: import_of_legacy_library_into_null_safe" | |
# - "// ignore_for_file: import_of_legacy_library_into_null_safe" | |
import itertools | |
import os | |
import sys |
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:convert' show JsonEncoder; | |
void prettyPrintJson(dynamic object) { | |
print(JsonEncoder.withIndent(" ").convert(object)); | |
} |
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
const double _rankWidth = 50; | |
const double _teamInfoWidth = 90; | |
const double _ptsWidth = cellWidth; // cellWidth is 60 (from another file) | |
class _LeagueTable extends StatefulWidget { | |
final List<LeagueTableTeam> leagueTableTeams; | |
const _LeagueTable({required this.leagueTableTeams, Key? key}) : super(key: key); | |
@override |
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:marquee/marquee.dart'; | |
/// Marquee text along Axis.horizontal for the purpose of the demo. | |
class MaybeMarqueeText extends StatelessWidget { | |
final String text; | |
final double height; | |
final double maxWidth; | |
const MaybeMarqueeText( |
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/services.dart'; | |
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
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
// Initially posted here (with screenshots): https://gist.github.com/rohan20/d12a709a27511304c853334dd636ba63 | |
// Demo: https://dartpad.dev/?id=b95177ad365c4c0e2f48625f27996d52 | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(DemoApp()); | |
} | |
class DemoApp 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
/// Rounded border on some sides of a widget is tricky to achieve since Flutter's [BorderRadius] and [Border] don't | |
/// work together when the border is "not" on all sides. | |
/// | |
/// The initial logic was found here: https://stackoverflow.com/a/61613471/5066615. | |
/// | |
/// The way it's done here is to wrap the [child] in 2 [Container] widgets: | |
/// The outer [Container] has its background color set to [borderColor] i.e. what we want the border color to be. | |
/// The inner [Container] has its background color set to the background color of the widget behind the [child] so | |
/// that it appears to just have a border of [borderColor]. | |
/// The inner [Container] also has a margin that is the same size as the [borderWidth]. |
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(DemoApp()); | |
} | |
class DemoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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(DemoApp()); | |
} | |
class DemoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
NewerOlder