mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make const available for classes that override AssetBundle (#31807)
This commit is contained in:
parent
9937d3dfb1
commit
eae67f05df
@ -5,7 +5,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:args/args.dart';
|
||||
import 'package:flutter_tools/src/asset.dart';
|
||||
import 'package:flutter_tools/src/asset.dart' hide defaultManifestPath;
|
||||
import 'package:flutter_tools/src/base/context.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart' as libfs;
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
|
||||
@ -20,6 +20,8 @@ import 'globals.dart';
|
||||
|
||||
const AssetBundleFactory _kManifestFactory = _ManifestAssetBundleFactory();
|
||||
|
||||
const String defaultManifestPath = 'pubspec.yaml';
|
||||
|
||||
/// Injected factory class for spawning [AssetBundle] instances.
|
||||
abstract class AssetBundleFactory {
|
||||
/// The singleton instance, pulled from the [AppContext].
|
||||
@ -36,11 +38,11 @@ abstract class AssetBundle {
|
||||
|
||||
bool wasBuiltOnce();
|
||||
|
||||
bool needsBuild({ String manifestPath = _ManifestAssetBundle.defaultManifestPath });
|
||||
bool needsBuild({ String manifestPath = defaultManifestPath });
|
||||
|
||||
/// Returns 0 for success; non-zero for failure.
|
||||
Future<int> build({
|
||||
String manifestPath = _ManifestAssetBundle.defaultManifestPath,
|
||||
String manifestPath = defaultManifestPath,
|
||||
String assetDirPath,
|
||||
String packagesPath,
|
||||
bool includeDefaultFonts = true,
|
||||
@ -69,7 +71,6 @@ class _ManifestAssetBundle implements AssetBundle {
|
||||
|
||||
DateTime _lastBuildTimestamp;
|
||||
|
||||
static const String defaultManifestPath = 'pubspec.yaml';
|
||||
static const String _assetManifestJson = 'AssetManifest.json';
|
||||
static const String _fontManifestJson = 'FontManifest.json';
|
||||
static const String _fontSetMaterial = 'material';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user