mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: more params of editor page
This commit is contained in:
@@ -6,4 +6,6 @@ extension ContextX on BuildContext {
|
||||
}
|
||||
|
||||
bool get canPop => Navigator.of(this).canPop();
|
||||
|
||||
bool get isDark => Theme.of(this).brightness == Brightness.dark;
|
||||
}
|
||||
@@ -156,8 +156,22 @@ class AppRoute {
|
||||
return AppRoute(DockerManagePage(key: key, spi: spi), 'docker');
|
||||
}
|
||||
|
||||
static AppRoute editor({Key? key, required String path}) {
|
||||
return AppRoute(EditorPage(key: key, path: path), 'editor');
|
||||
/// - Pop true if the text is changed & [path] is not null
|
||||
/// - Pop text if [path] is null
|
||||
static AppRoute editor({
|
||||
Key? key,
|
||||
String? path,
|
||||
String? text,
|
||||
String? langCode,
|
||||
}) {
|
||||
return AppRoute(
|
||||
EditorPage(
|
||||
key: key,
|
||||
path: path,
|
||||
text: text,
|
||||
langCode: langCode,
|
||||
),
|
||||
'editor');
|
||||
}
|
||||
|
||||
static AppRoute fullscreen({Key? key}) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:r_upgrade/r_upgrade.dart';
|
||||
import 'package:toolbox/core/extension/navigator.dart';
|
||||
import 'package:toolbox/core/extension/context.dart';
|
||||
import 'package:toolbox/core/utils/misc.dart' hide pathJoin;
|
||||
import 'package:toolbox/data/model/app/update.dart';
|
||||
import 'package:toolbox/data/res/path.dart';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:toolbox/core/extension/navigator.dart';
|
||||
import 'package:toolbox/core/extension/context.dart';
|
||||
import 'package:toolbox/data/model/app/tab.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@@ -19,9 +19,6 @@ import 'platform.dart';
|
||||
import '../extension/stringx.dart';
|
||||
import '../extension/uint8list.dart';
|
||||
|
||||
bool isDarkMode(BuildContext context) =>
|
||||
Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
void showSnackBar(BuildContext context, Widget child) =>
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: child,
|
||||
|
||||
Reference in New Issue
Block a user