Skip to content

Commit

Permalink
+refactor: Rename AppScale to Scalable
Browse files Browse the repository at this point in the history
  • Loading branch information
robmllze committed Sep 27, 2024
1 parent 4e6b282 commit e9f24b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/src/_index.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//.title~

// --- PUBLIC FILES ---
export 'scalable_app.dart';
export 'scalable.dart';
export 'sc.dart';
export 'sc_on_num_extension.dart';

Expand Down
4 changes: 2 additions & 2 deletions lib/src/sc_on_num_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//.title~

import 'scalable_app.dart';
import 'scalable.dart';

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

extension ScOnNumExtension on num {
/// Multiples the num with the current app scale.
// ignore: invalid_use_of_protected_member
double get sc => this * (AppScale.di.getSyncOrNull() ?? 1.0);
double get sc => this * (Scalable.di.getSyncOrNull() ?? 1.0);
}
16 changes: 7 additions & 9 deletions lib/src/scalable_app.dart → lib/src/scalable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//.title~

import 'dart:async';

import 'package:df_di/df_di.dart';
import 'package:df_pod/df_pod.dart';
import 'package:flutter/widgets.dart';
import 'dart:async' show FutureOr;
import 'package:df_di/df_di.dart' show DI;
import 'package:df_pod/df_pod.dart' show SharedDoublePodCreator, TSharedGlobalDoublePod;
import 'package:flutter/foundation.dart' show protected;

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

final class AppScale {
AppScale._();
final class Scalable {
Scalable._();
@protected
static final di = DI();
static final Future<TSharedGlobalDoublePod> _pValue =
SharedDoublePodCreator.global('<AppScale.pValue>')
.then((e) => di.register<TSharedGlobalDoublePod>(_pValue));
static FutureOr<TSharedGlobalDoublePod> get pAppScale =>
di.until<TSharedGlobalDoublePod>();
static FutureOr<TSharedGlobalDoublePod> get pScalable => di.until<TSharedGlobalDoublePod>();
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

name: df_scalable
description: A package that provides a convenient method to scale your app UI up or down.
version: 0.3.0
version: 0.4.0
repository: https://github.com/robmllze/df_scalable
funding:
- https://www.buymeacoffee.com/robmllze
Expand Down

0 comments on commit e9f24b4

Please sign in to comment.