NullSafety: Migrate more Ui widgets

This commit is contained in:
Neeraj Gupta 2022-12-27 17:53:25 +05:30
parent 96483358e8
commit 570d0120c2
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
4 changed files with 15 additions and 23 deletions

View file

@ -1,5 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:photos/core/event_bus.dart';
import 'package:photos/events/subscription_purchased_event.dart';
@ -10,8 +8,8 @@ import 'package:photos/ui/home_widget.dart';
class SkipSubscriptionWidget extends StatelessWidget {
const SkipSubscriptionWidget({
Key key,
@required this.freePlan,
Key? key,
required this.freePlan,
}) : super(key: key);
final FreePlan freePlan;
@ -24,10 +22,10 @@ class SkipSubscriptionWidget extends StatelessWidget {
margin: const EdgeInsets.fromLTRB(0, 30, 0, 0),
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
child: OutlinedButton(
style: Theme.of(context).outlinedButtonTheme.style.copyWith(
style: Theme.of(context).outlinedButtonTheme.style?.copyWith(
textStyle: MaterialStateProperty.resolveWith<TextStyle>(
(Set<MaterialState> states) {
return Theme.of(context).textTheme.subtitle1;
return Theme.of(context).textTheme.subtitle1!;
},
),
),

View file

@ -1,5 +1,3 @@
// @dart=2.9
import 'package:flutter/cupertino.dart';
import 'package:photos/core/configuration.dart';
import 'package:photos/services/feature_flag_service.dart';
@ -24,5 +22,5 @@ StatefulWidget getSubscriptionPage({bool isOnBoarding = false}) {
// users who might have paid via playStore. This method should be removed once
// we have better handling for active play/app store subscription & stripe plans.
bool _isUserCreatedPostStripeSupport() {
return Configuration.instance.getUserID() > 1580559962386460;
return Configuration.instance.getUserID()! > 1580559962386460;
}

View file

@ -1,5 +1,3 @@
// @dart=2.9
import 'package:collection/collection.dart';
import 'package:fast_base58/fast_base58.dart';
import 'package:flutter/material.dart';
@ -25,14 +23,14 @@ import 'package:photos/utils/toast_util.dart';
class ShareCollectionPage extends StatefulWidget {
final Collection collection;
const ShareCollectionPage(this.collection, {Key key}) : super(key: key);
const ShareCollectionPage(this.collection, {Key? key}) : super(key: key);
@override
State<ShareCollectionPage> createState() => _ShareCollectionPageState();
}
class _ShareCollectionPageState extends State<ShareCollectionPage> {
List<User> _sharees;
late List<User?> _sharees;
final Logger _logger = Logger("SharingDialogState");
final CollectionActions collectionActions =
CollectionActions(CollectionsService.instance);
@ -132,7 +130,7 @@ class _ShareCollectionPageState extends State<ShareCollectionPage> {
CollectionsService.instance.getCollectionKey(widget.collection.id),
);
final String url =
"${widget.collection.publicURLs.first.url}#$collectionKey";
"${widget.collection.publicURLs!.first!.url}#$collectionKey";
children.addAll(
[
MenuItemWidget(
@ -235,8 +233,8 @@ class _ShareCollectionPageState extends State<ShareCollectionPage> {
return Scaffold(
appBar: AppBar(
title: Text(
widget.collection.name,
style: Theme.of(context).textTheme.headline5.copyWith(fontSize: 16),
widget.collection.name ?? "Unnamed",
style: Theme.of(context).textTheme.headline5?.copyWith(fontSize: 16),
),
elevation: 0,
centerTitle: false,
@ -260,12 +258,12 @@ class _ShareCollectionPageState extends State<ShareCollectionPage> {
class EmailItemWidget extends StatelessWidget {
final Collection collection;
final Function onTap;
final Function? onTap;
const EmailItemWidget(
this.collection, {
this.onTap,
Key key,
Key? key,
}) : super(key: key);
@override
@ -291,7 +289,7 @@ class EmailItemWidget extends StatelessWidget {
trailingIcon: Icons.chevron_right,
onTap: () async {
if (onTap != null) {
onTap();
onTap!();
}
},
isBottomBorderRadiusRemoved: true,
@ -317,7 +315,7 @@ class EmailItemWidget extends StatelessWidget {
trailingIcon: Icons.chevron_right,
onTap: () async {
if (onTap != null) {
onTap();
onTap!();
}
},
isBottomBorderRadiusRemoved: true,

View file

@ -1,10 +1,8 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:photos/ente_theme_data.dart';
class NoResultWidget extends StatelessWidget {
const NoResultWidget({Key key}) : super(key: key);
const NoResultWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {