diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/view/src/source/layout.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/view/src/source/layout.dart')
| -rw-r--r-- | lib/view/src/source/layout.dart | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/view/src/source/layout.dart b/lib/view/src/source/layout.dart new file mode 100644 index 0000000..bb17e11 --- /dev/null +++ b/lib/view/src/source/layout.dart @@ -0,0 +1,23 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraTileLayoutView on TileLayout { + String getName(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + TileLayout.mosaic => l10n.tileLayoutMosaic, + TileLayout.grid => l10n.tileLayoutGrid, + TileLayout.list => l10n.tileLayoutList, + }; + } + + IconData get icon { + return switch (this) { + TileLayout.mosaic => AIcons.layoutMosaic, + TileLayout.grid => AIcons.layoutGrid, + TileLayout.list => AIcons.layoutList, + }; + } +} |
