Skip to content

Commit

Permalink
Iphone testing, filter and pinch to zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
ivofernandes committed Dec 26, 2022
1 parent 774529d commit 4677b8a
Show file tree
Hide file tree
Showing 15 changed files with 831 additions and 634 deletions.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PODS:
- app_links (0.0.1):
- Flutter
- Flutter (1.0.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_ios (0.0.1):
- Flutter
- share_plus (0.0.1):
Expand All @@ -14,6 +16,7 @@ PODS:
DEPENDENCIES:
- app_links (from `.symlinks/plugins/app_links/ios`)
- Flutter (from `Flutter`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
Expand All @@ -24,6 +27,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/app_links/ios"
Flutter:
:path: Flutter
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
share_plus:
Expand All @@ -36,6 +41,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
app_links: ab4ba54d10a13d45825336bc9707b5eadee81191
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
Expand Down
27 changes: 14 additions & 13 deletions lib/builder/generate_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import 'package:timeago/timeago.dart' as timeago;

class GenerateContentBuilder extends StatelessWidget {
const GenerateContentBuilder({
super.key,
required this.contentData,
required this.index,
this.showUsername = true,
this.showComments = true,
this.showTabcoins = true,
super.key,
});

final Content contentData;
Expand All @@ -22,7 +22,9 @@ class GenerateContentBuilder extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool isComment = false;
if (contentData.parentId != null) isComment = true;
if (contentData.parentId != null) {
isComment = true;
}
return ListTile(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
Expand Down Expand Up @@ -56,7 +58,7 @@ class GenerateContentBuilder extends StatelessWidget {
overflow: TextOverflow.ellipsis,
softWrap: true,
),
subtitle: Row(
subtitle: Wrap(
children: [
Visibility(
visible: showTabcoins,
Expand Down Expand Up @@ -87,18 +89,17 @@ class GenerateContentBuilder extends StatelessWidget {
style: const TextStyle(
fontSize: 11,
),
overflow: TextOverflow.fade,
),
),
Flexible(
child: Text(
timeago.format(DateTime.parse(contentData.publishedAt!),
locale: 'pt_BR'),
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: true,
style: const TextStyle(
fontSize: 11,
),
Text(
timeago.format(DateTime.parse(contentData.publishedAt!),
locale: 'pt_BR'),
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: true,
style: const TextStyle(
fontSize: 11,
),
)
],
Expand Down
20 changes: 12 additions & 8 deletions lib/builder/image_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';

class ImageViewBuilder extends StatelessWidget {
const ImageViewBuilder({super.key, required this.url, required this.title});
const ImageViewBuilder({
required this.url,
required this.title,
super.key,
});

final String url;
final String title;

@override
Widget build(BuildContext context) => GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: PhotoView(
imageProvider: NetworkImage(url),
),
);
onTap: () {
Navigator.of(context).pop();
},
child: PhotoView(
imageProvider: NetworkImage(url),
),
);
}
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class MyAppState extends State<MyApp> with WidgetsBindingObserver {
seedColor: Colors.blue,
),
),
home: const HomePage(appName: appName),
home: const HomePage(
appName: appName,
),
);
}
}
8 changes: 8 additions & 0 deletions lib/model/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,12 @@ class Content {
'children': children,
'children_deep_count': childrenDeepCount,
};

bool matchFilter(String filter) {
if (title != null && title!.toLowerCase().contains(filter.toLowerCase())) {
return true;
}

return false;
}
}
Loading

0 comments on commit 4677b8a

Please sign in to comment.