-
Notifications
You must be signed in to change notification settings - Fork 192
/
cities_style.dart
50 lines (46 loc) · 1.31 KB
/
cities_style.dart
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
import 'package:flutter/material.dart';
// 公共的基本样式
class BaseStyle {
double fontSize;
Color color;
Color? activeColor;
Color? backgroundColor;
double? height;
Color? backgroundActiveColor;
BaseStyle({
required this.color,
required this.fontSize,
this.height,
this.activeColor,
this.backgroundActiveColor,
this.backgroundColor,
});
BaseStyle copyWith({
double? fontSize,
Color? color,
double? height,
Color? activeColor,
Color? backgroundColor,
Color? backgroundActiveColor,
}) {
// print("copyWidth >>> fontSize: ${fontSize ?? this.fontSize}");
return BaseStyle(
fontSize: fontSize ?? this.fontSize,
color: color ?? this.color,
height: height ?? this.height,
activeColor: activeColor ?? this.activeColor,
backgroundColor: backgroundColor ?? this.backgroundColor,
backgroundActiveColor:
backgroundActiveColor ?? this.backgroundActiveColor);
}
BaseStyle merge(BaseStyle? other) {
if (other == null) return this;
return copyWith(
fontSize: other.fontSize,
color: other.color,
height: other.height,
activeColor: other.activeColor,
backgroundColor: other.backgroundColor,
backgroundActiveColor: other.backgroundActiveColor);
}
}