forked from lichess-org/mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.dart
More file actions
80 lines (59 loc) · 2.47 KB
/
constants.dart
File metadata and controls
80 lines (59 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
const kLichessHost = String.fromEnvironment('LICHESS_HOST', defaultValue: 'lichess.dev');
const kLichessWSHost = String.fromEnvironment(
'LICHESS_WS_HOST',
defaultValue: 'socket.lichess.dev',
);
const kLichessWSSecret = String.fromEnvironment(
'LICHESS_WS_SECRET',
defaultValue: 'somethingElseInProd',
);
const kLichessCDNHost = String.fromEnvironment(
'LICHESS_CDN_HOST',
defaultValue: 'https://lichess1.org',
);
const kLichessOpeningExplorerHost = String.fromEnvironment(
'LICHESS_OPENING_EXPLORER_HOST',
defaultValue: 'explorer.lichess.org',
);
const kLichessTablebaseHost = String.fromEnvironment(
'LICHESS_TABLEBASE_HOST',
defaultValue: 'tablebase.lichess.org',
);
const kLichessDevUser = String.fromEnvironment('LICHESS_DEV_USER', defaultValue: 'lichess');
const kLichessDevPassword = String.fromEnvironment('LICHESS_DEV_PASSWORD');
const kLichessClientId = 'lichess_mobile';
const kSRIStorageKey = 'socket_random_identifier';
// lichess
// https://github.com/lichess-org/lila/blob/4562a83cdb263c3ebf7e148c0f666f0ff92b91c7/modules/rating/src/main/Glicko.scala#L71
const kProvisionalDeviation = 110;
const kClueLessDeviation = 230;
// UI
const double kCupertinoBarBlurSigma = 30.0;
const double kCupertinoBarOpacity = 0.8;
const kDefaultSeedColor = Color.fromARGB(255, 191, 128, 29);
const kGoldenRatio = 1.61803398875;
/// Flex golden ratio base (flex has to be an int).
const kFlexGoldenRatioBase = 100000000000;
/// Flex golden ratio (flex has to be an int).
const kFlexGoldenRatio = 161803398875;
/// Use same box shadows as material widgets with elevation 1.
final List<BoxShadow> boardShadows = defaultTargetPlatform == TargetPlatform.iOS
? <BoxShadow>[]
: kElevationToShadow[1]!;
const kMaxClockTextScaleFactor = 1.94;
const kEmptyWidget = SizedBox.shrink();
const kTabletBoardTableSidePadding = 16.0;
/// In crazyhouse, when displaying pockets above/below the board, add this much additional side padding to make the board smaller and avoid overflows.
const kAdditionalBoardSidePaddingForPockets = 70.0;
const kBottomBarHeight = 56.0;
const kMaterialPopupMenuMaxWidth = 500.0;
/// The threshold to detect screens with a small remaining height minus board.
const kSmallHeightMinusBoard = 170;
// annotations
class _AllowedWidgetReturn {
const _AllowedWidgetReturn();
}
/// Use to annotate a function that is allowed to return a Widget
const allowedWidgetReturn = _AllowedWidgetReturn();