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
class ScrollViewUnderContainer extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Column( | |
children: [ | |
Expanded( | |
child: ListView( | |
children: [ | |
for (int i = 0; i < 100; i++) |
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
class Tweet { | |
final String id; | |
final String content; | |
} | |
// Three response classes includes tweets. | |
class FeedResponse { | |
final List<Tweet> tweets; | |
} |
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
bool nullableBoolean() { | |
return null; | |
} | |
void main() { | |
final nullable = nullableBoolean(); | |
if (nullable == false) { | |
print('aa'); | |
} else { | |
print('bb'); |
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
final authStateProvider = StateProvider<bool>( | |
(ref) => false, | |
); | |
final notificationsStateProvider = StateProvider<List<Notification>?>( | |
(ref) { | |
final authorized = ref.watch(authStateProvider).state; | |
if (authorized) { | |
// return ? | |
} |
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
class SampleScreen extends StatefulWidget { | |
const SampleScreen({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
_SampleScreenState createState() => _SampleScreenState(); | |
} | |
class _SampleScreenState extends State<SampleScreen> { |
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
- name: 'Setup flutter environment' | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '2.10.3' | |
channel: 'stable' | |
cache: true # これ |
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
- name: Cache pubspec dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
${{ env.FLUTTER_HOME }}/.pub-cache | |
**/.packages | |
**/.flutter-plugins | |
**/.flutter-plugin-dependencies | |
**/.dart_tool/package_config.json | |
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }} |
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
- name: Cache build runner | |
uses: actions/cache@v2 | |
with: | |
path: | | |
**/.dart_tool/build | |
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
build-runner- |
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
- name: 'Setup flutter environment' | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '2.10.3' | |
channel: 'stable' | |
cache: true | |
- name: 'Cache pubspec dependencies' | |
uses: actions/cache@v2 | |
with: |
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
class MyGreatestWidget extends StatelessWidget { | |
const MyGreatestWidget({ | |
Key? key, | |
required this.onPressed, | |
}) : super(key: key); | |
final ValueCallback<String> onPressed; | |
@override | |
Widget build(BuildContext context) { |
OlderNewer