refactor: Migrate to Flutter 3.7.0
This commit is contained in:
parent
23438b7a42
commit
35174cb859
54 changed files with 876 additions and 2124 deletions
|
|
@ -70,8 +70,8 @@ class ContentBanner extends StatelessWidget {
|
|||
mini: true,
|
||||
heroTag: null,
|
||||
onPressed: onEdit,
|
||||
backgroundColor: Theme.of(context).backgroundColor,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
child: const Icon(Icons.camera_alt_outlined),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class LockScreenState extends State<LockScreen> {
|
|||
),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topRight,
|
||||
end: Alignment.bottomLeft,
|
||||
|
|
@ -54,7 +54,7 @@ class LockScreenState extends State<LockScreen> {
|
|||
Theme.of(context).secondaryHeaderColor.withAlpha(16),
|
||||
Theme.of(context).primaryColor.withAlpha(16),
|
||||
Theme.of(context).colorScheme.secondary.withAlpha(16),
|
||||
Theme.of(context).backgroundColor.withAlpha(16),
|
||||
Theme.of(context).colorScheme.background.withAlpha(16),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class M2PopupMenuButton<T> extends StatelessWidget {
|
|||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
elevation: theme.appBarTheme.scrolledUnderElevation,
|
||||
textStyle: theme.textTheme.bodyText1,
|
||||
textStyle: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
child: PopupMenuButton<T>(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
import 'package:fluffychat/utils/client_manager.dart';
|
||||
|
|
@ -410,7 +410,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
cancelLabel: L10n.of(context)!.doNotShowAgain,
|
||||
);
|
||||
if (result == OkCancelResult.ok && link != null) {
|
||||
launch(link.toString());
|
||||
launchUrlString(link.toString());
|
||||
}
|
||||
if (result == OkCancelResult.cancel) {
|
||||
await store.setItemBool(SettingKeys.showNoGoogle, true);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
|||
linkStyle: const TextStyle(color: Colors.blueAccent),
|
||||
textStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).textTheme.bodyText2!.color,
|
||||
color: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
),
|
||||
onLinkTap: (url) =>
|
||||
UrlLauncher(context, url).launchUrl(),
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ class ThemeController extends State<ThemeBuilder> {
|
|||
// https://github.com/bdlukaa/system_theme/issues/10
|
||||
final accentColor = SystemTheme.accentColor;
|
||||
final color = accentColor.accent;
|
||||
if (color == kDefaultSystemAccentColor) return AppConfig.chatColor;
|
||||
return color;
|
||||
} catch (_) {
|
||||
return AppConfig.chatColor;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:badges/badges.dart' as b;
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'matrix.dart';
|
||||
|
||||
class UnreadRoomsBadge extends StatelessWidget {
|
||||
final bool Function(Room) filter;
|
||||
final BadgePosition? badgePosition;
|
||||
final b.BadgePosition? badgePosition;
|
||||
final Widget? child;
|
||||
|
||||
const UnreadRoomsBadge({
|
||||
|
|
@ -32,7 +32,7 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
.where(filter)
|
||||
.where((r) => (r.isUnread || r.membership == Membership.invite))
|
||||
.length;
|
||||
return Badge(
|
||||
return b.Badge(
|
||||
alignment: Alignment.bottomRight,
|
||||
badgeContent: Text(
|
||||
unreadCount.toString(),
|
||||
|
|
@ -42,14 +42,13 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
showBadge: unreadCount != 0,
|
||||
animationType: BadgeAnimationType.scale,
|
||||
animationType: b.BadgeAnimationType.scale,
|
||||
badgeColor: Theme.of(context).colorScheme.primary,
|
||||
position: badgePosition,
|
||||
elevation: 4,
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
width: 2,
|
||||
strokeAlign: StrokeAlign.outside,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue