-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
committed
Dec 16, 2022
0 parents
commit b270b51
Showing
19 changed files
with
290 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,12 @@ | ||
# Files and directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
|
||
# Conventional directory for build outputs. | ||
build/ | ||
|
||
# Omit committing pubspec.lock for library packages; see | ||
# https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
pubspec.lock | ||
|
||
flutter_web/ |
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,3 @@ | ||
## 1.0.0 | ||
|
||
- Initial version. |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Azka Full Snack Developer:) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,21 @@ | ||
# Webify | ||
|
||
Webify adalah framework web menggunakan bahasa dart dengan feature class dan syntax mirip flutter | ||
|
||
|
||
### Quickstart | ||
|
||
```dart | ||
// ignore_for_file: non_constant_identifier_names | ||
import 'package:webify/webify.dart'; | ||
void main(List<String> arguments) { | ||
runApp( | ||
port: 8080, | ||
bindIp: "0.0.0.0", | ||
app: MyApp(), | ||
); | ||
} | ||
String MyApp() { | ||
return Container(height: 512, width: 512, child: Center(child: Text("Azka dev Webify framework"))); | ||
} | ||
``` |
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,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
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,22 @@ | ||
// import 'alfre'; | ||
import 'dart:io'; | ||
|
||
import "package:alfred/alfred.dart"; | ||
import 'package:webify/webify.dart'; | ||
|
||
void main(List<String> args) async { | ||
Alfred app = Alfred(logLevel: LogType.error); | ||
app.all("/", (req, res) { | ||
res.headers.contentType = ContentType.html; | ||
return """ | ||
<html> | ||
<body> | ||
${Container(height: 512, width: 512, child: Text("Azka ya ini"))} | ||
</body> | ||
</html> | ||
"""; | ||
}); | ||
await app.listen(); | ||
|
||
print(app.server!.address.address); | ||
} |
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,6 @@ | ||
# Files and directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
|
||
# Conventional directory for build output. | ||
build/ |
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,3 @@ | ||
## 1.0.0 | ||
|
||
- Initial version. |
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 @@ | ||
A sample command-line application with an entrypoint in `bin/`, library code | ||
in `lib/`, and example unit test in `test/`. |
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,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
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,14 @@ | ||
// ignore_for_file: non_constant_identifier_names | ||
|
||
import 'package:webify/webify.dart'; | ||
|
||
void main(List<String> arguments) { | ||
runApp( | ||
port: 8080, | ||
bindIp: "0.0.0.0", | ||
app: MyApp(), | ||
); | ||
} | ||
String MyApp() { | ||
return Container(height: 512, width: 512, child: Center(child: Text("Azka dev Webify framework"))); | ||
} |
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,3 @@ | ||
int calculate() { | ||
return 6 * 7; | ||
} |
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,18 @@ | ||
name: example | ||
description: A sample command-line application. | ||
version: 1.0.0 | ||
# homepage: https://www.example.com | ||
publish_to: none | ||
environment: | ||
sdk: '>=2.18.5 <3.0.0' | ||
|
||
dependencies: | ||
webify: | ||
path: ../ | ||
# path: ^1.8.0 | ||
|
||
dev_dependencies: | ||
lints: ^2.0.0 | ||
test: ^1.16.0 | ||
|
||
|
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,8 @@ | ||
import 'package:example/example.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
test('calculate', () { | ||
expect(calculate(), 42); | ||
}); | ||
} |
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,6 @@ | ||
// TODO: Put public facing types in this file. | ||
|
||
/// Checks if you are awesome. Spoiler: you are. | ||
class Awesome { | ||
bool get isAwesome => true; | ||
} |
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,36 @@ | ||
/// Support for doing something awesome. | ||
/// | ||
/// More dartdocs go here. | ||
library webify; | ||
|
||
// import 'alfre'; | ||
import 'dart:io'; | ||
|
||
import "package:alfred/alfred.dart"; | ||
import 'package:webify/webify.dart'; | ||
|
||
export 'src/webify_base.dart'; | ||
|
||
// TODO: Export any libraries intended for clients of this package. | ||
part "widget/container.dart"; | ||
|
||
void runApp({ | ||
int port = 3000, | ||
dynamic bindIp = '0.0.0.0', | ||
dynamic app, | ||
}) async { | ||
Alfred alfred = Alfred(logLevel: LogType.error); | ||
alfred.all("/", (req, res) { | ||
res.headers.contentType = ContentType.html; | ||
return """ | ||
<html> | ||
<body> | ||
${app} | ||
</body> | ||
</html> | ||
"""; | ||
}); | ||
await alfred.listen(port, bindIp); | ||
|
||
print(alfred.server!.address.address); | ||
} |
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,23 @@ | ||
part of webify; | ||
|
||
String Container({double height = 0, double width = 0, dynamic child}) { | ||
return """ | ||
<div style="height:${height}px; width:${width}px; background: #666;"> | ||
${child} | ||
</div> | ||
"""; | ||
} | ||
|
||
String Text(String text) { | ||
return "${text}"; | ||
} | ||
|
||
|
||
String Center({ | ||
dynamic child | ||
}){ | ||
return """ | ||
<center>${child}</center> | ||
"""; | ||
} |
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,16 @@ | ||
name: webify | ||
description: A starting point for Dart libraries or applications. | ||
version: 1.0.0 | ||
# homepage: https://www.example.com | ||
|
||
environment: | ||
sdk: '>=2.18.5 <3.0.0' | ||
|
||
# dependencies: | ||
# path: ^1.8.0 | ||
|
||
dev_dependencies: | ||
lints: ^2.0.0 | ||
test: ^1.16.0 | ||
dependencies: | ||
alfred: ^1.0.0+1 |
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,16 @@ | ||
import 'package:webify/webify.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('A group of tests', () { | ||
final awesome = Awesome(); | ||
|
||
setUp(() { | ||
// Additional setup goes here. | ||
}); | ||
|
||
test('First Test', () { | ||
expect(awesome.isAwesome, isTrue); | ||
}); | ||
}); | ||
} |