Skip to content

Commit 65b7c1e

Browse files
committed
added inial setup
0 parents  commit 65b7c1e

File tree

78 files changed

+2539
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2539
-0
lines changed

Diff for: .gitignore

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
build/
32+
33+
# Android related
34+
**/android/**/gradle-wrapper.jar
35+
**/android/.gradle
36+
**/android/captures/
37+
**/android/gradlew
38+
**/android/gradlew.bat
39+
**/android/local.properties
40+
**/android/**/GeneratedPluginRegistrant.java
41+
42+
# iOS/XCode related
43+
**/ios/**/*.mode1v3
44+
**/ios/**/*.mode2v3
45+
**/ios/**/*.moved-aside
46+
**/ios/**/*.pbxuser
47+
**/ios/**/*.perspectivev3
48+
**/ios/**/*sync/
49+
**/ios/**/.sconsign.dblite
50+
**/ios/**/.tags*
51+
**/ios/**/.vagrant/
52+
**/ios/**/DerivedData/
53+
**/ios/**/Icon?
54+
**/ios/**/Pods/
55+
**/ios/**/.symlinks/
56+
**/ios/**/profile
57+
**/ios/**/xcuserdata
58+
**/ios/.generated/
59+
**/ios/Flutter/App.framework
60+
**/ios/Flutter/Flutter.framework
61+
**/ios/Flutter/Flutter.podspec
62+
**/ios/Flutter/Generated.xcconfig
63+
**/ios/Flutter/app.flx
64+
**/ios/Flutter/app.zip
65+
**/ios/Flutter/flutter_assets/
66+
**/ios/Flutter/flutter_export_environment.sh
67+
**/ios/ServiceDefinitions.json
68+
**/ios/Runner/GeneratedPluginRegistrant.*
69+
70+
# Exceptions to above rules.
71+
!**/ios/**/default.mode1v3
72+
!**/ios/**/default.mode2v3
73+
!**/ios/**/default.pbxuser
74+
!**/ios/**/default.perspectivev3
75+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

Diff for: .metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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: 8af6b2f038c1172e61d418869363a28dffec3cb4
8+
channel: stable
9+
10+
project_type: package

Diff for: CHANGELOG.md

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

Diff for: LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

Diff for: README.md

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
A flutter package which will help you to create a draggable widget that can be dragged around the screen.
2+
3+
4+
## Features 💚
5+
6+
- Manually Control the position of the widget along with drags.
7+
- Automatically resizes itself when the widget changes
8+
- Highly customizable
9+
- Supports Flutter web as well
10+
11+
## Properties 🔖
12+
13+
```Dart
14+
/// The widget that will be displayed as dragging widget
15+
final Widget child;
16+
17+
/// The horizontal padding around the widget
18+
final double horizontalSapce;
19+
20+
/// The vertical padding around the widget
21+
final double verticalSpace;
22+
23+
/// Intial location of the widget, default to [AnchoringPosition.bottomRight]
24+
final AnchoringPosition initialPosition;
25+
26+
/// Intially should the widget be visible or not, default to [true]
27+
final bool intialVisibility;
28+
29+
/// The top bottom pargin to create the bottom boundary for the widget, for example if you have a [BottomNavigationBar],
30+
/// then you may need to set the bottom boundary so that the draggable button can't get on top of the [BottomNavigationBar]
31+
final double bottomMargin;
32+
33+
/// The top bottom pargin to create the top boundary for the widget, for example if you have a [AppBar],
34+
/// then you may need to set the bottom boundary so that the draggable button can't get on top of the [AppBar]
35+
final double topMargin;
36+
37+
/// Status bar's height, default to 24
38+
final double statusBarHeight;
39+
40+
/// Shadow's border radius for the draggable widget, default to 10
41+
final double shadowBorderRadius;
42+
43+
/// A drag controller to show/hide or move the widget around the screen
44+
final DragController dragController;
45+
46+
/// [BoxShadow] when the widget is not being dragged, default to
47+
/// ```Dart
48+
///const BoxShadow(
49+
/// color: Colors.black38,
50+
/// offset: Offset(0, 4),
51+
/// blurRadius: 2,
52+
/// ),
53+
/// ```
54+
55+
final BoxShadow normalShadow;
56+
57+
/// [BoxShadow] when the widget is being dragged
58+
///```Dart
59+
///const BoxShadow(
60+
/// color: Colors.black38,
61+
/// offset: Offset(0, 10),
62+
/// blurRadius: 10,
63+
/// ),
64+
/// ```
65+
final BoxShadow draggingShadow;
66+
67+
/// How much should the [DraggableWidget] be scaled when it is being dragged, default to 1.1
68+
final double dragAnimationScale;
69+
70+
```
71+
72+
**AnchoringPosition can be among these 4 types**
73+
74+
``` Dart
75+
enum AnchoringPosition {
76+
topLeft,
77+
topRight,
78+
bottomLeft,
79+
bottomRight,
80+
}
81+
```
82+
83+
**How to use**
84+
```Dart
85+
Stack(
86+
children:[
87+
// other widgets...
88+
DraggableWidget(
89+
bottomMargin: 80,
90+
topMargin: 80,
91+
intialVisibility: true,
92+
horizontalSapce: 20,
93+
shadowBorderRadius: 50,
94+
child: Container(
95+
height: 100,
96+
width: 100,
97+
decoration: BoxDecoration(
98+
shape: BoxShape.circle,
99+
color: Colors.blue,
100+
),
101+
),
102+
initialPosition: AnchoringPosition.bottomLeft,
103+
dragController: dragController,
104+
)
105+
]
106+
)
107+
```
108+
109+
**DragController Fucntionality**
110+
```Dart
111+
/// Jump to any [AnchoringPosition] programatically
112+
void jumpTo(AnchoringPosition anchoringPosition)
113+
114+
/// Get the current screen [Offset] of the widget
115+
Offset getCurrentPosition()
116+
117+
/// Makes the widget visible
118+
void showWidget()
119+
120+
/// Hide the widget
121+
void hideWidget()
122+
```
123+
124+
run the example app in the exmaple folder to find out more about how to use it.

Diff for: demo/demo.gif

345 KB
Loading

Diff for: example/.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
/build/
32+
33+
# Web related
34+
lib/generated_plugin_registrant.dart
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Exceptions to above rules.
43+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

Diff for: example/.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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: 8af6b2f038c1172e61d418869363a28dffec3cb4
8+
channel: stable
9+
10+
project_type: app

Diff for: 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://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13+
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

Diff for: example/android/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java

Diff for: example/android/app/build.gradle

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion 28
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
34+
35+
lintOptions {
36+
disable 'InvalidPackage'
37+
}
38+
39+
defaultConfig {
40+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41+
applicationId "com.example.example"
42+
minSdkVersion 16
43+
targetSdkVersion 28
44+
versionCode flutterVersionCode.toInteger()
45+
versionName flutterVersionName
46+
}
47+
48+
buildTypes {
49+
release {
50+
// TODO: Add your own signing config for the release build.
51+
// Signing with the debug keys for now, so `flutter run --release` works.
52+
signingConfig signingConfigs.debug
53+
}
54+
}
55+
}
56+
57+
flutter {
58+
source '../..'
59+
}
60+
61+
dependencies {
62+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63+
}

Diff for: example/android/app/src/debug/AndroidManifest.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>

0 commit comments

Comments
 (0)