mirror of
https://github.com/DungeonPaper/dungeon-paper-app.git
synced 2026-05-17 17:58:11 +00:00
chore: format all files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[*]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
insert_final_newline = false
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
@@ -236,4 +236,3 @@ class AlignmentValues extends dw.AlignmentValues {
|
||||
@override
|
||||
String toString() => 'AlignmentValues($debugProperties)';
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,8 @@ class Character with WithIcon implements WithMeta<Character, CharacterMeta> {
|
||||
double get currentExpPercent => clamp(stats.currentXp / maxXp, 0, 1);
|
||||
int get maxLoad => stats.load ?? defaultMaxLoad;
|
||||
int get defaultMaxLoad => characterClass.load + abilityScores.loadBaseValue;
|
||||
double get currentLoad => items.fold(0, (weight, item) => weight + item.weight);
|
||||
double get currentLoad =>
|
||||
items.fold(0, (weight, item) => weight + item.weight);
|
||||
int get armor => stats.armor ?? defaultArmor;
|
||||
int get defaultArmor => items.fold(0, (armor, item) => armor + item.armor);
|
||||
int get damageModifier => items.fold(0, (mod, item) => mod + item.damage);
|
||||
|
||||
@@ -10,7 +10,7 @@ class GearChoice extends dw.GearChoice {
|
||||
required List<GearSelection> super.selections,
|
||||
super.preselect,
|
||||
super.maxSelections,
|
||||
}) : _selections = selections;
|
||||
}) : _selections = selections;
|
||||
|
||||
@override
|
||||
List<GearSelection> get selections => _selections;
|
||||
|
||||
@@ -35,7 +35,8 @@ class Item extends dw.Item with WithIcon implements WithMeta {
|
||||
.firstWhereOrNull((tag) => cleanStr(tag?.name ?? '') == name);
|
||||
bool get isWorn => findTag('worn') != null;
|
||||
|
||||
double get weight => (settings.countWeight ? tagIntValue('weight') ?? 0 : 0) * amount;
|
||||
double get weight =>
|
||||
(settings.countWeight ? tagIntValue('weight') ?? 0 : 0) * amount;
|
||||
int get armor =>
|
||||
settings.countArmor && isWorn && equipped ? tagIntValue('armor') ?? 0 : 0;
|
||||
int get damage =>
|
||||
|
||||
@@ -12,7 +12,7 @@ class Monster extends dw.Monster implements WithMeta {
|
||||
required super.instinct,
|
||||
required super.tags,
|
||||
required super.moves,
|
||||
}) : _meta = meta;
|
||||
}) : _meta = meta;
|
||||
|
||||
@override
|
||||
Meta get meta => _meta;
|
||||
|
||||
@@ -189,4 +189,3 @@ mixin AuthProviderMixin {
|
||||
AuthProvider get authProvider =>
|
||||
AuthProvider.of(appGlobalKey.currentContext!);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,4 +49,3 @@ class IntlService extends ChangeNotifier {
|
||||
return _m[locale]!;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -479,4 +479,3 @@ mixin RepositoryProviderMixin {
|
||||
RepositoryProvider.of(appGlobalKey.currentContext!);
|
||||
RepositoryProvider get repository => repo;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ class UserProvider extends ChangeNotifier with RepositoryProviderMixin {
|
||||
}
|
||||
|
||||
Future<User?> _migrateUser(fba.User user) async {
|
||||
final migrationDetails = await Navigator.of(navigatorKey.currentContext!).pushNamed(
|
||||
final migrationDetails =
|
||||
await Navigator.of(navigatorKey.currentContext!).pushNamed(
|
||||
Routes.migration,
|
||||
arguments: MigrationArguments(email: user.email ?? ''),
|
||||
) as MigrationDetails?;
|
||||
@@ -249,4 +250,3 @@ mixin UserProviderMixin {
|
||||
UserProvider.of(appGlobalKey.currentContext!);
|
||||
User get user => userProvider.current;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,4 +173,3 @@ class CharacterUtils {
|
||||
CustomSnackBar.show(content: tr.actions.classActions.markXP.success);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,4 +102,3 @@ class AbilityScoreFormArguments {
|
||||
required this.onSave,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -79,4 +79,3 @@ class AbilityScoresFormArguments {
|
||||
required this.onChanged,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -180,4 +180,3 @@ class AbilityScoresFormView extends StatelessWidget {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -247,4 +247,3 @@ class _SocialButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,4 +74,3 @@ class AccountController extends ChangeNotifier
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,9 @@ class AccountView extends StatelessWidget {
|
||||
)
|
||||
: const Icon(Icons.image),
|
||||
enabled: !controller.uploading,
|
||||
onTap:
|
||||
!controller.uploading ? () => _uploadImage(controller, context) : null,
|
||||
onTap: !controller.uploading
|
||||
? () => _uploadImage(controller, context)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
() => Consumer<AccountController>(
|
||||
@@ -447,4 +448,3 @@ class _PasswordFieldDialogState extends State<PasswordFieldDialog> {
|
||||
return PasswordValidator().validator(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,4 +196,3 @@ class BasicInfoFormView extends StatelessWidget with UserProviderMixin {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class BondsFlagsFormController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
void removeBond(int index) {
|
||||
debugPrint('remove bond $index');
|
||||
debugPrint('remove bond $index');
|
||||
bonds.removeAt(index);
|
||||
bondsCtrls[index].removeListener(_setDirty);
|
||||
bondsCtrls.removeAt(index);
|
||||
@@ -115,4 +115,3 @@ class BondsFlagsFormArguments {
|
||||
required this.onChanged,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -54,4 +54,3 @@ class ChangelogController extends ChangeNotifier {
|
||||
currentVersion = version;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,4 +31,3 @@ class ChangelogEntry {
|
||||
return ChangelogEntry._(version, content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ class ChangelogView extends StatelessWidget {
|
||||
entry.version >= controller.currentVersion,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 32),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 32),
|
||||
child: SizedBox(
|
||||
width: 800,
|
||||
child: MarkdownBody(data: content),
|
||||
@@ -83,4 +84,3 @@ class ChangelogView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,4 +118,3 @@ class CharacterListPageView extends StatelessWidget with UserProviderMixin {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,4 +88,3 @@ class ClassAlignmentsArguments {
|
||||
this.preselected,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -86,4 +86,3 @@ class SelectMovesSpellsArguments {
|
||||
required this.characterClass,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -192,4 +192,3 @@ class SelectMovesSpellsView extends StatelessWidget {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ import 'package:dungeon_world_data/dungeon_world_data.dart' as dw;
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CreateCharacterController extends ChangeNotifier with RepositoryProviderMixin {
|
||||
class CreateCharacterController extends ChangeNotifier
|
||||
with RepositoryProviderMixin {
|
||||
var name = '';
|
||||
var avatarUrl = '';
|
||||
CharacterClass? characterClass;
|
||||
@@ -30,7 +31,8 @@ class CreateCharacterController extends ChangeNotifier with RepositoryProviderMi
|
||||
|
||||
var dirty = false;
|
||||
|
||||
static CreateCharacterController of(BuildContext context, {bool listen = false}) =>
|
||||
static CreateCharacterController of(BuildContext context,
|
||||
{bool listen = false}) =>
|
||||
Provider.of<CreateCharacterController>(context, listen: listen);
|
||||
static Widget consumer(
|
||||
Widget Function(BuildContext, CreateCharacterController, Widget?) builder,
|
||||
@@ -55,7 +57,7 @@ class CreateCharacterController extends ChangeNotifier with RepositoryProviderMi
|
||||
setDirty();
|
||||
}
|
||||
|
||||
void setClass( CharacterClass cls) {
|
||||
void setClass(CharacterClass cls) {
|
||||
characterClass = cls;
|
||||
setStartingGear(
|
||||
cls.gearChoices
|
||||
|
||||
@@ -434,4 +434,3 @@ class _Card extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -511,4 +511,3 @@ class ActionsCardList<T extends WithMeta> extends StatelessWidget
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -214,4 +214,3 @@ class HomeCharacterJournalView extends StatelessWidget
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -235,4 +235,3 @@ mixin HomeCharacterPaddingMixin {
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,4 +78,3 @@ class _HomeFABState extends State<HomeFAB> with CharacterProviderMixin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,8 @@ class _NavItem extends StatelessWidget {
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = theme.colorScheme;
|
||||
final selectedColor = colorScheme.secondary;
|
||||
final selectedFgColor = accessibleColorFor(theme.colorScheme.onSecondary, selectedColor);
|
||||
final selectedFgColor =
|
||||
accessibleColorFor(theme.colorScheme.onSecondary, selectedColor);
|
||||
final unselectedFgColor = theme.colorScheme.onSurface;
|
||||
const duration = Duration(milliseconds: 250);
|
||||
|
||||
@@ -152,4 +153,3 @@ class _NavItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,4 +38,3 @@ class HomeCharacterActionsFilters extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,4 +97,3 @@ class HomeCharacterActionsSummary extends StatelessWidget {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -538,4 +538,3 @@ class HomeCharacterDynamicCards extends StatelessWidget
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ class HomeCharacterHpExpView extends StatelessWidget {
|
||||
builder: (_) => const HPDialog(),
|
||||
),
|
||||
child: Tooltip(
|
||||
message: tr.hp.bar.tooltip(PlatformHelper.actionString(context)),
|
||||
message:
|
||||
tr.hp.bar.tooltip(PlatformHelper.actionString(context)),
|
||||
preferBelow: false,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
@@ -40,7 +41,8 @@ class HomeCharacterHpExpView extends StatelessWidget {
|
||||
builder: (_) => const EXPDialog(),
|
||||
),
|
||||
child: Tooltip(
|
||||
message: tr.xp.bar.tooltip(PlatformHelper.actionString(context)),
|
||||
message:
|
||||
tr.xp.bar.tooltip(PlatformHelper.actionString(context)),
|
||||
preferBelow: false,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
@@ -52,4 +54,3 @@ class HomeCharacterHpExpView extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,4 +173,3 @@ class ExportSelections {
|
||||
throw TypeError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,4 +292,3 @@ class ImportSelections {
|
||||
races,
|
||||
].any((l) => l.isNotEmpty);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,14 @@ import 'import_controller.dart';
|
||||
// TODO remove?
|
||||
class ImportExportController extends ChangeNotifier {
|
||||
void Function()? doExport(BuildContext context) {
|
||||
debugPrint('Exporting from controller');
|
||||
return Provider.of<ExportController>(context, listen: false).getDoExport(context);
|
||||
debugPrint('Exporting from controller');
|
||||
return Provider.of<ExportController>(context, listen: false)
|
||||
.getDoExport(context);
|
||||
}
|
||||
|
||||
void Function()? doImport(BuildContext context) =>
|
||||
Provider.of<ImportController>(context, listen: false).getDoImport(context);
|
||||
Provider.of<ImportController>(context, listen: false)
|
||||
.getDoImport(context);
|
||||
}
|
||||
|
||||
abstract class ImportExportSelectionData {
|
||||
|
||||
@@ -57,4 +57,3 @@ class ExportView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,4 +74,3 @@ class _ImportExportViewState extends State<ImportExportView>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,4 +67,3 @@ class ImportView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ class LibraryListController<T extends WithMeta, F extends EntityFilters<T>>
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
void setFilters(FiltersGroup group, F? filters) {
|
||||
this.filters[group] = filters;
|
||||
notifyListeners();
|
||||
@@ -228,4 +227,3 @@ abstract class LibraryListArguments<T extends WithMeta,
|
||||
FiltersGroup? initialTab = FiltersGroup.playbook,
|
||||
}) : initialTab = initialTab ?? FiltersGroup.playbook;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,4 +201,3 @@ class LibraryCardList<T extends WithMeta, F extends EntityFilters<T>>
|
||||
throw TypeError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,4 +109,3 @@ class LibraryCollectionView extends StatelessWidget
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,8 @@ class _LibraryListViewState<T extends WithMeta, F extends EntityFilters<T>>
|
||||
totalItemCount: controller.builtInListRaw.length,
|
||||
itemCount: controller.builtInList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = controller.builtInList.elementAt(index);
|
||||
final item =
|
||||
controller.builtInList.elementAt(index);
|
||||
return _wrapWithSelection(
|
||||
context, item, FiltersGroup.playbook);
|
||||
},
|
||||
@@ -280,4 +281,3 @@ class _LibraryListViewState<T extends WithMeta, F extends EntityFilters<T>>
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,4 +79,3 @@ class LibrarySelectButton<T> extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,4 +95,3 @@ class MoveLibraryListArguments extends LibraryListArguments<Move, MoveFilters> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,4 +125,3 @@ class LoginController extends ChangeNotifier with AuthProviderMixin {
|
||||
return _valid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,13 +157,14 @@ class LoginView extends StatelessWidget {
|
||||
final controller =
|
||||
Provider.of<LoginController>(context,
|
||||
listen: false);
|
||||
final res = PasswordValidator().validator(pwd) ??
|
||||
(pwd == controller.password.text
|
||||
? null
|
||||
: tr.auth.signup.password.confirm
|
||||
.error);
|
||||
debugPrint('pwd: $res');
|
||||
return res;
|
||||
final res =
|
||||
PasswordValidator().validator(pwd) ??
|
||||
(pwd == controller.password.text
|
||||
? null
|
||||
: tr.auth.signup.password.confirm
|
||||
.error);
|
||||
debugPrint('pwd: $res');
|
||||
return res;
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -238,4 +239,3 @@ class LoginView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ import 'package:dungeon_paper/app/data/services/character_provider.dart';
|
||||
import 'package:dungeon_paper/app/themes/themes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SelectCharacterThemeController extends ChangeNotifier with CharacterProviderMixin {
|
||||
class SelectCharacterThemeController extends ChangeNotifier
|
||||
with CharacterProviderMixin {
|
||||
final seeAll = {Brightness.light: false, Brightness.dark: false};
|
||||
int? lightTheme = AppThemes.parchment;
|
||||
int? darkTheme = AppThemes.dark;
|
||||
|
||||
@@ -111,4 +111,3 @@ class SelectCharacterThemeView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,4 +37,3 @@ class SendFeedbackController extends ChangeNotifier with UserProviderMixin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,4 +58,3 @@ class SettingsController extends ChangeNotifier
|
||||
return userProvider.updateUser(user.copyWith(settings: settings));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,4 +110,3 @@ class SettingsView extends StatelessWidget
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,4 +292,3 @@ class GearOptionData {
|
||||
amount.text = data.amount.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -343,4 +343,3 @@ class StartingGearEditFormView extends StatelessWidget
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,8 @@ class StartingGearFormView extends StatelessWidget {
|
||||
label: Text(tr.generic.save),
|
||||
icon: const Icon(Icons.save),
|
||||
),
|
||||
body:Align(
|
||||
body: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
|
||||
child: SizedBox(
|
||||
width: 800,
|
||||
child: ListView(
|
||||
@@ -105,4 +104,3 @@ class StartingGearFormView extends StatelessWidget {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -359,4 +359,3 @@ class AppPages {
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,8 @@ abstract class Routes {
|
||||
static const changelog = _Paths.changelog;
|
||||
|
||||
/// `/class/start-gear`
|
||||
static const createClassStartingGear = _Paths.characterClass + _Paths.startingGear;
|
||||
static const createClassStartingGear =
|
||||
_Paths.characterClass + _Paths.startingGear;
|
||||
}
|
||||
|
||||
abstract class _Paths {
|
||||
|
||||
@@ -87,4 +87,3 @@ class CircularRevealTransitionBuilder<T> extends PageRouteBuilder {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,8 +138,8 @@ ThemeData createTheme(
|
||||
checkboxTheme: base.checkboxTheme.copyWith(
|
||||
fillColor:
|
||||
WidgetStateProperty.resolveWith((states) => colorScheme.secondary),
|
||||
checkColor: WidgetStateProperty.resolveWith(
|
||||
(states) => colorScheme.onSecondary),
|
||||
checkColor:
|
||||
WidgetStateProperty.resolveWith((states) => colorScheme.onSecondary),
|
||||
),
|
||||
switchTheme: base.switchTheme.copyWith(
|
||||
thumbColor:
|
||||
@@ -206,4 +206,3 @@ Color accessibleColorFor(Color fg, Color bg) {
|
||||
}
|
||||
return fg;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,4 +84,3 @@ class _AlignmentValuesFieldState extends State<AlignmentValuesField> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,7 @@ class CustomExpansionTile extends StatefulWidget {
|
||||
this.minIconWidth = 20,
|
||||
this.reorderablePadding = false,
|
||||
this.controller,
|
||||
}) :
|
||||
assert(
|
||||
}) : assert(
|
||||
expandedCrossAxisAlignment != CrossAxisAlignment.baseline,
|
||||
'CrossAxisAlignment.baseline is not supported since the expanded children '
|
||||
'are aligned in a column, not a row. Try to use another constant.',
|
||||
@@ -112,8 +111,7 @@ class CustomExpansionTile extends StatefulWidget {
|
||||
this.minIconWidth = 20,
|
||||
this.reorderablePadding = false,
|
||||
this.controller,
|
||||
}) :
|
||||
assert(
|
||||
}) : assert(
|
||||
expandedCrossAxisAlignment != CrossAxisAlignment.baseline,
|
||||
'CrossAxisAlignment.baseline is not supported since the expanded children '
|
||||
'are aligned in a column, not a row. Try to use another constant.',
|
||||
@@ -261,7 +259,7 @@ class CustomExpansionTile extends StatefulWidget {
|
||||
final ListTileControlAffinity? controlAffinity;
|
||||
|
||||
final bool reorderablePadding;
|
||||
|
||||
|
||||
final CustomExpansionTileController? controller;
|
||||
|
||||
@override
|
||||
@@ -296,8 +294,10 @@ class _CustomExpansionTileState extends State<CustomExpansionTile>
|
||||
_animationController = AnimationController(duration: _kExpand, vsync: this);
|
||||
_heightFactor = _animationController.drive(_easeInTween);
|
||||
_iconTurns = _animationController.drive(_halfTween.chain(_easeInTween));
|
||||
_headerColor = _animationController.drive(_headerColorTween.chain(_easeInTween));
|
||||
_iconColor = _animationController.drive(_iconColorTween.chain(_easeOutTween));
|
||||
_headerColor =
|
||||
_animationController.drive(_headerColorTween.chain(_easeInTween));
|
||||
_iconColor =
|
||||
_animationController.drive(_iconColorTween.chain(_easeOutTween));
|
||||
|
||||
_isExpanded = PageStorage.of(context).readState(context) as bool? ??
|
||||
widget.initiallyExpanded;
|
||||
@@ -351,13 +351,18 @@ class _CustomExpansionTileState extends State<CustomExpansionTile>
|
||||
}
|
||||
|
||||
Widget? _buildLeadingIcon(BuildContext context) {
|
||||
if (!widget.expandable || _effectiveAffinity(widget.controlAffinity) != ListTileControlAffinity.leading) return null;
|
||||
if (!widget.expandable ||
|
||||
_effectiveAffinity(widget.controlAffinity) !=
|
||||
ListTileControlAffinity.leading) return null;
|
||||
return _buildIcon(context);
|
||||
}
|
||||
|
||||
Widget? _buildTrailingIcon(BuildContext context) {
|
||||
if (!widget.expandable || _effectiveAffinity(widget.controlAffinity) != ListTileControlAffinity.trailing) return null;
|
||||
if (widget.reorderablePadding && PlatformHelper.currentInteractionType == InteractionType.mouse) {
|
||||
if (!widget.expandable ||
|
||||
_effectiveAffinity(widget.controlAffinity) !=
|
||||
ListTileControlAffinity.trailing) return null;
|
||||
if (widget.reorderablePadding &&
|
||||
PlatformHelper.currentInteractionType == InteractionType.mouse) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 24),
|
||||
child: _buildIcon(context),
|
||||
|
||||
@@ -10,12 +10,13 @@ class CustomSnackBar extends SnackBar {
|
||||
|
||||
final String? title;
|
||||
|
||||
static Widget _getContent(
|
||||
String? title, String content) {
|
||||
static Widget _getContent(String? title, String content) {
|
||||
if (title != null && title.isNotEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(title, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
Text(title,
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
|
||||
Text(content),
|
||||
],
|
||||
);
|
||||
@@ -30,4 +31,3 @@ class CustomSnackBar extends SnackBar {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class DiceIcon extends StatelessWidget {
|
||||
super.key,
|
||||
this.size,
|
||||
this.color,
|
||||
}) : sides = dice.sides;
|
||||
}) : sides = dice.sides;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -14,4 +14,3 @@ class HelpTooltipIcon extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class LifecycleView extends StatefulWidget {
|
||||
this.onInit,
|
||||
this.onDispose,
|
||||
required this.builder,
|
||||
}) : child = null;
|
||||
}) : child = null;
|
||||
|
||||
static Widget Function(BuildContext context) childBuilder(Widget child) =>
|
||||
(_) => child;
|
||||
|
||||
@@ -180,7 +180,8 @@ class MenuButton<V> extends StatelessWidget {
|
||||
return PopupMenuItem<V>(
|
||||
value: entry.value,
|
||||
enabled: !entry.disabled,
|
||||
child: PopupMenuItemListTile(icon: entry.icon, label: entry.label),
|
||||
child:
|
||||
PopupMenuItemListTile(icon: entry.icon, label: entry.label),
|
||||
);
|
||||
} else {
|
||||
return e;
|
||||
|
||||
@@ -301,4 +301,3 @@ class NumberInputFormatter extends TextInputFormatter {
|
||||
return oldValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,8 @@ class RainbowText extends StatelessWidget {
|
||||
textDirection: textDirection,
|
||||
softWrap: softWrap,
|
||||
overflow: overflow,
|
||||
maxLines: maxLines, textScaler: TextScaler.linear(textScaleFactor),
|
||||
maxLines: maxLines,
|
||||
textScaler: TextScaler.linear(textScaleFactor),
|
||||
locale: locale,
|
||||
strutStyle: strutStyle,
|
||||
textWidthBasis: textWidthBasis,
|
||||
|
||||
@@ -637,8 +637,12 @@ class RichButton {
|
||||
[String? suffix, int? selectionStartOffset, int? selectionEndOffset]) {
|
||||
final isAuto = behavior == RichButtonTextBehavior.auto;
|
||||
final isWrap = behavior == RichButtonTextBehavior.wrap;
|
||||
final hasPrefix = isWrap || (prefix.isNotEmpty && isAuto) || behavior == RichButtonTextBehavior.prefix;
|
||||
final hasSuffix = isWrap || (suffix?.isNotEmpty == true && isAuto) || behavior == RichButtonTextBehavior.suffix;
|
||||
final hasPrefix = isWrap ||
|
||||
(prefix.isNotEmpty && isAuto) ||
|
||||
behavior == RichButtonTextBehavior.prefix;
|
||||
final hasSuffix = isWrap ||
|
||||
(suffix?.isNotEmpty == true && isAuto) ||
|
||||
behavior == RichButtonTextBehavior.suffix;
|
||||
suffix ??= prefix;
|
||||
// final shouldWrap = (isAuto && !controller.selection.isCollapsed)
|
||||
|
||||
@@ -670,4 +674,3 @@ class RichButton {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,4 +104,3 @@ class ExpBar extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,4 +88,3 @@ class CharacterClassCard extends StatelessWidget {
|
||||
].join('\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,4 +240,3 @@ class _DynamicActionCardState extends State<DynamicActionCard> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,4 +205,3 @@ class RectClipper extends CustomClipper<Rect> {
|
||||
oldClipper.size.width != size.width ||
|
||||
oldClipper.size.height != size.height;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,7 @@ class ItemCard extends StatelessWidget {
|
||||
numberType: NumberType.double,
|
||||
onChanged: (str) => onSave?.call(
|
||||
item.copyWithInherited(
|
||||
amount: double.tryParse(str) ??
|
||||
item.amount,
|
||||
amount: double.tryParse(str) ?? item.amount,
|
||||
),
|
||||
),
|
||||
controller: TextEditingController(
|
||||
@@ -127,4 +126,3 @@ class ItemCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,4 +101,3 @@ class AbilityScoreChip extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,4 +84,3 @@ class PrimaryChip extends StatelessWidget {
|
||||
extension on bool {
|
||||
int get cInt => this ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -464,4 +464,3 @@ extension on _XPAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -243,4 +243,3 @@ class CharacterClassFormArguments
|
||||
required super.formContext,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -122,4 +122,3 @@ class _EntityShareFormState<T extends WithMeta> extends State<EntityShareForm>
|
||||
widget.onChange(Meta.forkMeta(source!, user));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,12 @@ class LibraryEntityForm<
|
||||
),
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: 800,
|
||||
width: 800,
|
||||
child: ItemBuilder.lazyListView(
|
||||
padding: const EdgeInsets.all(16).copyWith(bottom: 80),
|
||||
children:
|
||||
children.joinObjects(() => const SizedBox(height: 16)).toList(),
|
||||
children: children
|
||||
.joinObjects(() => const SizedBox(height: 16))
|
||||
.toList(),
|
||||
// trailing: [
|
||||
// () => const Divider(height: 64),
|
||||
// () => EntityShareForm(
|
||||
@@ -73,6 +74,7 @@ abstract class LibraryEntityFormController<T extends WithMeta,
|
||||
var dirty = false;
|
||||
late final Args args;
|
||||
bool afterInit = false;
|
||||
|
||||
/// Creates listeners for each field and sets the initial value cache.
|
||||
List<ValueNotifier> get fields;
|
||||
late Meta meta;
|
||||
@@ -172,4 +174,3 @@ class LibraryEntityFormArguments<T extends WithMeta> {
|
||||
required this.formContext,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -127,4 +127,3 @@ class NoteFormArguments extends LibraryEntityFormArguments<Note> {
|
||||
required super.formContext,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -110,4 +110,3 @@ class _DiceListInputState extends State<DiceListInput> {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ import 'package:provider/provider.dart';
|
||||
import '../atoms/character_avatar.dart';
|
||||
import '../atoms/user_avatar.dart';
|
||||
|
||||
class UserMenuPopover extends StatelessWidget with CharacterProviderMixin, UserProviderMixin {
|
||||
class UserMenuPopover extends StatelessWidget
|
||||
with CharacterProviderMixin, UserProviderMixin {
|
||||
const UserMenuPopover({super.key});
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
|
||||
class ApiBase {
|
||||
final String baseUrl;
|
||||
|
||||
@@ -52,4 +51,3 @@ class Response extends http.Response {
|
||||
|
||||
Map<String, dynamic> get json => jsonDecode(body);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,4 +259,3 @@ class PlatformHelper {
|
||||
return android!;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,4 +175,3 @@ class StorageHandler implements StorageDelegate {
|
||||
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,4 +33,3 @@ class ColorUtils {
|
||||
return lighten(original, -amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,11 +158,9 @@ List<T> upsertByKey<T>(List<T> list, Iterable<T> items,
|
||||
final existingKeys = list.map(keyGetter);
|
||||
|
||||
return [
|
||||
...list
|
||||
.map((x) => keys.contains(keyGetter(x))
|
||||
? items.firstWhere((y) => keyGetter(x) == keyGetter(y))
|
||||
: x)
|
||||
,
|
||||
...list.map((x) => keys.contains(keyGetter(x))
|
||||
? items.firstWhere((y) => keyGetter(x) == keyGetter(y))
|
||||
: x),
|
||||
...items.where((x) {
|
||||
return !existingKeys.contains(keyGetter(x));
|
||||
})
|
||||
|
||||
@@ -2,6 +2,5 @@ part of 'secrets_base.dart';
|
||||
|
||||
class Secrets extends SecretsBase {
|
||||
@override
|
||||
final String sentryDsn =
|
||||
'';
|
||||
final String sentryDsn = '';
|
||||
}
|
||||
|
||||
@@ -131,4 +131,3 @@ Future<UploadResponse?> cropAndUploadPhoto(
|
||||
downloadURL: downloadURL,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,4 +97,3 @@ class DungeonPaperApp extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user