View main.dart
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:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:google_fonts/google_fonts.dart'; | |
void main() { | |
runApp( | |
const App(), | |
); | |
} |
View workaround.sh
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
sed -i "" 's/source="$(readlink "${source}")"/source="$(readlink -f "${source}")"/g' "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh" |
View main.dart
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:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
View main.dart
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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
View main.dart
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:cloud_firestore/cloud_firestore.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:riverpod/riverpod.dart'; | |
// 1つ目のStreamProvider | |
final authUserProvider = | |
StreamProvider<User?>((ref) => FirebaseAuth.instance.userChanges()); | |
// 2つ目のStreamProvider | |
// authUserProviderをwatchした値を使ってFirestoreから得られるStreamを返す |
View main.dart
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(const App()); | |
} | |
class App extends StatelessWidget { | |
const App({super.key}); | |
@override |
View main.dart
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(const App()); | |
class App extends StatelessWidget { | |
const App({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( |
View main.dart
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:async'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
void main() { | |
test('', () async { | |
// broadcast取ると、expectはtrueになる | |
// BehaviorSubjectでも、expectはtrueになる | |
final controller = StreamController<bool>.broadcast(); |
View state_notifier.dart
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 PackageMetrics extends StateNotifier<AsyncValue<PackageMetricsScore>> { | |
PackageMetrics(this._ref, {required this.packageName}) | |
: super(const AsyncLoading()) { | |
_ref | |
.watch(pubRepositoryProvider) | |
.getPackageMetrics(packageName: packageName) | |
.then((value) => state = AsyncData(value)); | |
} | |
final AutoDisposeRef _ref; |
View async_notifier.dart
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 PackageMetrics | |
// AutoDispose/Family版のAsyncNotifier | |
extends AutoDisposeFamilyAsyncNotifier<PackageMetricsScore, String> { | |
late String _packageName; | |
@override | |
Future<PackageMetricsScore> build(String arg) { | |
_packageName = arg; | |
return ref | |
.watch(pubRepositoryProvider) | |
.getPackageMetrics(packageName: _packageName); |
NewerOlder