refactor: Update to Dart 3.10 with . shorthands
This commit is contained in:
parent
75a37f3f7c
commit
1ea649f01e
167 changed files with 3351 additions and 3912 deletions
|
|
@ -26,10 +26,7 @@ class SettingsStyleController extends State<SettingsStyle> {
|
|||
|
||||
void setWallpaper() async {
|
||||
final client = Matrix.of(context).client;
|
||||
final picked = await selectFiles(
|
||||
context,
|
||||
type: FileSelectorType.images,
|
||||
);
|
||||
final picked = await selectFiles(context, type: FileSelectorType.images);
|
||||
final pickedFile = picked.firstOrNull;
|
||||
if (pickedFile == null) return;
|
||||
|
||||
|
|
@ -103,14 +100,11 @@ class SettingsStyleController extends State<SettingsStyle> {
|
|||
}
|
||||
|
||||
void deleteChatWallpaper() => showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => Matrix.of(context).client.setApplicationAccountConfig(
|
||||
const ApplicationAccountConfig(
|
||||
wallpaperUrl: null,
|
||||
wallpaperBlur: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
context: context,
|
||||
future: () => Matrix.of(context).client.setApplicationAccountConfig(
|
||||
const ApplicationAccountConfig(wallpaperUrl: null, wallpaperBlur: null),
|
||||
),
|
||||
);
|
||||
|
||||
ThemeMode get currentTheme => ThemeController.of(context).themeMode;
|
||||
Color? get currentColor => ThemeController.of(context).primaryColor;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
backgroundColor: theme.colorScheme.surface,
|
||||
body: MaxWidthBody(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
crossAxisAlignment: .stretch,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
|
|
@ -66,9 +66,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).setColorTheme,
|
||||
|
|
@ -82,10 +80,11 @@ class SettingsStyleView extends StatelessWidget {
|
|||
builder: (light, dark) {
|
||||
final systemColor =
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? light?.primary
|
||||
: dark?.primary;
|
||||
final colors =
|
||||
List<Color?>.from(SettingsStyleController.customColors);
|
||||
? light?.primary
|
||||
: dark?.primary;
|
||||
final colors = List<Color?>.from(
|
||||
SettingsStyleController.customColors,
|
||||
);
|
||||
if (systemColor == null) {
|
||||
colors.remove(null);
|
||||
}
|
||||
|
|
@ -109,8 +108,9 @@ class SettingsStyleView extends StatelessWidget {
|
|||
child: Material(
|
||||
color: color ?? systemColor,
|
||||
elevation: 6,
|
||||
borderRadius:
|
||||
BorderRadius.circular(colorPickerSize),
|
||||
borderRadius: BorderRadius.circular(
|
||||
colorPickerSize,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: colorPickerSize,
|
||||
height: colorPickerSize,
|
||||
|
|
@ -119,9 +119,9 @@ class SettingsStyleView extends StatelessWidget {
|
|||
child: Icon(
|
||||
Icons.check,
|
||||
size: 16,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onPrimary,
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimary,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
|
|
@ -134,9 +134,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).messagesStyle,
|
||||
|
|
@ -160,7 +158,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
final accountConfig = client.applicationAccountConfig;
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
|
|
@ -189,14 +187,16 @@ class SettingsStyleView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
StateMessage(
|
||||
Event(
|
||||
eventId: 'style_dummy',
|
||||
room:
|
||||
Room(id: '!style_dummy', client: client),
|
||||
room: Room(
|
||||
id: '!style_dummy',
|
||||
client: client,
|
||||
),
|
||||
content: {'membership': 'join'},
|
||||
type: EventTypes.RoomMember,
|
||||
senderId: client.userID!,
|
||||
|
|
@ -229,7 +229,8 @@ class SettingsStyleView extends StatelessWidget {
|
|||
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor',
|
||||
style: TextStyle(
|
||||
color: theme.onBubbleColor,
|
||||
fontSize: AppConfig.messageFontSize *
|
||||
fontSize:
|
||||
AppConfig.messageFontSize *
|
||||
AppSettings.fontSizeFactor.value,
|
||||
),
|
||||
),
|
||||
|
|
@ -262,7 +263,8 @@ class SettingsStyleView extends StatelessWidget {
|
|||
'Lorem ipsum dolor sit amet',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurface,
|
||||
fontSize: AppConfig.messageFontSize *
|
||||
fontSize:
|
||||
AppConfig.messageFontSize *
|
||||
AppSettings.fontSizeFactor.value,
|
||||
),
|
||||
),
|
||||
|
|
@ -275,9 +277,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: TextButton.icon(
|
||||
style: TextButton.styleFrom(
|
||||
|
|
@ -325,9 +325,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).fontSize),
|
||||
trailing: Text(
|
||||
'× ${AppSettings.fontSizeFactor.value}',
|
||||
),
|
||||
trailing: Text('× ${AppSettings.fontSizeFactor.value}'),
|
||||
),
|
||||
Slider.adaptive(
|
||||
min: 0.5,
|
||||
|
|
@ -337,9 +335,7 @@ class SettingsStyleView extends StatelessWidget {
|
|||
semanticFormatterCallback: (d) => d.toString(),
|
||||
onChanged: controller.changeFontSizeFactor,
|
||||
),
|
||||
Divider(
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context).overview,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue