-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WIN_CLIENT_DOWNLOAD_PATH= | ||
AND_CLIENT_DOWNLOAD_PATH= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM nginx:stable-alpine | ||
|
||
ARG WEB_FILE | ||
ARG WIN_FILE_NAME | ||
ARG AND_FILE_NAME | ||
|
||
RUN apk add --no-cache --update miller | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY nginx.conf /etc/nginx/conf.d | ||
|
||
COPY ${WEB_FILE} /usr/share/nginx/html | ||
RUN touch /usr/share/nginx/html/.env | ||
RUN echo "WIN_CLIENT_DOWNLOAD_PATH=/download/windows" > /usr/share/nginx/html/.env | ||
RUN echo "AND_CLIENT_DOWNLOAD_PATH=/download/android" >> /usr/share/nginx/html/.env | ||
|
||
COPY ${WIN_FILE_NAME} /download/${WIN_FILE_NAME} | ||
COPY ${AND_FILE_NAME} /download/${AND_FILE_NAME} | ||
|
||
RUN apk del miller | ||
|
||
ENV WIN_FILE_NAME=${WIN_FILE_NAME} | ||
ENV AND_FILE_NAME=${AND_FILE_NAME} | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
env WIN_FILE_NAME; | ||
env AND_FILE_NAME; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location /download/windows { | ||
alias /download/$WIN_FILE_NAME; | ||
add_header Content-Disposition 'attachment; filename="$WIN_FILE_NAME"'; | ||
} | ||
|
||
location /download/android { | ||
alias /download/$AND_FILE_NAME; | ||
add_header Content-Disposition 'attachment; filename="$AND_FILE_NAME"'; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
import '../../bloc/main_bloc.dart'; | ||
import '../../common/platform.dart'; | ||
import '../../consts.dart'; | ||
import '../../l10n/l10n.dart'; | ||
import '../../route.dart'; | ||
import '../components/toast.dart'; | ||
import '../helper/spacing.dart'; | ||
import '../layout/bootstrap_container.dart'; | ||
|
||
class WebLandingPage extends StatelessWidget { | ||
const WebLandingPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final primaryButtonStyle = ButtonStyle( | ||
backgroundColor: MaterialStateProperty.all<Color>( | ||
Theme.of(context).colorScheme.primary, | ||
), | ||
foregroundColor: MaterialStateProperty.all<Color>( | ||
Theme.of(context).colorScheme.onPrimary, | ||
), | ||
); | ||
return Theme( | ||
data: Theme.of(context).copyWith( | ||
scaffoldBackgroundColor: Theme.of(context).colorScheme.surfaceVariant, | ||
), | ||
child: BlocConsumer<MainBloc, MainState>( | ||
listener: (context, state) { | ||
if (state.currentUser != null) { | ||
AppRoutes.tiphereth.go(context); | ||
Toast(title: '', message: S.of(context).welcome).show(context); | ||
} | ||
}, | ||
builder: (context, state) { | ||
return Scaffold( | ||
body: BootstrapContainer(children: [ | ||
BootstrapColumn( | ||
xxs: 12, | ||
md: 8, | ||
lg: 6, | ||
child: Card( | ||
child: Padding( | ||
padding: const EdgeInsets.all(32.0), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Text( | ||
S.of(context).welcomeHeader, | ||
style: Theme.of(context) | ||
.textTheme | ||
.titleLarge | ||
?.copyWith(fontWeight: FontWeight.bold), | ||
), | ||
const SizedBox(height: 16), | ||
SpacingHelper.defaultDivider, | ||
Text( | ||
S.of(context).downloadClient, | ||
), | ||
const SizedBox(height: 16), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
ElevatedButton.icon( | ||
onPressed: | ||
DotEnvValue.winClientDownloadUrl.isNotEmpty | ||
? () async { | ||
final url = Uri.parse( | ||
DotEnvValue.winClientDownloadUrl); | ||
await launchUrl(url); | ||
} | ||
: null, | ||
style: PlatformHelper.isWindows() | ||
? primaryButtonStyle | ||
: null, | ||
icon: Icon( | ||
const FaIcon(FontAwesomeIcons.windows).icon), | ||
label: const Text('Windows'), | ||
), | ||
const SizedBox(width: 16), | ||
ElevatedButton.icon( | ||
onPressed: | ||
DotEnvValue.andClientDownloadUrl.isNotEmpty | ||
? () async { | ||
final url = Uri.parse( | ||
DotEnvValue.andClientDownloadUrl); | ||
await launchUrl(url); | ||
} | ||
: null, | ||
style: PlatformHelper.isAndroid() | ||
? primaryButtonStyle | ||
: null, | ||
icon: Icon( | ||
const FaIcon(FontAwesomeIcons.android).icon), | ||
label: const Text('Android'), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 16), | ||
SpacingHelper.defaultDivider, | ||
const SizedBox(height: 16), | ||
OutlinedButton( | ||
onPressed: () { | ||
AppRoutes.login.go(context); | ||
}, | ||
child: Text(S.of(context).continueInWebVersion), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
]), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters