hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
290 stars 24 forks source link

Flutter: GetX - Source Code Analysis #295

Open hhstore opened 3 years ago

hhstore commented 3 years ago

related:

hhstore commented 3 years ago

GetX 源码分析:

hhstore commented 3 years ago

GetX 一些模块:

GetInterface:


import 'package:flutter/widgets.dart';
import '../../get_navigation/src/nav2/get_router_delegate.dart';
import '../../get_navigation/src/routes/get_route.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;
  String? reference;
  bool isLogEnable = true;
  LogWriterCallback log = defaultLogWriterCallback;
}
import 'get_interface.dart';

class _GetImpl extends GetInterface {}

final Get = _GetImpl();