import 'package:flutter/material.dart';
import 'package:time_tracker_flutter_course/services/auth.dart';
//Provider ์ง์ ์์ฑ
class AuthProvider extends InheritedWidget {
AuthProvider({@required this.auth, @required this.child});
final AuthBase auth;
final Widget child;
@override
bool updateShouldNotify(InheritedWidget oldWidget) => false;
//final auth =AuthProvider.of(context);
// static ์ ์ ์ ์ธ ๋ฉ์๋ ?์๋ฌด๋ฐ์๋ ํธ์ถ ๊ฐ๋ฅ
static AuthBase of(BuildContext context) {
AuthProvider provider =
context.dependOnInheritedWidgetOfExactType<AuthProvider>();
return provider.auth;
}
}
'ํ๋ฌํฐ (Flutter)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
how combine multiple stream with RxDart (0) | 2020.09.02 |
---|---|
ํ๋ฌํฐ Bloc ๊ณต๋ถ ์ค (0) | 2020.08.26 |
for๋ฌธ List ์ฐ์ต (0) | 2020.05.08 |
Const / List์ _ / enum / Map (0) | 2020.05.03 |
children: <Widget>[] , Dart Classes and oObjects,Dart constructors (0) | 2020.04.25 |