Skip to content

Commit

Permalink
resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarika Gautam authored and Sarika Gautam committed May 9, 2022
2 parents 5d30798 + 295e066 commit e0f6927
Show file tree
Hide file tree
Showing 23 changed files with 546 additions and 194 deletions.
Binary file added assets/images/empty_group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Share Extension/Info.plist";
Expand Down Expand Up @@ -448,7 +448,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Share Extension/Info.plist";
Expand Down Expand Up @@ -478,7 +478,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Share Extension/Info.plist";
Expand Down Expand Up @@ -558,7 +558,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -703,7 +703,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -742,7 +742,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 39;
CURRENT_PROJECT_VERSION = 40;
DEVELOPMENT_TEAM = 5XUSS6C2DF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
26 changes: 21 additions & 5 deletions lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:atsign_atmosphere_pro/view_models/file_download_checker.dart';
import 'package:atsign_atmosphere_pro/desktop_routes/desktop_routes.dart';
import 'package:atsign_atmosphere_pro/view_models/internet_connectivity_checker.dart';
import 'package:atsign_atmosphere_pro/view_models/side_bar_provider.dart';
import 'package:atsign_atmosphere_pro/view_models/switch_atsign_provider.dart';
import 'package:atsign_atmosphere_pro/view_models/trusted_sender_view_model.dart';
Expand Down Expand Up @@ -50,15 +51,23 @@ class _MyAppState extends State<MyApp> {
ChangeNotifierProvider(create: (context) => NestedRouteProvider()),
ChangeNotifierProvider(create: (context) => SwitchAtsignProvider()),
ChangeNotifierProvider(create: (context) => FileDownloadChecker()),
ChangeNotifierProvider(
create: (context) => InternetConnectivityChecker())
],
child: MaterialApp(
builder: (BuildContext context, Widget? child) {
final MediaQueryData data = MediaQuery.of(context);
return MediaQuery(
data: data.copyWith(
textScaleFactor:
data.textScaleFactor > 1.1 ? 1.1 : data.textScaleFactor),
child: child!,
return GestureDetector(
onVerticalDragDown: (__) {
// When running in iOS, dismiss the keyboard when when user scrolls
if (Platform.isIOS) hideKeyboard(context);
},
child: MediaQuery(
data: data.copyWith(
textScaleFactor:
data.textScaleFactor > 1.1 ? 1.1 : data.textScaleFactor),
child: child!,
),
);
},
title: 'AtSign Atmosphere Pro',
Expand All @@ -80,4 +89,11 @@ class _MyAppState extends State<MyApp> {
),
);
}

void hideKeyboard(BuildContext context) {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
FocusManager.instance.primaryFocus?.unfocus();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _DesktopReceivedFilesListTileState
Uint8List? videoThumbnail, firstContactImage;
String? contactName;
List<bool> fileResending = [];
bool isResendingToFirstContact = false;
bool isResendingToFirstContact = false, showDownloadIndicator = false;

@override
void initState() {
Expand Down Expand Up @@ -90,6 +90,58 @@ class _DesktopReceivedFilesListTileState
return videoThumbnail;
}

checkIfDownloadAvailable() async {
bool isExpired = true;
var expiryDate = widget.receivedHistory!.date!.add(Duration(days: 6));
if (expiryDate.difference(DateTime.now()) > Duration(seconds: 0)) {
isExpired = false;
}

if (isExpired) {
if (mounted) {
setState(() {
showDownloadIndicator = false;
});
}
return;
}

widget.receivedHistory!.files!.forEach((element) async {
String path = MixedConstants.RECEIVED_FILE_DIRECTORY +
Platform.pathSeparator +
(widget.receivedHistory!.sender ?? '') +
Platform.pathSeparator +
(element.name ?? '');
File test = File(path);
bool fileExists = await test.exists();
if (fileExists == false) {
showDownloadIndicator = true;
} else {
showDownloadIndicator = false;
}
});

if (mounted) {
setState(() {});
}
}

@override
void didUpdateWidget(covariant DesktopReceivedFilesListTile oldWidget) {
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) async {
await checkIfDownloadAvailable();
});
super.didUpdateWidget(oldWidget);
}

@override
void didChangeDependencies() {
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) async {
await checkIfDownloadAvailable();
});
super.didChangeDependencies();
}

