Skip to content

Commit 0757601

Browse files
committed
initial commit
0 parents  commit 0757601

16 files changed

+621
-0
lines changed

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# Ignoring native folders of the example as they can be re-generated easily using:
20+
# flutter create --platforms=android,ios,web,windows,macos.
21+
example/**/android/
22+
example/**/ios/
23+
example/**/web/
24+
example/**/windows/
25+
example/**/macos/
26+
example/**/linux/
27+
example/**/.metadata
28+
# Include specific entitlements files which enable internet access
29+
!examples/**/macos/Runner/DebugProfile.entitlements
30+
31+
# The .vscode folder contains launch configuration and tasks you configure in
32+
# VS Code which you may wish to be included in version control, so this line
33+
# is commented out by default.
34+
#.vscode/
35+
36+
# Flutter/Dart/Pub related
37+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
38+
/pubspec.lock
39+
**/doc/api/
40+
.dart_tool/
41+
.packages
42+
build/
43+
.pub-cache/
44+
.pub/
45+
.metadata

.vscode/launch.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "tailor",
9+
"cwd": "example",
10+
"request": "launch",
11+
"type": "dart",
12+
},
13+
{
14+
"name": "tailor (profile mode)",
15+
"cwd": "example",
16+
"request": "launch",
17+
"type": "dart",
18+
"flutterMode": "profile",
19+
},
20+
{
21+
"name": "tailor (release mode)",
22+
"cwd": "example",
23+
"request": "launch",
24+
"type": "dart",
25+
"flutterMode": "release",
26+
}
27+
]
28+
}

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Aman Gupta
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
This README describes the package. If you publish this package to pub.dev,
3+
this README's contents appear on the landing page for your package.
4+
5+
For information about how to write a good package README, see the guide for
6+
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
7+
8+
For general information about developing packages, see the Dart guide for
9+
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
10+
and the Flutter guide for
11+
[developing packages and plugins](https://flutter.dev/developing-packages).
12+
-->
13+
14+
TODO: Put a short description of the package here that helps potential users
15+
know whether this package might be useful for them.
16+
17+
## Features
18+
19+
TODO: List what your package can do. Maybe include images, gifs, or videos.
20+
21+
## Getting started
22+
23+
TODO: List prerequisites and provide or point to information on how to
24+
start using the package.
25+
26+
## Usage
27+
28+
TODO: Include short and useful examples for package users. Add longer examples
29+
to `/example` folder.
30+
31+
```dart
32+
const like = 'sample';
33+
```
34+
35+
## Additional information
36+
37+
TODO: Tell users more about the package: where to find more information, how to
38+
contribute to the package, how to file issues, what response they can expect
39+
from the package authors, and more.

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

example/.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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/
12+
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
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.packages
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Web related
36+
lib/generated_plugin_registrant.dart
37+
38+
# Symbolication related
39+
app.*.symbols
40+
41+
# Obfuscation related
42+
app.*.map.json
43+
44+
# Android Studio will place build artifacts here
45+
/android/app/debug
46+
/android/app/profile
47+
/android/app/release

example/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# example
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13+
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

example/analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:tailor/tailor.dart';
3+
4+
void main() {
5+
runApp(const MyApp());
6+
}
7+
8+
class MyApp extends StatelessWidget {
9+
const MyApp({Key? key}) : super(key: key);
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return MaterialApp(
14+
title: 'Flutter Demo',
15+
theme: ThemeData(
16+
primarySwatch: Colors.blue,
17+
),
18+
home: const MyHomePage(title: 'Flutter Demo Home Page'),
19+
);
20+
}
21+
}
22+
23+
class MyHomePage extends StatefulWidget {
24+
const MyHomePage({Key? key, required this.title}) : super(key: key);
25+
26+
final String title;
27+
28+
@override
29+
State<MyHomePage> createState() => _MyHomePageState();
30+
}
31+
32+
class _MyHomePageState extends State<MyHomePage> {
33+
double _size = 100;
34+
35+
@override
36+
Widget build(BuildContext context) {
37+
return Scaffold(
38+
appBar: TailorAppBar(
39+
builder: (_, size) {
40+
return AppBar(
41+
title: Text('AppBar width: ${size.width} height: ${size.height}'),
42+
);
43+
},
44+
),
45+
body: Center(
46+
child: Tailor(
47+
builder: (_, size, child) {
48+
return Container(
49+
color: Colors.red,
50+
height: _size,
51+
width: _size,
52+
alignment: Alignment.center,
53+
child: Text(
54+
"Size: ${size.toString()}",
55+
textAlign: TextAlign.center,
56+
style: const TextStyle(color: Colors.white),
57+
),
58+
);
59+
},
60+
),
61+
),
62+
floatingActionButton: Row(
63+
mainAxisSize: MainAxisSize.min,
64+
children: [
65+
FloatingActionButton(
66+
onPressed: _decreaseSize,
67+
tooltip: 'Decrease Size',
68+
child: const Icon(Icons.remove),
69+
),
70+
const SizedBox(width: 10),
71+
FloatingActionButton(
72+
onPressed: _increaseSize,
73+
tooltip: 'Increase Size',
74+
child: const Icon(Icons.add),
75+
),
76+
],
77+
),
78+
);
79+
}
80+
81+
void _increaseSize() {
82+
setState(() {
83+
_size += 100;
84+
});
85+
}
86+
87+
void _decreaseSize() {
88+
if (_size <= 100) return;
89+
90+
setState(() {
91+
_size -= 100;
92+
});
93+
}
94+
}

0 commit comments

Comments
 (0)