Skip to content

Instantly share code, notes, and snippets.

View kenresoft's full-sized avatar
💥
Building some innovative solutions.

Kenneth Amadi kenresoft

💥
Building some innovative solutions.
View GitHub Profile
@kenresoft
kenresoft / riff_switch.dart
Created May 30, 2023 22:05
Comparing Dart 2 and Dart 3 Switch statements.
final RiffSwitchType type;
RiffSwitchType get _type => type;
@override
Widget build(BuildContext context) {
// Dart 2
/*switch (_type) {
case RiffSwitchType.simple:
return _buildSimpleSwitch();
@kenresoft
kenresoft / main.dart
Last active June 1, 2023 07:38
Sample of my GoRouter setup methods in my main.dart
void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft,
]).then(appCallback);
}