Skip to content

Commit

Permalink
Setting To Realese
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanroman03 committed Feb 13, 2024
1 parent 44f71e9 commit 919739c
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 75 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.0.1
Init Project

* TODO: Describe initial release.
## 1.0.0
First Version to Use
23 changes: 22 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
TODO: Add your license here.
MIT License

Copyright (c) 2024 Dylan Roman

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.

100 changes: 77 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,93 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
# Rounded Scroll

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
<!-- [![Pub Version](https://img.shields.io/pub/v/rounded_scroll)](https://pub.dev/packages/rounded_scroll) -->

For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
Rounded Scroll is a Flutter package that provides a customizable rounded scrollable container widget with a scroll indicator icon. It is suitable for creating modern UI designs with scrollable content.

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
![Example 1](screenshots/flutter_1.png) ![Example 2](screenshots/flutter_2.png)

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.
- Rounded container with customizable background color.
- Scroll indicator icon that updates dynamically based on scroll direction.
- Easy to integrate into existing Flutter projects.

## Getting started
## Installation

TODO: List prerequisites and provide or point to information on how to
start using the package.
To use this package, add `rounded_scroll` as a dependency in your `pubspec.yaml` file.

```yaml
dependencies:
rounded_scroll: ^1.0.0
```
Then, import the package in your code:
```dart
import 'package:rounded_scroll/rounded_scroll.dart';
```

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
Wrap your content inside a `RoundedScroll` widget and provide a list of children widgets. You can customize the container's background color and padding.

```dart
const like = 'sample';
RoundedScroll(
children: [
// Your child widgets here
],
color: Colors.blue, // Optional: specify background color
padding: EdgeInsets.all(16), // Optional: specify padding
)
```

## Additional information
That's it! Your content will now be displayed inside a rounded scrollable container with a scroll indicator.

## Examples

Here's a simple example of how you can use `RoundedScroll` in your Flutter app:

```dart
import 'package:flutter/material.dart';
import 'package:rounded_scroll/rounded_scroll.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Rounded Scroll Example'),
),
body: RoundedScroll(
children: [
ListTile(
title: Text('Item 1'),
),
ListTile(
title: Text('Item 2'),
),
ListTile(
title: Text('Item 3'),
),
// Add more child widgets as needed
],
color: Colors.green, // Customize background color
padding: EdgeInsets.all(16), // Add padding if necessary
),
),
);
}
}
```

## License

This package is licensed under the [MIT License](LICENSE).

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
## Github Repository
[Github Repository](https://github.com/dylanroman03)
34 changes: 31 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
include: package:flutter_lints/flutter.yaml
# This file configures the analyzer to use the lint rule set from `package:lint`

include: package:lint/strict.yaml # For production apps
# include: package:lint/casual.yaml # For code samples, hackathons and other non-production code
# include: package:lint/package.yaml # Use this for packages with public API


# You might want to exclude auto-generated files from dart analysis
analyzer:
language:
strict-casts: true

exclude:
#- '**.freezed.dart'
- '**.g.dart'

# You can customize the lint rules set to your own liking. A list of all rules
# can be found at https://dart-lang.github.io/linter/lints/options/options.html
linter:
rules:
# Util classes are awesome!
avoid_classes_with_only_static_members: false
sort_constructors_first: true
prefer_double_quotes: false
always_put_required_named_parameters_first: true
prefer_const_constructors: true
prefer_relative_imports: false
use_is_even_rather_than_modulo: false
avoid_web_libraries_in_flutter: false
unnecessary_library_directive: false


# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
36 changes: 25 additions & 11 deletions lib/rounded_scroll.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
/// A customizable rounded scrollable container widget with an icon that updates as you scroll.
/// Useful for modern UI designs in Flutter.
library rounded_scroll;

import 'package:flutter/material.dart';
import 'package:line_awesome_flutter/line_awesome_flutter.dart';

/// A scrollable container with rounded edges.
class RoundedScroll extends StatefulWidget {
const RoundedScroll({
required this.children,
super.key,
this.color,
this.padding,
});

/// The widgets placed inside the scrollable container.
final List<Widget> children;

/// The background color of the container.
final Color? color;

/// The padding of the container.
final EdgeInsetsGeometry? padding;

@override
Expand All @@ -26,19 +35,15 @@ class _RoundedScrollState extends State<RoundedScroll> {
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;

var scrollLine = ScrollLine(
final scrollLine = ScrollLine(
width: size.width,
scrolling: scrolling,
scrollingUp: scrollingUp,
);

return NotificationListener<ScrollNotification>(
onNotification: (notification) {
List scrolls = onNotification(
notification,
scrolling,
scrollingUp,
);
onNotification: (ScrollNotification notification) {
final List<bool> scrolls = onNotification(notification);

setState(() {
scrolling = scrolls[0];
Expand Down Expand Up @@ -66,16 +71,22 @@ class _RoundedScrollState extends State<RoundedScroll> {
}
}

/// Widget representing the scroll line icon.
class ScrollLine extends StatelessWidget {
const ScrollLine({
Key? key,
required this.scrolling,
required this.scrollingUp,
required this.width,
}) : super(key: key);
super.key,
});

/// Indicates whether scrolling is ongoing.
final bool scrolling;

/// Indicates whether scrolling is upward.
final bool scrollingUp;

/// The width of the scroll line.
final double width;

@override
Expand Down Expand Up @@ -103,8 +114,11 @@ class ScrollLine extends StatelessWidget {
}
}

List<dynamic> onNotification(notification, scrolling, scrollingUp) {
String e = notification.toString();
/// Function to handle scroll notifications.
List<bool> onNotification(ScrollNotification notification) {
final String e = notification.toString();
var scrolling = false;
var scrollingUp = false;

if (e.contains('ScrollDirection.reverse')) {
scrolling = true;
Expand Down
41 changes: 5 additions & 36 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: rounded_scroll
description: "Rounded Scroll Widget"
version: 0.0.1
description: Swipe and scroll in style! RoundedScroll is the perfect widget for your modern Flutter designs. Customize it to your liking and watch it update as you navigate!
version: 1.0.0
repository: https://github.com/dylanroman03/RoundedScroll
# homepage:

environment:
Expand All @@ -13,43 +14,11 @@ dependencies:
line_awesome_flutter: ^2.0.0

dev_dependencies:
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
lint: ^2.0.0

# The following section is specific to Flutter packages.
flutter:

# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages
Binary file added screenshots/flutter_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/flutter_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 919739c

Please sign in to comment.