Skip to content

Instantly share code, notes, and snippets.

@SerdarAtesc

SerdarAtesc/yonlendirme.dart Secret

Created Apr 6, 2021
Embed
What would you like to do?
yonlendirme.dart
import 'package:firebaseauth/sayfalar/anaSayfa.dart';
import 'package:firebaseauth/sayfalar/girisSayfasi.dart';
import 'package:firebaseauth/servisler/yetkilendirmeServisi.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'modeller/kullanici.dart';
class Yonlendirme extends StatelessWidget {
@override
Widget build(BuildContext context) {
final _yetkilendirmeServisi =
Provider.of<YetkilendirmeServisi>(context, listen: false);
return StreamBuilder(
stream: _yetkilendirmeServisi.durumTakipcisi,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
}
if (snapshot.hasData) {
Kullanici aktifKullanici = snapshot.data;
_yetkilendirmeServisi.aktifkullaniciid = aktifKullanici.id;
return AnaSayfa();
} else {
return GirisSayfasi();
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment