|
|
|
@ -10,7 +10,6 @@ import 'package:fluffychat/utils/sentry_controller.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
|
import 'package:universal_html/html.dart' as html;
|
|
|
|
@ -82,41 +81,25 @@ class FluffyChatApp extends StatelessWidget {
|
|
|
|
|
apl: _apl,
|
|
|
|
|
testClient: testClient,
|
|
|
|
|
child: Builder(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
final darkMode =
|
|
|
|
|
Theme.of(context).brightness == Brightness.dark;
|
|
|
|
|
final brightness =
|
|
|
|
|
darkMode ? Brightness.light : Brightness.dark;
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
|
|
|
|
systemNavigationBarColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
statusBarColor: Colors.transparent,
|
|
|
|
|
statusBarBrightness: brightness,
|
|
|
|
|
statusBarIconBrightness: brightness,
|
|
|
|
|
systemNavigationBarIconBrightness: brightness,
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
return AdaptivePageLayout(
|
|
|
|
|
key: _apl,
|
|
|
|
|
safeAreaOnColumnView: false,
|
|
|
|
|
onGenerateRoute: testWidget == null
|
|
|
|
|
? FluffyRoutes(context).onGenerateRoute
|
|
|
|
|
: (_) => ViewData(mainView: (_) => testWidget),
|
|
|
|
|
dividerColor: Theme.of(context).dividerColor,
|
|
|
|
|
columnWidth: FluffyThemes.columnWidth,
|
|
|
|
|
dividerWidth: 1.0,
|
|
|
|
|
routeBuilder: (builder, settings) =>
|
|
|
|
|
Matrix.of(context).loginState == LoginState.logged &&
|
|
|
|
|
!{
|
|
|
|
|
'/',
|
|
|
|
|
'/search',
|
|
|
|
|
'/contacts',
|
|
|
|
|
}.contains(settings.name)
|
|
|
|
|
? MaterialPageRoute(builder: builder)
|
|
|
|
|
: FadeRoute(page: builder(context)),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
builder: (context) => AdaptivePageLayout(
|
|
|
|
|
key: _apl,
|
|
|
|
|
safeAreaOnColumnView: false,
|
|
|
|
|
onGenerateRoute: testWidget == null
|
|
|
|
|
? FluffyRoutes(context).onGenerateRoute
|
|
|
|
|
: (_) => ViewData(mainView: (_) => testWidget),
|
|
|
|
|
dividerColor: Theme.of(context).dividerColor,
|
|
|
|
|
columnWidth: FluffyThemes.columnWidth,
|
|
|
|
|
dividerWidth: 1.0,
|
|
|
|
|
routeBuilder: (builder, settings) =>
|
|
|
|
|
Matrix.of(context).loginState == LoginState.logged &&
|
|
|
|
|
!{
|
|
|
|
|
'/',
|
|
|
|
|
'/search',
|
|
|
|
|
'/contacts',
|
|
|
|
|
}.contains(settings.name)
|
|
|
|
|
? MaterialPageRoute(builder: builder)
|
|
|
|
|
: FadeRoute(page: builder(context)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|