mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-08 01:43:13 +00:00
dd81053f42
rewrote OnboardingPage: * decomposed into separate widgets * now content stays centered on wide screens (set so width won't expand further than 480px) * pageController is now properly disposed * added some more code changes to * main (error widget builder) * brand_header (centerTitle instead of empty actions list) * console_page (listener callback fix, used gaps instead of SizedBox'es, added keys to list items) * service_page (just cleaner build method) * removed some dead code Co-authored-by: Aliaksei Tratseuski <aliaksei.tratseuski@gmail.com> Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/444 Co-authored-by: aliaksei tratseuski <misterfourtytwo@noreply.git.selfprivacy.org> Co-committed-by: aliaksei tratseuski <misterfourtytwo@noreply.git.selfprivacy.org>
20 lines
641 B
Dart
20 lines
641 B
Dart
import 'package:intl/intl.dart';
|
|
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
|
|
|
/// it's ui helpers use only for ui components, don't use for logic components.
|
|
|
|
class UiHelpers {
|
|
static String getDomainName(final ServerInstallationState config) =>
|
|
config.isDomainSelected ? config.serverDomain!.domainName : 'example.com';
|
|
|
|
static final _formatter = NumberFormat()..minimumFractionDigits = 0;
|
|
|
|
static String formatWithPrecision(
|
|
final double value, {
|
|
final int fraction = 2,
|
|
}) {
|
|
_formatter.maximumFractionDigits = fraction;
|
|
return _formatter.format(value);
|
|
}
|
|
}
|