Skip to content

Commit

Permalink
Merge pull request #5 from GLUA-UA/frontend-dev
Browse files Browse the repository at this point in the history
Frontend dev
  • Loading branch information
miguelovila authored Sep 30, 2023
2 parents 2060505 + f5b620a commit f2a1fef
Show file tree
Hide file tree
Showing 20 changed files with 815 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/lib/widgets/codeinput_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Widget codeInputPage(
if (response.statusCode == 200) {
Map<String, dynamic> srlResponse = jsonDecode(response.body);
if (srlResponse['success'] == true) {
updatePlayerId(srlResponse['player']['id']);
updatePlayerId(output);
updatePlayerName(srlResponse['player']['name']);
controller.nextPage(
duration: const Duration(milliseconds: 300),
Expand Down
44 changes: 44 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions frontend/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "12fccda598477eddd19f93040a1dba24f915b9be"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 12fccda598477eddd19f93040a1dba24f915b9be
base_revision: 12fccda598477eddd19f93040a1dba24f915b9be
- platform: web
create_revision: 12fccda598477eddd19f93040a1dba24f915b9be
base_revision: 12fccda598477eddd19f93040a1dba24f915b9be

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
16 changes: 16 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frontend

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
28 changes: 28 additions & 0 deletions frontend/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
7 changes: 7 additions & 0 deletions frontend/assets/images/enei_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions frontend/assets/images/glua_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions frontend/lib/logic/requester.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:http/http.dart' as http;

const String baseUrl = "http://localhost:3000";

Future<http.Response> getLeaderboard() async {
try {
return await http.get(Uri.parse('$baseUrl/tournament/players'));
} catch (e) {
return http.Response('{"error": "Could not connect to server"}', 500);
}
}
Loading

0 comments on commit f2a1fef

Please sign in to comment.