Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into 75-create-a-screen-to-display-the-status-of-…
Browse files Browse the repository at this point in the history
…our-sequences
  • Loading branch information
OtterWays authored Aug 23, 2024
2 parents b8408e3 + dc038ed commit 7868d8c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
Expand Down
18 changes: 16 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET" />"
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BROWSABLE" />

<uses-feature
android:name="android.hardware.microphone"
android:required="false" />

<application
android:label="Panoramax"
android:name="${applicationName}"
Expand All @@ -12,6 +18,7 @@
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:enableOnBackInvokedCallback="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
Expand All @@ -27,6 +34,13 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.CAPTURE_IMAGE" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import 'package:wakelock_plus/wakelock_plus.dart';
import 'package:sensors/sensors.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:share/share.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
import 'component/loader.dart';
import 'service/api/api.dart';
import 'constant.dart';
Expand Down
47 changes: 38 additions & 9 deletions lib/page/collection_creation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class CollectionCreationPageState extends State<CollectionCreationPage> {
]);
}

final Map<File, bool> _selectedFiles = {};

@override
void initState() {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
Expand All @@ -31,12 +33,19 @@ class CollectionCreationPageState extends State<CollectionCreationPage> {
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
for (var file in widget.imgList) {
_selectedFiles[file] = true;
}
super.initState();
}

void goToInstancePage() {
final list = _selectedFiles.entries
.where((entry) => entry.value)
.map((entry) => entry.key)
.toList();
GetIt.instance<NavigationService>()
.pushTo(Routes.instance, arguments: widget.imgList);
.pushTo(Routes.instance, arguments: list);
}

@override
Expand Down Expand Up @@ -66,14 +75,8 @@ class CollectionCreationPageState extends State<CollectionCreationPage> {
spacing: 8,
runSpacing: 8,
children: [
...widget.imgList
.map((item) => Container(
height: 100,
child: Image.file(
item,
fit: BoxFit.cover,
)))
.toList()
for (var file in _selectedFiles.keys)
PictureItem(file),
],
)))),
Padding(
Expand All @@ -91,4 +94,30 @@ class CollectionCreationPageState extends State<CollectionCreationPage> {
),
));
}

Widget PictureItem(File file) {
return Stack(
alignment: Alignment.bottomRight,
children: [
Container(
height: 80,
child: Image.file(
file,
fit: BoxFit.cover,
)),
SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
value: _selectedFiles[file],
onChanged: (value) {
setState(() {
_selectedFiles[file] = value!;
});
},
),
)
],
);
}
}
7 changes: 3 additions & 4 deletions lib/service/routing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Routes extends Equatable {
newSequenceCapture,
newSequenceSend,
instance,
newSequenceUpload
newSequenceUpload,
];
}

Expand All @@ -24,11 +24,10 @@ class NavigationService {
}

dynamic pushReplacementTo(String route, {dynamic arguments}) {
return navigatorkey.currentState?.pushReplacementNamed(route, arguments: arguments);
return navigatorkey.currentState
?.pushReplacementNamed(route, arguments: arguments);
}



dynamic goBack() {
return navigatorkey.currentState?.pop();
}
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ dependencies:
wakelock_plus: ^1.2.7
url_launcher: ^6.3.0
share: ^2.0.4
android_intent: ^2.0.2
receive_sharing_intent: ^1.8.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 7868d8c

Please sign in to comment.