This file contains hidden or 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
class ActionLogger extends StatefulWidget implements ActionDetails { | |
const ActionLogger({ | |
super.key, | |
required this.async, | |
required this.prefix, | |
required this.name, | |
required this.parameters, | |
this.priority = kDefaultButtonPriority, | |
required this.onError, | |
required this.builder, |
This file contains hidden or 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
/// This outlines a few different approaches for converting an arbitrary if...else statement chain into an expression. | |
/// Here will be our example scenario based off of a real scenario in my production app: | |
/// A. Evaluate to a `NewGameButton` widget if `game` is finished and a new game hasn't been started yet. | |
/// B. Evaluate to a blank widget (`SizedBox`) if `game` has just started but is loading. | |
/// C. Otherwise evaluate to a `GameHUD` widget. | |
/// Here is the above as a statement. IMO this is by far the most readable, but is only applicable in contexts | |
/// where a statement can be used. | |
final game = Game.watch(context); | |
if (!game.isPlaying) { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js" | |
integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" | |
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
<title>Swipeball</title> |
This file contains hidden or 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
class DraggableYeetableSheet extends StatefulWidget { | |
const DraggableYeetableSheet({super.key}); | |
@override | |
State<DraggableYeetableSheet> createState() => _DraggableYeetableSheetState(); | |
} | |
class _DraggableYeetableSheetState extends State<DraggableYeetableSheet> { | |
final DraggableScrollableController sheetController = | |
DraggableScrollableController(); |
This file contains hidden or 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() async { | |
FutureBuilder.debugRethrowError = true; | |
runApp(const _ScrollTestWidget()); | |
} | |
class _ScrollTestWidget extends StatefulWidget { | |
const _ScrollTestWidget(); | |
@override | |
State<_ScrollTestWidget> createState() => _ScrollTestWidgetState(); |
This file contains hidden or 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'; | |
abstract class StatelessContainerWidget extends StatelessWidget { | |
/// A constructor that exposes all of the `Container` arguments as a style | |
/// object. | |
const StatelessContainerWidget({ | |
super.key, | |
this.cStyle, | |
}); |
This file contains hidden or 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
class DeclarativePageDemo extends StatefulWidget { | |
const DeclarativePageDemo({super.key}); | |
@override | |
State<DeclarativePageDemo> createState() => _DeclarativePageDemoState(); | |
} | |
class _DeclarativePageDemoState extends State<DeclarativePageDemo> { | |
ValueNotifier<PageValue> pageNotifier = ValueNotifier(PageValue.home); |
This file contains hidden or 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
class CountdownTimer extends ValueListenable<Duration> with ChangeNotifier { | |
CountdownTimer(this.duration, {this.frequency}); | |
final Duration duration; | |
final Duration? frequency; | |
final Stopwatch _stopwatch = Stopwatch(); | |
Timer? _timer; |
NewerOlder