new change to use intaleq_map sdk 04-16-4
This commit is contained in:
9
packages/get/lib/get_core/get_core.dart
Normal file
9
packages/get/lib/get_core/get_core.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
library get_core;
|
||||
|
||||
export 'src/get_interface.dart';
|
||||
export 'src/get_main.dart';
|
||||
export 'src/log.dart';
|
||||
export 'src/smart_management.dart';
|
||||
export 'src/typedefs.dart';
|
||||
|
||||
T? ambiguate<T>(T? value) => value;
|
||||
15
packages/get/lib/get_core/src/get_interface.dart
Normal file
15
packages/get/lib/get_core/src/get_interface.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'log.dart';
|
||||
import 'smart_management.dart';
|
||||
|
||||
/// GetInterface allows any auxiliary package to be merged into the "Get"
|
||||
/// class through extensions
|
||||
abstract class GetInterface {
|
||||
SmartManagement smartManagement = SmartManagement.full;
|
||||
RouterDelegate? routerDelegate;
|
||||
RouteInformationParser? routeInformationParser;
|
||||
bool isLogEnable = kDebugMode;
|
||||
LogWriterCallback log = defaultLogWriterCallback;
|
||||
}
|
||||
12
packages/get/lib/get_core/src/get_main.dart
Normal file
12
packages/get/lib/get_core/src/get_main.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'get_interface.dart';
|
||||
|
||||
///Use to instead of Navigator.push, off instead of Navigator.pushReplacement,
|
||||
///offAll instead of Navigator.pushAndRemoveUntil. For named routes just
|
||||
///add "named" after them. Example: toNamed, offNamed, and AllNamed.
|
||||
///To return to the previous screen, use back().
|
||||
///No need to pass any context to Get, just put the name of the route inside
|
||||
///the parentheses and the magic will occur.
|
||||
class _GetImpl extends GetInterface {}
|
||||
|
||||
// ignore: non_constant_identifier_names
|
||||
final Get = _GetImpl();
|
||||
10
packages/get/lib/get_core/src/log.dart
Normal file
10
packages/get/lib/get_core/src/log.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'dart:developer' as developer;
|
||||
import 'get_main.dart';
|
||||
|
||||
///VoidCallback from logs
|
||||
typedef LogWriterCallback = void Function(String text, {bool isError});
|
||||
|
||||
/// default logger from GetX
|
||||
void defaultLogWriterCallback(String value, {bool isError = false}) {
|
||||
if (isError || Get.isLogEnable) developer.log(value, name: 'GETX');
|
||||
}
|
||||
22
packages/get/lib/get_core/src/smart_management.dart
Normal file
22
packages/get/lib/get_core/src/smart_management.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
/// GetX by default disposes unused controllers from memory,
|
||||
/// Through different behaviors.
|
||||
/// SmartManagement.full
|
||||
/// [SmartManagement.full] is the default one. Dispose classes that are
|
||||
/// not being used and were not set to be permanent. In the majority
|
||||
/// of the cases you will want to keep this config untouched.
|
||||
/// If you new to GetX then don't change this.
|
||||
/// [SmartManagement.onlyBuilder] only controllers started in init:
|
||||
/// or loaded into a Binding with Get.lazyPut() will be disposed. If you use
|
||||
/// Get.put() or Get.putAsync() or any other approach, SmartManagement
|
||||
/// will not have permissions to exclude this dependency. With the default
|
||||
/// behavior, even widgets instantiated with "Get.put" will be removed,
|
||||
/// unlike SmartManagement.onlyBuilders.
|
||||
/// [SmartManagement.keepFactory]Just like SmartManagement.full,
|
||||
/// it will remove it's dependencies when it's not being used anymore.
|
||||
/// However, it will keep their factory, which means it will recreate
|
||||
/// the dependency if you need that instance again.
|
||||
enum SmartManagement {
|
||||
full,
|
||||
onlyBuilder,
|
||||
keepFactory,
|
||||
}
|
||||
1
packages/get/lib/get_core/src/typedefs.dart
Normal file
1
packages/get/lib/get_core/src/typedefs.dart
Normal file
@@ -0,0 +1 @@
|
||||
typedef ValueUpdater<T> = T Function();
|
||||
Reference in New Issue
Block a user