Explorar o código

address review comments

Neeraj Gupta %!s(int64=3) %!d(string=hai) anos
pai
achega
b5a5e5988d

+ 2 - 2
lib/ui/change_collection_name_dialog.dart

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

+ 7 - 6
lib/ui/gallery_app_bar_widget.dart

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