Skip to content

Commit

Permalink
20240328 update3
Browse files Browse the repository at this point in the history
  • Loading branch information
neko0xff committed Mar 28, 2024
1 parent 9b99512 commit fd325c2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/demo/viewapp_master/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ var backcolor = Colors.black26;
void main() async {
WidgetsFlutterBinding.ensureInitialized();

PWAInstall().setup(installCallback: () {
debugPrint('APP INSTALLED!');
});
// Check for PWA install prompt support (if necessary)
if (defaultTargetPlatform == TargetPlatform.android) {
PWAInstall().setup(installCallback: () {
debugPrint('APP INSTALLED!');
});
PWAInstall().promptInstall_();
//PWAInstall().promptInstall_();
}else if(defaultTargetPlatform == TargetPlatform.iOS){
PWAInstall().setup(installCallback: () {
debugPrint('APP INSTALLED!');
});
PWAInstall().promptInstall_();
//PWAInstall().promptInstall_();
}

runApp(viewAppMain());
Expand Down
10 changes: 9 additions & 1 deletion src/demo/viewapp_user/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ignore_for_file: avoid_web_libraries_in_flutter, use_key_in_widget_constructors, camel_case_types

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:pwa_install/pwa_install.dart';
import 'package:viewapp_user/pages/out/about.dart';
Expand All @@ -9,10 +10,17 @@ import 'package:viewapp_user/pages/user/updateUser.dart';

void main() async {
// Add this

PWAInstall().setup(installCallback: () {
debugPrint('APP INSTALLED!');
});
PWAInstall().promptInstall_();
// Check for PWA install prompt support (if necessary)
if (defaultTargetPlatform == TargetPlatform.android) {
//PWAInstall().promptInstall_();
}else if(defaultTargetPlatform == TargetPlatform.iOS){
//PWAInstall().promptInstall_();
}
//PWAInstall().promptInstall_();
runApp(viewAppMain());
await Future.delayed(const Duration(seconds: 1));
}
Expand Down
3 changes: 3 additions & 0 deletions src/demo/viewapp_user/lib/pages/user/changePassword.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Update User Finnish!'),
content: const Text('Please Go to Login Page,You now can Login!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand Down Expand Up @@ -353,6 +354,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Network Connection Fail!'),
content: const Text('Please check you are Network & Server!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand All @@ -374,6 +376,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Password Fail!'),
content: const Text('Please check you are Password!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand Down
2 changes: 2 additions & 0 deletions src/demo/viewapp_user/lib/pages/user/forget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class btnforgetSend extends StatelessWidget {
return AlertDialog(
title: const Text('Forget Fail!'),
content: const Text('Please check you are Input Data!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand All @@ -273,6 +274,7 @@ class btnforgetSend extends StatelessWidget {
return AlertDialog(
title: const Text('Network Connection Fail!'),
content: const Text('Please check you are Network & Server!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand Down
4 changes: 4 additions & 0 deletions src/demo/viewapp_user/lib/pages/user/updateUser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Update User Finnish!'),
content: const Text('Please Go to Login Page,You now can Login!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand All @@ -301,6 +302,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('User Data Update Fail!'),
content: const Text('Please check you are Input Data!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand All @@ -322,6 +324,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Network Connection Fail!'),
content: const Text('Please check you are Network & Server!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand All @@ -343,6 +346,7 @@ class btnUpdateSend extends StatelessWidget {
return AlertDialog(
title: const Text('Password Fail!'),
content: const Text('Please check you are Password!'),
backgroundColor: Colors.blue,
actions: <Widget>[
ElevatedButton(
child: const Text('OK'),
Expand Down

0 comments on commit fd325c2

Please sign in to comment.