Skip to content
This repository was archived by the owner on Jun 8, 2025. It is now read-only.

Commit 15ecc47

Browse files
Initial project
1 parent d0c3c57 commit 15ecc47

File tree

15 files changed

+487
-16
lines changed

15 files changed

+487
-16
lines changed

.fvm/fvm_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"flutterSdkVersion": "3.13.0",
3+
"flavors": {}
4+
}

.gitignore

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
1-
# See https://www.dartlang.org/guides/libraries/private-files
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
212

3-
# Files and directories created by pub
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
427
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
530
.packages
6-
build/
7-
# If you're building an application, you may want to check-in your pubspec.lock
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
.fvm/flutter_sdk
42+
843
pubspec.lock
944

10-
# Directory created by dartdoc
11-
# If you don't generate documentation locally you can remove this line.
12-
doc/api/
13-
14-
# Avoid committing generated Javascript files:
15-
*.dart.js
16-
*.info.json # Produced by the --dump-info flag.
17-
*.js # When generated by dart2js. Don't specify *.js if your
18-
# project includes source files written in JavaScript.
19-
*.js_
20-
*.js.deps
21-
*.js.map
45+
deploy/

.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "efbf63d9c66b9f6ec30e9ad4611189aa80003d31"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
17+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
18+
- platform: web
19+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
20+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Environemnt to install flutter and build web
2+
FROM debian:latest AS build-env
3+
4+
#install all needed stuff
5+
RUN apt-get update
6+
RUN apt-get install -y curl git unzip
7+
8+
#define variables
9+
ARG FLUTTER_SDK=/usr/local/flutter
10+
ARG APP=/app/
11+
12+
#clone flutter
13+
RUN git clone https://github.com/flutter/flutter.git $FLUTTER_SDK
14+
#change dir to current flutter folder and make a checkout to the specific version
15+
RUN cd $FLUTTER_SDK && git checkout efbf63d9c66b9f6ec30e9ad4611189aa80003d31
16+
17+
#setup the flutter path as an enviromental variable
18+
ENV PATH="$FLUTTER_SDK/bin:$FLUTTER_SDK/bin/cache/dart-sdk/bin:${PATH}"
19+
20+
#Start to run Flutter commands
21+
#doctor to see if all was installes ok
22+
RUN flutter doctor -v
23+
24+
#create folder to copy source code
25+
RUN mkdir $APP
26+
#copy source code to folder
27+
COPY . $APP
28+
#stup new folder as the working directory
29+
WORKDIR $APP
30+
31+
#Run build: 1 - clean, 2 - pub get, 3 - build web
32+
RUN flutter clean
33+
RUN flutter pub get
34+
RUN flutter build web
35+
36+
#once heare the app will be compiled and ready to deploy
37+
38+
#use nginx to deploy
39+
FROM nginx:1.25.2-alpine
40+
41+
#copy the info of the builded web app to nginx
42+
COPY --from=build-env /app/build/web /usr/share/nginx/html
43+
44+
#Expose and run nginx
45+
EXPOSE 80
46+
CMD ["nginx", "-g", "daemon off;"]

analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

lib/main.dart

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
import 'package:flutter/material.dart';
2+
3+
void main() {
4+
runApp(const MyApp());
5+
}
6+
7+
class MyApp extends StatelessWidget {
8+
const MyApp({super.key});
9+
10+
// This widget is the root of your application.
11+
@override
12+
Widget build(BuildContext context) {
13+
return MaterialApp(
14+
title: 'Flutter Demo',
15+
theme: ThemeData(
16+
// This is the theme of your application.
17+
//
18+
// TRY THIS: Try running your application with "flutter run". You'll see
19+
// the application has a blue toolbar. Then, without quitting the app,
20+
// try changing the seedColor in the colorScheme below to Colors.green
21+
// and then invoke "hot reload" (save your changes or press the "hot
22+
// reload" button in a Flutter-supported IDE, or press "r" if you used
23+
// the command line to start the app).
24+
//
25+
// Notice that the counter didn't reset back to zero; the application
26+
// state is not lost during the reload. To reset the state, use hot
27+
// restart instead.
28+
//
29+
// This works for code too, not just values: Most code changes can be
30+
// tested with just a hot reload.
31+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
32+
useMaterial3: true,
33+
),
34+
home: const MyHomePage(title: 'Flutter Demo Home Page'),
35+
);
36+
}
37+
}
38+
39+
class MyHomePage extends StatefulWidget {
40+
const MyHomePage({super.key, required this.title});
41+
42+
// This widget is the home page of your application. It is stateful, meaning
43+
// that it has a State object (defined below) that contains fields that affect
44+
// how it looks.
45+
46+
// This class is the configuration for the state. It holds the values (in this
47+
// case the title) provided by the parent (in this case the App widget) and
48+
// used by the build method of the State. Fields in a Widget subclass are
49+
// always marked "final".
50+
51+
final String title;
52+
53+
@override
54+
State<MyHomePage> createState() => _MyHomePageState();
55+
}
56+
57+
class _MyHomePageState extends State<MyHomePage> {
58+
int _counter = 0;
59+
60+
void _incrementCounter() {
61+
setState(() {
62+
// This call to setState tells the Flutter framework that something has
63+
// changed in this State, which causes it to rerun the build method below
64+
// so that the display can reflect the updated values. If we changed
65+
// _counter without calling setState(), then the build method would not be
66+
// called again, and so nothing would appear to happen.
67+
_counter++;
68+
});
69+
}
70+
71+
@override
72+
Widget build(BuildContext context) {
73+
// This method is rerun every time setState is called, for instance as done
74+
// by the _incrementCounter method above.
75+
//
76+
// The Flutter framework has been optimized to make rerunning build methods
77+
// fast, so that you can just rebuild anything that needs updating rather
78+
// than having to individually change instances of widgets.
79+
return Scaffold(
80+
appBar: AppBar(
81+
// TRY THIS: Try changing the color here to a specific color (to
82+
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
83+
// change color while the other colors stay the same.
84+
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
85+
// Here we take the value from the MyHomePage object that was created by
86+
// the App.build method, and use it to set our appbar title.
87+
title: Text(widget.title),
88+
),
89+
body: Center(
90+
// Center is a layout widget. It takes a single child and positions it
91+
// in the middle of the parent.
92+
child: Column(
93+
// Column is also a layout widget. It takes a list of children and
94+
// arranges them vertically. By default, it sizes itself to fit its
95+
// children horizontally, and tries to be as tall as its parent.
96+
//
97+
// Column has various properties to control how it sizes itself and
98+
// how it positions its children. Here we use mainAxisAlignment to
99+
// center the children vertically; the main axis here is the vertical
100+
// axis because Columns are vertical (the cross axis would be
101+
// horizontal).
102+
//
103+
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
104+
// action in the IDE, or press "p" in the console), to see the
105+
// wireframe for each widget.
106+
mainAxisAlignment: MainAxisAlignment.center,
107+
children: <Widget>[
108+
const Text(
109+
'You have pushed the button this many times:',
110+
),
111+
Text(
112+
'$_counter',
113+
style: Theme.of(context).textTheme.headlineMedium,
114+
),
115+
],
116+
),
117+
),
118+
floatingActionButton: FloatingActionButton(
119+
onPressed: _incrementCounter,
120+
tooltip: 'Increment',
121+
child: const Icon(Icons.add),
122+
), // This trailing comma makes auto-formatting nicer for build methods.
123+
);
124+
}
125+
}

