miler map
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:miler/views/helpers/constants/Font_constant.dart';
|
||||
@@ -21,23 +20,19 @@ import 'package:miler/views/helpers/constants/Font_constant.dart';
|
||||
/// binding does not resolve at all, and every icon on Activity came out as a
|
||||
/// hollow square. One loader, so the next family added to the app is added
|
||||
/// here rather than in five harnesses that will drift apart.
|
||||
///
|
||||
/// ── Load the family the app actually reads ──
|
||||
///
|
||||
/// This registers `FontConstants.fontFamily`, so it must be fed that family's
|
||||
/// files. When the app moved off Poppins and back to Manrope, the loader still
|
||||
/// pointed at `assets/fonts/Poppins/*` — which does not fail, it registers the
|
||||
/// wrong glyphs under the right name and every reference shot becomes a
|
||||
/// picture of a typeface the app does not ship. Manrope is a single variable
|
||||
/// font, so one file covers the whole weight axis.
|
||||
Future<void> loadGoldenFonts() async {
|
||||
final poppins = FontLoader(FontConstants.fontFamily);
|
||||
for (final e in const <(String, FontWeight)>[
|
||||
('Light', FontWeight.w300),
|
||||
('Regular', FontWeight.w400),
|
||||
('Medium', FontWeight.w500),
|
||||
('SemiBold', FontWeight.w600),
|
||||
('Bold', FontWeight.w700),
|
||||
('ExtraBold', FontWeight.w800),
|
||||
('Black', FontWeight.w900),
|
||||
]) {
|
||||
final f = File('assets/fonts/Poppins/Poppins-${e.$1}.ttf');
|
||||
if (f.existsSync()) {
|
||||
poppins.addFont(f.readAsBytes().then((b) => ByteData.view(b.buffer)));
|
||||
}
|
||||
}
|
||||
await poppins.load();
|
||||
await _loadIfPresent(FontConstants.fontFamily, const [
|
||||
'assets/fonts/Manrope/Manrope-VF.ttf',
|
||||
]);
|
||||
|
||||
await _loadIfPresent('MaterialIcons', const [
|
||||
'/opt/homebrew/share/flutter/bin/cache/artifacts/material_fonts/'
|
||||
|
||||
Reference in New Issue
Block a user