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
| #!/bin/bash | |
| # Update Gradle, Java and other Android project settings in a Flutter project | |
| # Works with both .gradle and .gradle.kts build files | |
| # See: https://gradle.org/releases/ | |
| # See: https://developer.android.com/build/releases/gradle-plugin#compatibility | |
| DESIRED_GRADLE_VERSION="8.11.1" | |
| # Build errors often show the required Java version | |
| DESIRED_JAVA_VERSION="17" | |
| # See: https://developer.android.com/ndk/downloads |
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
| const functions = require("firebase-functions"); | |
| const admin = require("firebase-admin"); | |
| admin.initializeApp(); | |
| const db = admin.firestore(); | |
| const FieldValue = admin.firestore.FieldValue; | |
| exports.updateScores = functions.firestore | |
| .document("users/{userId}") | |
| .onUpdate((change, context) => { | |
| const newValue = change.after.data(); |
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'; | |
| 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 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'; | |
| void main() async { | |
| runApp(const DynamicHeader()); | |
| } | |
| class DynamicHeader extends StatelessWidget { | |
| const DynamicHeader({Key? key}) : super(key: key); | |
| @override |
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
| /// Implementation of [Card] using the new [MaterialStateProperty] for handling | |
| /// and reacting to user interactions. | |
| class InteractiveCard extends StatefulWidget { | |
| const InteractiveCard({ | |
| Key? key, | |
| this.color, | |
| this.shadowColor, | |
| this.elevation, | |
| this.shape, | |
| this.borderOnForeground = true, |
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 'dart:async'; | |
| import 'package:bloc/bloc.dart'; | |
| import 'package:meta/meta.dart'; | |
| class BlocClosedWithoutYieldingStateException implements Exception {} | |
| Future<T> waitForStateFromBloc<T>({ | |
| @required Bloc bloc, | |
| }) { |
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
| // MIT License | |
| // | |
| // Copyright (c) 2020 Simon Lightfoot | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
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
| // Flutter code sample for | |
| // This example shows three spinning squares that use the value of the notifier | |
| // on an ancestor [InheritedNotifier] (`SpinModel`) to give them their | |
| // rotation. The notifier doesn't need to know about the children, or need to | |
| // be an animation controller, however. The `SpinModel` class could just as | |
| // easily listen to another object (say, a separate object that keeps the | |
| // value of a slider) that was a [Listenable], and get the value from that. The | |
| // descendants also don't need to have an instance of the [InheritedNotifier] | |
| // in order to use it, they just need to know that there is one in their |
NewerOlder