phase3: nullable fields/methods, casts, ?.call, pinput/YoutubePlayer v5, buttonColor, dead-code removal. 72->16
This commit is contained in:
@@ -40,7 +40,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
late String accessToken;
|
||||
|
||||
late bool isLoading;
|
||||
late User _user;
|
||||
User? _user;
|
||||
|
||||
late ShopScrollCoordinator _shopCoordinator;
|
||||
late ShopScrollController _pageScrollController;
|
||||
@@ -88,9 +88,9 @@ class MobileMeState extends State<MobileMe> {
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.0),
|
||||
child: _user != null && _user.avatarUrl!.isNotEmpty
|
||||
child: _user != null && _user!.avatarUrl!.isNotEmpty
|
||||
? Util.showImage(
|
||||
'https:${_user.avatarUrl}',
|
||||
'https:${_user!.avatarUrl}',
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.fill,
|
||||
@@ -116,7 +116,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
Container(
|
||||
child: Text(
|
||||
_user != null
|
||||
? _user.nickname
|
||||
? _user!.nickname!
|
||||
: S.of(context).please_login,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
@@ -142,7 +142,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
Container(
|
||||
child: Text(
|
||||
_user != null
|
||||
? Utils.safePhoneNumber(_user.mobile!)
|
||||
? Utils.safePhoneNumber(_user!.mobile!)
|
||||
: '',
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -219,7 +219,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
Container(
|
||||
child: Text(
|
||||
_user != null
|
||||
? '${_user.wallet!.toStringAsFixed(2)}'
|
||||
? '${_user!.wallet!.toStringAsFixed(2)}'
|
||||
: '0.00',
|
||||
style: TextStyle(
|
||||
fontSize: 24.0,
|
||||
@@ -262,7 +262,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Text(
|
||||
_user != null ? '${_user.coupon}' : '0',
|
||||
_user != null ? '${_user!.coupon}' : '0',
|
||||
style: TextStyle(
|
||||
fontSize: 24.0,
|
||||
color: Colors.orangeAccent,
|
||||
@@ -296,7 +296,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
onTap: () {
|
||||
if (_user != null) {
|
||||
Routes.router
|
||||
.navigateTo(context, '/coupons/${_user.id}');
|
||||
.navigateTo(context, '/coupons/${_user!.id}');
|
||||
} else {
|
||||
_pleaseLoginToast();
|
||||
}
|
||||
@@ -312,7 +312,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Text(
|
||||
_user != null ? '${_user.points}' : '0',
|
||||
_user != null ? '${_user!.points}' : '0',
|
||||
style: TextStyle(
|
||||
fontSize: 24.0,
|
||||
color: Colors.lightGreen,
|
||||
@@ -671,7 +671,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
),
|
||||
onTap: () {
|
||||
if (_user != null) {
|
||||
if (_user.email == null || _user.email!.isEmpty) {
|
||||
if (_user!.email == null || _user!.email!.isEmpty) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user