@override
Widget build(BuildContext context) {
double deviceTextFactor = MediaQuery.of(context).textScaleFactor;
Expand All @@ -102,32 +154,45 @@ class _DesktopReceivedFilesListTileState
: null,
child: ListTile(
leading: contactList.isNotEmpty
? firstContactImage != null
? CustomCircleAvatar(
byteImage: firstContactImage, nonAsset: true)
: isResendingToFirstContact
? TypingIndicator(
showIndicator: true,
flashingCircleBrightColor: ColorConstants.dullText,
flashingCircleDarkColor: ColorConstants.fadedText,
)
: Stack(
children: [
Container(
width: 50,
height: 50,
child: firstContactImage != null
? CustomCircleAvatar(
byteImage: firstContactImage,
nonAsset: true,
)
: ContactInitial(
initials: contactList[0],
size: 50,
),
),
],
)
? isResendingToFirstContact
? TypingIndicator(
showIndicator: true,
flashingCircleBrightColor: ColorConstants.dullText,
flashingCircleDarkColor: ColorConstants.fadedText,
)
: Stack(
children: [
Container(
width: 50,
height: 50,
child: firstContactImage != null
? CustomCircleAvatar(
byteImage: firstContactImage,
nonAsset: true)
: ContactInitial(
initials: contactList[0],
size: 50,
),
),
showDownloadIndicator
? Positioned(
right: 0,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
padding: EdgeInsets.all(1.toHeight),
child: CircleAvatar(
backgroundColor:
ColorConstants.orangeColor,
radius: 5.toWidth,
),
),
)
: SizedBox()
],
)
: SizedBox(),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -156,10 +221,7 @@ class _DesktopReceivedFilesListTileState
)),
],
),
SizedBox(height: 5.toHeight),
SizedBox(
height: 8.toHeight,
),
SizedBox(height: 13.toHeight),
Container(
child: Column(
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _DesktopSentFilesListTileState extends State<DesktopSentFilesListTile> {
bool isDeepOpen = false;
Uint8List? videoThumbnail, firstContactImage;
List<bool> fileResending = [];
bool isResendingToFirstContact = false;
bool isResendingToFirstContact = false, isFileSharedToGroup = false;
String? contactName;

@override
Expand All @@ -69,6 +69,9 @@ class _DesktopSentFilesListTileState extends State<DesktopSentFilesListTile> {
}

getContactImage();
if (widget.sentHistory!.groupName != null) {
isFileSharedToGroup = true;
}
}

getContactImage() {
Expand Down Expand Up @@ -107,7 +110,7 @@ class _DesktopSentFilesListTileState extends State<DesktopSentFilesListTile> {
color: (widget.isSelected) ? ColorConstants.selected_list : null,
child: ListTile(
leading: contactList.isNotEmpty
? firstContactImage != null
? (firstContactImage != null && !isFileSharedToGroup)
? CustomCircleAvatar(
byteImage: firstContactImage, nonAsset: true)
: Container(
Expand All @@ -126,13 +129,16 @@ class _DesktopSentFilesListTileState extends State<DesktopSentFilesListTile> {
Container(
width: 100.toHeight,
height: 100.toHeight,
child: firstContactImage != null
child: (firstContactImage != null &&
!isFileSharedToGroup)
? CustomCircleAvatar(
byteImage: firstContactImage,
nonAsset: true,
)
: ContactInitial(
initials: contactList[0],
initials: isFileSharedToGroup
? widget.sentHistory!.groupName
: contactList[0],
size: 45,
),
),
Expand All @@ -143,33 +149,46 @@ class _DesktopSentFilesListTileState extends State<DesktopSentFilesListTile> {
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
contactList.isNotEmpty
? contactName != null
? Text(
contactName!,
style:
CustomTextStyles.primaryRegularBold18,
)
: SizedBox()
: SizedBox(),
SizedBox(height: 10),
contactList.isNotEmpty
? Text(
contactList[0]!,
style: CustomTextStyles.primaryRegular18,
)
: SizedBox(),
],
)),
],
),
isFileSharedToGroup == false
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
contactList.isNotEmpty
? contactName != null
? Text(
contactName!,
style: CustomTextStyles
.primaryRegularBold18,
)
: SizedBox()
: SizedBox(),
SizedBox(height: 10),
contactList.isNotEmpty
? Text(
contactList[0]!,
style: CustomTextStyles.primaryRegular18,
)
: SizedBox(),
],
)),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: InkWell(
child: Text(
widget.sentHistory!.groupName!,
style: CustomTextStyles.primaryRegularBold18,
)),
)
],
),
SizedBox(height: 5.toHeight),
SizedBox(
height: 8.toHeight,
Expand Down
Loading

0 comments on commit e0f6927

Please sign in to comment.