From ad10edffd75d779b77e1e779df12112aa1cf6d39 Mon Sep 17 00:00:00 2001 From: Varakh Date: Sat, 3 Apr 2021 14:30:55 +0200 Subject: [PATCH] Improved visual differences when uploading, improved visuals in bottom tab bar, updated dependencies and removed deprecation warnings for some buttons, released 1.2.1+7 --- CHANGELOG.md | 8 ++++- assets/i18n/en.json | 7 ++-- lib/core/manager/dialog_manager.dart | 4 +-- lib/ui/views/history_view.dart | 6 ++-- lib/ui/views/login_view.dart | 7 +--- lib/ui/views/profile_view.dart | 6 +--- lib/ui/views/tabbar_anonymous.dart | 4 ++- lib/ui/views/tabbar_authenticated.dart | 25 ++++++++++--- lib/ui/views/upload_view.dart | 49 ++++++++++++-------------- pubspec.yaml | 26 +++++++------- 10 files changed, 78 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb61a28..7636823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # CHANGELOG -## 1.1.0+6 +## 1.2.1+7 +* Improve visual differences between the Upload tab and the upload button +* Improved visuals in bottom tab bar +* Updated dependencies and build with Flutter > 2 for the first time +* Updated to new button styles for New Material theme proposed by Google + +## 1.2.0+6 * Only copy multipaste link if multi box checked * Add copy to clipboard shortcut in history view diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 21516a1..acaef08 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -22,10 +22,11 @@ "login": "Login", "history": "History", "profile": "Profile", - "upload": "Upload" + "upload": "New" }, "upload": { - "open_file_explorer": "Select...", + "and_or": "and/or", + "open_file_explorer": "Select file(s)...", "clear_temporary_files": "Clear", "text_to_be_pasted": "Text...", "upload": "Upload", @@ -33,7 +34,7 @@ "file_explorer_open": "Selecting files...", "uploaded": "Uploaded! Copied links to clipboard.", "dismiss": "Dismiss", - "multipaste": "multipaste", + "multipaste": "Combine to a multipaste upload", "errors": { "not_found": "Not found", "retrieval_intent": "An error occurred while retrieving shared data" diff --git a/lib/core/manager/dialog_manager.dart b/lib/core/manager/dialog_manager.dart index f84637b..8a16af2 100644 --- a/lib/core/manager/dialog_manager.dart +++ b/lib/core/manager/dialog_manager.dart @@ -31,7 +31,7 @@ class _DialogManagerState extends State { List actions = []; if (request.buttonTitleDeny != null && request.buttonTitleDeny.isNotEmpty) { - Widget denyBtn = FlatButton( + Widget denyBtn = TextButton( child: Text(request.buttonTitleDeny), onPressed: () { _dialogService.dialogComplete(DialogResponse(confirmed: false)); @@ -40,7 +40,7 @@ class _DialogManagerState extends State { actions.add(denyBtn); } - Widget confirmBtn = FlatButton( + Widget confirmBtn = TextButton( child: Text(request.buttonTitleAccept), onPressed: () { _dialogService.dialogComplete(DialogResponse(confirmed: true)); diff --git a/lib/ui/views/history_view.dart b/lib/ui/views/history_view.dart index b04fe89..4be42df 100644 --- a/lib/ui/views/history_view.dart +++ b/lib/ui/views/history_view.dart @@ -45,7 +45,7 @@ class HistoryView extends StatelessWidget { } Widget _render(HistoryModel model, String url, BuildContext context) { - List cards = List(); + List cards = []; if (model.pastes.length > 0) { model.pastes.reversed.forEach((paste) { @@ -75,13 +75,13 @@ class HistoryView extends StatelessWidget { label: translate('history.copy_link.dismiss'), textColor: Colors.blue, onPressed: () { - Scaffold.of(context).hideCurrentSnackBar(); + ScaffoldMessenger.of(context).hideCurrentSnackBar(); }, ), content: Text(translate('history.copy_link.copied')), duration: Duration(seconds: 10), ); - Scaffold.of(context).showSnackBar(snackBar); + ScaffoldMessenger.of(context).showSnackBar(snackBar); }); })); diff --git a/lib/ui/views/login_view.dart b/lib/ui/views/login_view.dart index f343621..c932114 100644 --- a/lib/ui/views/login_view.dart +++ b/lib/ui/views/login_view.dart @@ -71,12 +71,7 @@ class _LoginViewState extends State { usernameController: model.userNameController, passwordController: model.passwordController, ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - padding: EdgeInsets.all(12), - color: primaryAccentColor, + ElevatedButton( child: Text(translate('login.button'), style: TextStyle(color: buttonForegroundColor)), onPressed: () async { var loginSuccess = await model.login( diff --git a/lib/ui/views/profile_view.dart b/lib/ui/views/profile_view.dart index 609bb50..82020b3 100644 --- a/lib/ui/views/profile_view.dart +++ b/lib/ui/views/profile_view.dart @@ -57,16 +57,12 @@ class ProfileView extends StatelessWidget { UIHelper.verticalSpaceMedium(), Padding( padding: const EdgeInsets.only(left: 25.0, right: 25.0), - child: RaisedButton.icon( + child: ElevatedButton.icon( icon: Icon(Icons.remove_red_eye, color: Colors.blue), label: Text( translate('profile.reveal_api_key'), style: TextStyle(color: buttonForegroundColor), ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: primaryAccentColor, onPressed: () { return model.revealApiKey(apiKey); })), diff --git a/lib/ui/views/tabbar_anonymous.dart b/lib/ui/views/tabbar_anonymous.dart index bd82b15..584a13a 100644 --- a/lib/ui/views/tabbar_anonymous.dart +++ b/lib/ui/views/tabbar_anonymous.dart @@ -18,7 +18,7 @@ class AnonymousTabBarState extends State with SingleTickerP List _tabPages = [LoginView()]; List _hasInit = [true]; - List _tabsButton = [Tab(icon: Icon(Icons.person_outline), text: translate('tabs.login'))]; + List _tabsButton = [Tab(icon: Icon(Icons.person_outline, color: Colors.blue), text: translate('tabs.login'))]; @override void initState() { @@ -49,6 +49,8 @@ class AnonymousTabBarState extends State with SingleTickerP bottomNavigationBar: BottomAppBar( child: TabBar( labelColor: primaryAccentColor, + indicatorColor: Colors.blue, + indicatorWeight: 3.0, tabs: _tabsButton, controller: _tabController, ), diff --git a/lib/ui/views/tabbar_authenticated.dart b/lib/ui/views/tabbar_authenticated.dart index 6867463..3c7e366 100644 --- a/lib/ui/views/tabbar_authenticated.dart +++ b/lib/ui/views/tabbar_authenticated.dart @@ -50,24 +50,39 @@ class AuthenticatedTabBarState extends State with Singl Widget build(BuildContext context) { double width = MediaQuery.of(context).size.width; double yourWidth = width / 3; - double yourHeight = 70; + double yourHeight = 55; List _tabsButton = [ Container( width: yourWidth, height: yourHeight, alignment: Alignment.center, - child: Tab(icon: Icon(Icons.upload_rounded), text: translate('tabs.upload'))), + child: Tab( + icon: Icon( + Icons.upload_file, + color: _currentTabIndex == 0 ? Colors.blue : primaryAccentColor, + ), + text: translate('tabs.upload'))), Container( width: yourWidth, height: yourHeight, alignment: Alignment.center, - child: Tab(icon: Icon(Icons.history), text: translate('tabs.history'))), + child: Tab( + icon: Icon( + Icons.history, + color: _currentTabIndex == 1 ? Colors.blue : primaryAccentColor, + ), + text: translate('tabs.history'))), Container( width: yourWidth, height: yourHeight, alignment: Alignment.center, - child: Tab(icon: Icon(Icons.person), text: translate('tabs.profile'))), + child: Tab( + icon: Icon( + Icons.person, + color: _currentTabIndex == 2 ? Colors.blue : primaryAccentColor, + ), + text: translate('tabs.profile'))), ]; return Scaffold( @@ -76,6 +91,8 @@ class AuthenticatedTabBarState extends State with Singl child: TabBar( indicatorSize: TabBarIndicatorSize.label, labelColor: primaryAccentColor, + indicatorColor: Colors.blue, + indicatorWeight: 3.0, labelPadding: EdgeInsets.all(0), tabs: _tabsButton, isScrollable: true, diff --git a/lib/ui/views/upload_view.dart b/lib/ui/views/upload_view.dart index 84d49be..28cec3c 100644 --- a/lib/ui/views/upload_view.dart +++ b/lib/ui/views/upload_view.dart @@ -59,49 +59,55 @@ class UploadView extends StatelessWidget { border: OutlineInputBorder(borderRadius: BorderRadius.circular(32.0)), ), controller: model.pasteTextController)), + Padding( + padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.end, + children: [Text(translate('upload.and_or'))])), Padding( padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.end, children: [ - RaisedButton.icon( + ElevatedButton.icon( icon: Icon(Icons.file_copy_sharp, color: Colors.blue), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: primaryAccentColor, onPressed: () => model.openFileExplorer(), label: Text( translate('upload.open_file_explorer'), style: TextStyle(color: buttonForegroundColor), )), - RaisedButton.icon( + ElevatedButton.icon( icon: Icon(Icons.cancel, color: Colors.orange), onPressed: model.paths != null && model.paths.length > 0 ? () => model.clearCachedFiles() : null, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: primaryAccentColor, label: Text( translate('upload.clear_temporary_files'), style: TextStyle(color: buttonForegroundColor), )), ], )), + Padding( + padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + value: model.createMulti, + onChanged: (v) => model.toggleCreateMulti(), + ), + Text(translate('upload.multipaste')), + ])), Padding( padding: const EdgeInsets.only(top: 10.0, bottom: 10.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.end, children: [ - RaisedButton.icon( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: primaryAccentColor, + ElevatedButton.icon( onPressed: () async { Map items = await model.upload(); @@ -119,13 +125,13 @@ class UploadView extends StatelessWidget { label: translate('upload.dismiss'), textColor: Colors.blue, onPressed: () { - Scaffold.of(context).hideCurrentSnackBar(); + ScaffoldMessenger.of(context).hideCurrentSnackBar(); }, ), content: Text(translate('upload.uploaded')), duration: Duration(seconds: 10), ); - Scaffold.of(context).showSnackBar(snackBar); + ScaffoldMessenger.of(context).showSnackBar(snackBar); }); } }, @@ -134,15 +140,6 @@ class UploadView extends StatelessWidget { translate('upload.upload'), style: TextStyle(color: buttonForegroundColor), )), - Row( - children: [ - Checkbox( - value: model.createMulti, - onChanged: (v) => model.toggleCreateMulti(), - ), - Text(translate('upload.multipaste')), - ], - ) ])), model.errorMessage != null && model.errorMessage.isNotEmpty ? (Padding( diff --git a/pubspec.yaml b/pubspec.yaml index ea9a0aa..07f58c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A mobile client for FileBin. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.0+6 +version: 1.2.1+7 environment: sdk: ">=2.7.0 <3.0.0" @@ -19,32 +19,32 @@ environment: dependencies: flutter: sdk: flutter - cupertino_icons: 1.0.0 + cupertino_icons: 1.0.2 flutter_localizations: sdk: flutter flutter_translate: 1.6.0 provider: 4.3.3 provider_architecture: 1.1.1+1 get_it: 3.1.0 # major changes > 3 - logger: 0.9.4 - shared_preferences: 0.5.12+4 + logger: 1.0.0 + shared_preferences: 2.0.5 http: 0.12.2 json_annotation: 3.1.1 - validators: 2.0.0+1 - flutter_linkify: 4.0.2 - url_launcher: 5.7.2 + validators: 2.0.1 + flutter_linkify: 4.1.0 + url_launcher: 5.7.10 expandable: 4.1.4 share: 0.6.5+4 - file_picker: 2.1.6 - clipboard: 0.1.2+8 - receive_sharing_intent: 1.4.3 - permission_handler: 5.0.1+1 + file_picker: 2.1.7 + clipboard: 0.1.3 + receive_sharing_intent: 1.4.5 + permission_handler: 5.1.0+2 dev_dependencies: flutter_test: sdk: flutter - build_runner: 1.10.2 - built_value_generator: 7.1.0 + build_runner: 1.11.5 + built_value_generator: 8.0.4 json_serializable: 3.5.1 # For information on the generic Dart part of this file, see the