Skip to content

Commit

Permalink
small-patches
Browse files Browse the repository at this point in the history
  • Loading branch information
hmziqrs committed Feb 27, 2020
1 parent dca4f42 commit fff2fbe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions lib/Widgets/Screen/Screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ScreenState extends State<Screen> with AnimationControllerMixin {

Animation<double> popUpAnimation;
bool inProgress = false;
bool mounted = false;
String popUpTitle;
String popUpMessage;

Expand All @@ -60,6 +61,7 @@ class ScreenState extends State<Screen> with AnimationControllerMixin {
return;
}
setState(() {
mounted = true;
popUpMessage = message;
popUpTitle = title;
});
Expand All @@ -76,6 +78,9 @@ class ScreenState extends State<Screen> with AnimationControllerMixin {
to: 0.0,
onComplete: () {
inProgress = false;
setState(() {
mounted = false;
});
}),
]);
}
Expand All @@ -84,6 +89,10 @@ class ScreenState extends State<Screen> with AnimationControllerMixin {
final margin = AppDimensions.padding * 3;
final borderRadius = BorderRadius.circular(6.0);

if (!mounted) {
return Container();
}

return Positioned(
bottom: Utils.rangeMap(
popUpAnimation.value,
Expand All @@ -102,6 +111,7 @@ class ScreenState extends State<Screen> with AnimationControllerMixin {
duration: Duration(milliseconds: popUpTransitionDuration),
onComplete: () {
inProgress = false;
mounted = false;
},
)
]),
Expand Down
4 changes: 3 additions & 1 deletion lib/screens/Download/Download.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_uis/Utils.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:http/http.dart' as http;

Expand Down Expand Up @@ -87,14 +88,15 @@ class _DownloadScreenState extends State<DownloadScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Utils.safePadding(context, "top"),
Container(
width: double.infinity,
padding: EdgeInsets.all(AppDimensions.padding * 2),
child: Text(
"Download will start in browser",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14 + AppDimensions.ratio * 5,
fontSize: 12 + AppDimensions.ratio * 4,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/Download/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ final mobileLinks = [
"icon": MaterialCommunityIcons.google_play,
},
{
"key": "apk-release.apk",
"key": "app-release.apk",
"name": "Apk",
"icon": MaterialCommunityIcons.android,
}
];

final desktopLinks = [
{
"key": "mac-release.zip",
"key": "macos-release.zip",
"name": "Mac",
"icon": MaterialCommunityIcons.apple_finder,
},
Expand Down
6 changes: 2 additions & 4 deletions lib/screens/UiDetail/UIDetail.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';

import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:url_launcher/url_launcher.dart' as url;
import 'package:flutter_bloc/flutter_bloc.dart';

import 'package:flutter_uis/blocs/ui_bloc/bloc.dart';
Expand Down Expand Up @@ -66,7 +65,6 @@ class _UiDetailScreenState extends State<UiDetailScreen>
image: ExactAssetImage(uiItem.thumbnail),
fit: BoxFit.cover,
),
// color: Colors.red,
),
),
);
Expand Down Expand Up @@ -279,10 +277,10 @@ class _UiDetailScreenState extends State<UiDetailScreen>
arguments: {"designer": uiItem.designer, "id": uiItem.id},
),
),
Utils.safePadding(context, 'bottom'),
Padding(
padding: EdgeInsets.only(top: safeOffset < 0 ? 0 : safeOffset),
)
),
Utils.safePadding(context, 'bottom'),
],
),
),
Expand Down

0 comments on commit fff2fbe

Please sign in to comment.