2025-02-09 18:39:38 +08:00
|
|
|
import 'package:fl_clash/models/models.dart';
|
|
|
|
|
import 'package:fl_clash/state.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
|
|
class CommonPrint {
|
|
|
|
|
static CommonPrint? _instance;
|
|
|
|
|
|
|
|
|
|
CommonPrint._internal();
|
|
|
|
|
|
|
|
|
|
factory CommonPrint() {
|
|
|
|
|
_instance ??= CommonPrint._internal();
|
|
|
|
|
return _instance!;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log(String? text) {
|
|
|
|
|
final payload = "[FlClash] $text";
|
|
|
|
|
debugPrint(payload);
|
2025-05-02 02:24:12 +08:00
|
|
|
if (!globalState.isInit) {
|
2025-02-09 18:39:38 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
globalState.appController.addLog(
|
2025-04-18 17:50:46 +08:00
|
|
|
Log.app(payload),
|
2025-02-09 18:39:38 +08:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final commonPrint = CommonPrint();
|