Bläddra i källkod

address review comments

Neeraj Gupta 3 år sedan
förälder
incheckning
b5a5e5988d
2 ändrade filer med 9 tillägg och 8 borttagningar
  1. 2 2
      lib/ui/change_collection_name_dialog.dart
  2. 7 6
      lib/ui/gallery_app_bar_widget.dart

+ 2 - 2
lib/ui/change_collection_name_dialog.dart

@@ -28,7 +28,7 @@ class _ChangeCollectionNameDialogState
   @override
   Widget build(BuildContext context) {
     return AlertDialog(
-      title: Text("enter new album name"),
+      title: Text("enter a new name"),
       content: SingleChildScrollView(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.start,
@@ -81,7 +81,7 @@ class _ChangeCollectionNameDialogState
               return;
             }
             if (_newCollectionName.trim().length > 100) {
-              showErrorDialog(context, "too large",
+              showErrorDialog(context, "name too large",
                   "album name should be less than 100 characters");
               return;
             }

+ 7 - 6
lib/ui/gallery_app_bar_widget.dart

@@ -57,7 +57,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
   final _logger = Logger("GalleryAppBar");
   StreamSubscription _userAuthEventSubscription;
   Function() _selectedFilesListener;
-  String appBarTitle;
+  String _appBarTitle;
 
   @override
   void initState() {
@@ -69,7 +69,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
         Bus.instance.on<SubscriptionPurchasedEvent>().listen((event) {
       setState(() {});
     });
-    appBarTitle = widget.title;
+    _appBarTitle = widget.title;
     super.initState();
   }
 
@@ -92,7 +92,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
             ? Container()
             : TextButton(
                 child: Text(
-                  appBarTitle,
+                  _appBarTitle,
                   style: TextStyle(
                     color: Colors.white.withOpacity(0.80),
                   ),
@@ -119,13 +119,14 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
     if (widget.type != GalleryAppBarType.owned_collection) {
       return;
     }
-    var result = await showDialog(
+    final result = await showDialog(
       context: context,
       builder: (BuildContext context) {
-        return ChangeCollectionNameDialog(name: appBarTitle);
+        return ChangeCollectionNameDialog(name: _appBarTitle);
       },
       barrierColor: Colors.black.withOpacity(0.85),
     );
+    // indicates user cancelled the rename request
     if (result == null) {
       return;
     }
@@ -137,7 +138,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
           .rename(widget.collection, result);
       await dialog.hide();
       if (mounted) {
-        appBarTitle = result;
+        _appBarTitle = result;
         setState(() {});
       }
     } catch (e) {