Created
May 10, 2020 23:46
-
-
Save Abdelkrim/f3ec216320f2c70345cc42528bc013b2 to your computer and use it in GitHub Desktop.
Flutter, inherited widget understood from a Inherited Widgets Explained - Flutter Widgets 101 Ep. 3 on YouTube
This file contains hidden or 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
// see https://www.youtube.com/watch?v=Zbm3hjPjQMk | |
import 'package:flutter/material.dart'; | |
class InheritedSettings extends InheritedWidget{ | |
final SettingsSwitchesStatefulWidget settingsSwitchesStatefulWidget; | |
final TechnicalInfoSection technicalInfoSection; | |
InheritedSettings({this.SettingsSwitchesStatefulWidget, Widget child}): super(child: child); | |
@override | |
bool updateShouldNotify(InheritedWidget oldWidget) => true; | |
static InheritedSettings of(BuildContext context) => context.inheritFromWidgetOfExactType(InheritedSettings); | |
} | |
class SettingsScreen extends StatelessWidget{ | |
@override | |
Widget build(BuildContext context){ | |
final settingsScreen = InheritedSettings.of(context); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment