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

This commit is contained in:
Varakh 2021-04-03 14:30:55 +02:00
parent e623cef713
commit ad10edffd7
10 changed files with 78 additions and 64 deletions

View file

@ -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

View file

@ -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"

View file

@ -31,7 +31,7 @@ class _DialogManagerState extends State<DialogManager> {
List<Widget> actions = <Widget>[];
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<DialogManager> {
actions.add(denyBtn);
}
Widget confirmBtn = FlatButton(
Widget confirmBtn = TextButton(
child: Text(request.buttonTitleAccept),
onPressed: () {
_dialogService.dialogComplete(DialogResponse(confirmed: true));

View file

@ -45,7 +45,7 @@ class HistoryView extends StatelessWidget {
}
Widget _render(HistoryModel model, String url, BuildContext context) {
List<Widget> cards = List<Widget>();
List<Widget> 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);
});
}));

View file

@ -71,12 +71,7 @@ class _LoginViewState extends State<LoginView> {
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(

View file

@ -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);
})),

View file

@ -18,7 +18,7 @@ class AnonymousTabBarState extends State<AnonymousTabBarView> with SingleTickerP
List<Widget> _tabPages = [LoginView()];
List<bool> _hasInit = [true];
List<Widget> _tabsButton = [Tab(icon: Icon(Icons.person_outline), text: translate('tabs.login'))];
List<Widget> _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<AnonymousTabBarView> with SingleTickerP
bottomNavigationBar: BottomAppBar(
child: TabBar(
labelColor: primaryAccentColor,
indicatorColor: Colors.blue,
indicatorWeight: 3.0,
tabs: _tabsButton,
controller: _tabController,
),

View file

@ -50,24 +50,39 @@ class AuthenticatedTabBarState extends State<AuthenticatedTabBarView> with Singl
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
double yourWidth = width / 3;
double yourHeight = 70;
double yourHeight = 55;
List<Widget> _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<AuthenticatedTabBarView> with Singl
child: TabBar(
indicatorSize: TabBarIndicatorSize.label,
labelColor: primaryAccentColor,
indicatorColor: Colors.blue,
indicatorWeight: 3.0,
labelPadding: EdgeInsets.all(0),
tabs: _tabsButton,
isScrollable: true,

View file

@ -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<String, bool> 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(

View file

@ -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