diff --git a/lib/main.dart b/lib/main.dart index 50ac164e..5d307a16 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -108,7 +108,7 @@ class FlwtchState extends State { supportedLocales: AppLocalizations.supportedLocales, title: 'Cwtch', theme: mkThemeData(settings), - home: (!appState.cwtchInit || appState.modalState != ModalState.none) ? SplashView() : ProfileMgrView(), + home: (!appState.cwtchInit || appState.modalState != ModalState.none) ? SplashView() : ProfileMgrView(), ), ); }, diff --git a/lib/model.dart b/lib/model.dart index 3aec14cb..40a98110 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -26,10 +26,7 @@ class ChatMessage { }; } -enum ModalState { - none, - storageMigration -} +enum ModalState { none, storageMigration } class AppState extends ChangeNotifier { bool cwtchInit = false; @@ -633,7 +630,7 @@ class ContactInfoState extends ChangeNotifier { set accepted(bool newVal) { this._accepted = newVal; - notifyListeners(); + notifyListeners(); } set blocked(bool newVal) { diff --git a/lib/settings.dart b/lib/settings.dart index e887223e..05d2de03 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -222,14 +222,8 @@ class Settings extends ChangeNotifier { // (ignores file size; if the user manually accepts the file, assume it's okay to preview) bool shouldPreview(String path) { var lpath = path.toLowerCase(); - return isExperimentEnabled(ImagePreviewsExperiment) && ( - lpath.endsWith(".jpg") || - lpath.endsWith(".jpeg") || - lpath.endsWith(".png") || - lpath.endsWith(".gif") || - lpath.endsWith(".webp") || - lpath.endsWith(".bmp") - ); + return isExperimentEnabled(ImagePreviewsExperiment) && + (lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp")); } String get downloadPath => _downloadPath; diff --git a/lib/themes/opaque.dart b/lib/themes/opaque.dart index bc033126..003b1095 100644 --- a/lib/themes/opaque.dart +++ b/lib/themes/opaque.dart @@ -139,7 +139,7 @@ ThemeData mkThemeData(Settings opaque) { appBarTheme: AppBarTheme( systemOverlayStyle: SystemUiOverlayStyle( // Status bar color - statusBarColor: opaque.current().topbarColor, + statusBarColor: opaque.current().topbarColor, // Status bar brightness (optional) statusBarIconBrightness: opaque.current().mode == mode_light ? Brightness.dark : Brightness.light, // For Android (dark icons) statusBarBrightness: opaque.current().mode == mode_light ? Brightness.dark : Brightness.light, // For iOS (dark icons) diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index 7d66c2a6..c8d775a5 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -87,7 +87,9 @@ class _MessageViewState extends State { appBarButtons.add(IconButton( icon: Icon(Icons.attach_file, size: 24), tooltip: AppLocalizations.of(context)!.tooltipSendFile, - onPressed: (){_showFilePicker(context);}, + onPressed: () { + _showFilePicker(context); + }, )); } appBarButtons.add(IconButton( @@ -154,8 +156,7 @@ class _MessageViewState extends State { builder: (BuildContext bcontext) { if (Provider.of(context, listen: false).isGroup == true) { return MultiProvider( - providers: [ChangeNotifierProvider.value(value: Provider.of(context)), - ChangeNotifierProvider.value(value: Provider.of(context))], + providers: [ChangeNotifierProvider.value(value: Provider.of(context)), ChangeNotifierProvider.value(value: Provider.of(context))], child: GroupSettingsView(), ); } else { @@ -423,19 +424,27 @@ class _MessageViewState extends State { SizedBox( height: 20, ), - Visibility(visible: showPreview, child: showPreview ? Image.file( - imagePreview!, - cacheHeight: 150, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews... - filterQuality: FilterQuality.medium, - fit: BoxFit.fill, - alignment: Alignment.center, - height: 150, - isAntiAlias: false, - errorBuilder: (context, error, stackTrace) { - return MalformedBubble(); - }, - ) : Container()), - Visibility(visible: showPreview, child: SizedBox(height: 10,)), + Visibility( + visible: showPreview, + child: showPreview + ? Image.file( + imagePreview!, + cacheHeight: 150, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews... + filterQuality: FilterQuality.medium, + fit: BoxFit.fill, + alignment: Alignment.center, + height: 150, + isAntiAlias: false, + errorBuilder: (context, error, stackTrace) { + return MalformedBubble(); + }, + ) + : Container()), + Visibility( + visible: showPreview, + child: SizedBox( + height: 10, + )), Row(mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( child: Text(AppLocalizations.of(context)!.cancel, semanticsLabel: AppLocalizations.of(context)!.cancel), @@ -443,7 +452,9 @@ class _MessageViewState extends State { Navigator.pop(bcontext); }, ), - SizedBox(width: 20,), + SizedBox( + width: 20, + ), ElevatedButton( child: Text(AppLocalizations.of(context)!.btnSendFile, semanticsLabel: AppLocalizations.of(context)!.btnSendFile), onPressed: () {