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 lightTheme = ThemeData(colorSchemeSeed: Colors.orange, …); | |
final darkTheme = ThemeData(colorSchemeSeed: Colors.orange, brightness: Brightness.dark, …); |
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 lightScheme = ColorScheme.fromSeed(seedColor: Colors.green); | |
final darkScheme = ColorScheme.fromSeed(seedColor: Colors.green, brightness: Brightness.dark); |
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
personsRef.whereName(isEqualTo: 'Bob'); | |
personsRef.whereAge(isGreaterThan: 42); |
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
@JsonSerializable() | |
class Person { | |
Person({required this.name, required this.age}); | |
final String name; | |
final int age; | |
} | |
@Collection<Person>(‘/persons’) | |
final personsRef = PersonCollectionReference(); |
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 FirestoreTableStory extends StatelessWidget { | |
FirestoreTableStory({Key? key}) : super(key: key); | |
// live Firestore query | |
final usersCollection = FirebaseFirestore.instance.collection('users'); | |
@override | |
Widget build(BuildContext context) { | |
return FirestoreDataTable( | |
query: usersCollection, |
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 UserListView extends StatelessWidget { | |
UserListView({Key? key}) : super(key: key); | |
// live Firestore query | |
final usersCollection = FirebaseFirestore.instance.collection('users'); | |
@override | |
Widget build(BuildContext context) => Scaffold( | |
appBar: AppBar(title: const Text('Contacts')), | |
body: FirestoreListView<Map>( |
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'; | |
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:flutterfire_ui/auth.dart'; | |
import 'firebase_options.dart'; | |
Future<void> main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); | |
runApp(MyApp()); |
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
static const FirebaseOptions web = FirebaseOptions( | |
apiKey: 'AIzaSyCZFKryCEiKhD0JMPeq_weJguspf09h7Cg', | |
appId: '1:111079797892:web:b9195888086158195ffed1', | |
messagingSenderId: '111079797892', | |
projectId: 'flutterfire-fun', | |
authDomain: 'flutterfire-fun.firebaseapp.com', | |
storageBucket: 'flutterfire-fun.appspot.com', | |
measurementId: 'G-K029Y6KJDX', | |
); |
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:firebase_core/firebase_core.dart'; | |
import 'firebase_options.dart'; // generated via `flutterfire` CLI | |
Future<void> main() async { | |
// initialize firebase across all supported platforms | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); | |
runApp(MyApp()); | |
} |
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
flutter: | |
plugin: | |
implements: hello | |
platforms: | |
windows: | |
dartPluginClass: HelloPluginWindows |
NewerOlder