pubspec.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: flutter_web_build_docker
2+
description: A new Flutter project.
3+
# The following line prevents the package from being accidentally published to
4+
# pub.dev using `flutter pub publish`. This is preferred for private packages.
5+
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6+
7+
# The following defines the version and build number for your application.
8+
# A version number is three numbers separated by dots, like 1.2.43
9+
# followed by an optional build number separated by a +.
10+
# Both the version and the builder number may be overridden in flutter
11+
# build by specifying --build-name and --build-number, respectively.
12+
# In Android, build-name is used as versionName while build-number used as versionCode.
13+
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14+
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15+
# Read more about iOS versioning at
16+
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17+
# In Windows, build-name is used as the major, minor, and patch parts
18+
# of the product and file versions while build-number is used as the build suffix.
19+
version: 1.0.0+1
20+
21+
environment:
22+
sdk: '>=3.1.0 <4.0.0'
23+
24+
# Dependencies specify other packages that your package needs in order to work.
25+
# To automatically upgrade your package dependencies to the latest versions
26+
# consider running `flutter pub upgrade --major-versions`. Alternatively,
27+
# dependencies can be manually updated by changing the version numbers below to
28+
# the latest version available on pub.dev. To see which dependencies have newer
29+
# versions available, run `flutter pub outdated`.
30+
dependencies:
31+
flutter:
32+
sdk: flutter
33+
34+
35+
# The following adds the Cupertino Icons font to your application.
36+
# Use with the CupertinoIcons class for iOS style icons.
37+
cupertino_icons: ^1.0.2
38+
39+
dev_dependencies:
40+
flutter_test:
41+
sdk: flutter
42+
43+
# The "flutter_lints" package below contains a set of recommended lints to
44+
# encourage good coding practices. The lint set provided by the package is
45+
# activated in the `analysis_options.yaml` file located at the root of your
46+
# package. See that file for information about deactivating specific lint
47+
# rules and activating additional ones.
48+
flutter_lints: ^2.0.0
49+
50+
# For information on the generic Dart part of this file, see the
51+
# following page: https://dart.dev/tools/pub/pubspec
52+
53+
# The following section is specific to Flutter packages.
54+
flutter:
55+
56+
# The following line ensures that the Material Icons font is
57+
# included with your application, so that you can use the icons in
58+
# the material Icons class.
59+
uses-material-design: true
60+
61+
# To add assets to your application, add an assets section, like this:
62+
# assets:
63+
# - images/a_dot_burr.jpeg
64+
# - images/a_dot_ham.jpeg
65+
66+
# An image asset can refer to one or more resolution-specific "variants", see
67+
# https://flutter.dev/assets-and-images/#resolution-aware
68+
69+
# For details regarding adding assets from package dependencies, see
70+
# https://flutter.dev/assets-and-images/#from-packages
71+
72+
# To add custom fonts to your application, add a fonts section here,
73+
# in this "flutter" section. Each entry in this list should have a
74+
# "family" key with the font family name, and a "fonts" key with a
75+
# list giving the asset and other descriptors for the font. For
76+
# example:
77+
# fonts:
78+
# - family: Schyler
79+
# fonts:
80+
# - asset: fonts/Schyler-Regular.ttf
81+
# - asset: fonts/Schyler-Italic.ttf
82+
# style: italic
83+
# - family: Trajan Pro
84+
# fonts:
85+
# - asset: fonts/TrajanPro.ttf
86+
# - asset: fonts/TrajanPro_Bold.ttf
87+
# weight: 700
88+
#
89+
# For details regarding fonts from package dependencies,
90+
# see https://flutter.dev/custom-fonts/#from-packages

0 commit comments

Comments
 (0)