Merge branch 'master' into feature/notifications

This commit is contained in:
Salvatore Giordano
2020-04-08 14:30:49 +02:00
12 changed files with 275 additions and 123 deletions
+30 -26
View File
@@ -68,33 +68,37 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
return StreamChatTheme(
data: theme,
child: Builder(
builder: (context) => Theme(
data: Theme.of(context).copyWith(
accentColor: StreamChatTheme.of(context).accentColor,
scaffoldBackgroundColor: Colors.white,
backgroundColor: Colors.white,
),
child: WillPopScope(
onWillPop: () async {
if (_navigatorKey.currentState.canPop()) {
_navigatorKey.currentState.pop();
return false;
} else {
return true;
}
},
child: Navigator(
initialRoute: '/',
key: _navigatorKey,
onGenerateRoute: (settings) {
return MaterialPageRoute(
settings: settings,
builder: (_) => widget.child,
);
},
builder: (context) {
final materialTheme = Theme.of(context);
final isDark = materialTheme.brightness == Brightness.dark;
return Theme(
data: materialTheme.copyWith(
accentColor: StreamChatTheme.of(context).accentColor,
scaffoldBackgroundColor: isDark ? Colors.black : Colors.white,
backgroundColor: isDark ? Colors.black : Colors.white,
),
),
),
child: WillPopScope(
onWillPop: () async {
if (_navigatorKey.currentState.canPop()) {
_navigatorKey.currentState.pop();
return false;
} else {
return true;
}
},
child: Navigator(
initialRoute: '/',
key: _navigatorKey,
onGenerateRoute: (settings) {
return MaterialPageRoute(
settings: settings,
builder: (_) => widget.child,
);
},
),
),
);
},
),
);
}