Skip to content

Commit

Permalink
Merge pull request #47 from Frezyx/refactoring
Browse files Browse the repository at this point in the history
Release version 2.0.0 🚀
  • Loading branch information
Frezyx authored Jul 25, 2021
2 parents a8109fb + 126cf51 commit ee7764b
Show file tree
Hide file tree
Showing 36 changed files with 718 additions and 994 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## 1.1.0 - 25-04-2021
## 2.0.0

- **BREAKING**: Implement BottomBarWithSheetController for working with items selection!
- **BREAKING**: Delete iconOpened, itemWidth, selectedItemLabelColor, itemLabelColor,selectedItemBackgroundColor fields
- **FEAT**: Refactor all old code base (shit code)! Now everything works faster and more convenient to upgrading
- **FEAT**: Now BottomBarWithSheetItem is model to create widget
- **FEAT**: MainActionButton now common Widget
- **FIX**: Update theme of widget
- **FIX**: Fix widgets tree scheme

## 1.1.1 - 25-04-2021

* Fix analyser issues
* Refactor provider naming
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

```yaml
dependencies:
bottom_bar_with_sheet: ^1.1.1
bottom_bar_with_sheet: ^2.0.0
```
### Add import package
Expand Down Expand Up @@ -94,11 +94,8 @@ Scaffold(
| backgroundColor | Color | **BottomBarWithSheet** background color |
| selectedItemIconColor | Color | selected item icon color |
| itemIconColor | Color | unselected item icon color |
| selectedItemLabelColor | Color | selected item text color |
| itemLabelColor | Color | unselected item text color |
| selectedItemTextStyle | Color | selected item text style |
| itemTextStyle | Color | unselected item text style |
| selectedItemBackgroundColor | Color | selected item icon color |
| selectedItemIconSize | double | size of item icon when item is pressed |
| mainButtonPosition | enum | filed that response for the position of MainActionButton position this field have 3 possible values: MainButtonPosition.left, MainButtonPosition.right , MainButtonPosition.Center |

Expand All @@ -107,8 +104,7 @@ Scaffold(
| Attribute | Type | Annotation |
| ------------- | ------------- | ------------- |
| size | double | size of button |
| icon | Widget | icon that displayed when the **BottomBarWithSheet** when **isOpened** == false |
| iconOpened | Widget | icon that displayed when the **BottomBarWithSheet** when **isOpened** == true |
| icon | Widget | icon that displayed in center of MainActionButton |
| color | Color | background color of widget circle |
| splash | Color | splash color of widget circle |
| margin | EdgeInsets | side paddings of **Main Action Button** |
Expand Down
22 changes: 16 additions & 6 deletions example/lib/examples/custom_main_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,33 @@ class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[200],
body: Center(child: Text("Place for your content")),
bottomNavigationBar: BottomBarWithSheet(
selectedIndex: _selectedIndex,
sheetChild: Center(child: Text("Place for your another content")),
bottomBarTheme: BottomBarTheme(
height: 70,
heightClosed: 100,
heightClosed: 70,
mainButtonPosition: MainButtonPosition.middle,
itemIconColor: Colors.grey,
selectedItemIconColor: Colors.red,
),
mainActionButtonTheme: MainActionButtonTheme(
icon: null,
transform: Matrix4.translationValues(0, -30, 0),
),
mainActionButton: MainActionButton(
width: 100,
child: Image.asset(
'assets/images/vinyl.png',
mainActionButton: Container(
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 25),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
child: Text(
'Open',
style: TextStyle(
color: Colors.white,
fontSize: 20,
),
),
),
onSelectItem: (index) => setState(() => _selectedIndex = index),
Expand Down
4 changes: 1 addition & 3 deletions example/lib/examples/fab_outside_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
backgroundColor: Color(0xFFFF8D8D),
selectedItemBackgroundColor: Color(0xFFFF8D8D),
selectedItemIconColor: Colors.white,
itemIconColor: Colors.white,
itemLabelColor: Colors.white,
selectedItemLabelColor: Colors.white,
itemTextStyle:
TextStyle().copyWith(fontSize: 10, fontWeight: FontWeight.w300),
heightOpened: 250,
Expand All @@ -64,6 +61,7 @@ class _MyHomePageState extends State<MyHomePage> {
mainActionButtonTheme:
MainActionButtonTheme(icon: Icon(Icons.arrow_upward_outlined)),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [],
),
floatingActionButton: FloatingActionButton(
backgroundColor: Color(0xFFFF8D8D),
Expand Down
6 changes: 1 addition & 5 deletions example/lib/examples/future/v1.0.0-beta-preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class _MyHomePageState extends State<MyHomePage> {
bottomBarTheme: BottomBarTheme(
mainButtonPosition: MainButtonPosition.middle,
selectedItemIconColor: Colors.blue,
selectedItemBackgroundColor: Colors.transparent,
selectedItemIconSize: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
Expand All @@ -74,10 +73,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
),
mainActionButton: MainActionButton(
width: 50,
child: FlutterLogo(size: 50),
),
mainActionButton: FlutterLogo(size: 50),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [
BottomBarWithSheetItem(icon: Icons.home),
Expand Down
1 change: 0 additions & 1 deletion example/lib/examples/left_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class _MyHomePageState extends State<MyHomePage> {
heightOpened: 300,
backgroundColor: Colors.grey[900],
mainButtonPosition: MainButtonPosition.left,
selectedItemBackgroundColor: Colors.transparent,
selectedItemIconColor: Colors.green,
itemIconColor: Colors.white,
selectedItemIconSize: 20,
Expand Down
1 change: 0 additions & 1 deletion example/lib/examples/right_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class _MyHomePageState extends State<MyHomePage> {
heightOpened: 500,
backgroundColor: Colors.white,
mainButtonPosition: MainButtonPosition.right,
selectedItemBackgroundColor: Colors.orange,
selectedItemIconColor: Colors.white,
itemIconColor: Colors.grey[500],
selectedItemIconSize: 20,
Expand Down
12 changes: 4 additions & 8 deletions example/lib/examples/use_cases/tasks_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.white,
itemIconColor: Colors.grey[500],
selectedItemIconColor: Colors.grey[900],
selectedItemBackgroundColor: Colors.white,
height: 70,
heightClosed: 80,
heightOpened: 300,
Expand All @@ -110,13 +109,10 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
),
mainActionButton: MainActionButton(
width: 50,
child: Icon(
Icons.add,
color: Colors.grey[900],
size: 30,
),
mainActionButton: Icon(
Icons.add,
color: Colors.grey[900],
size: 30,
),
onSelectItem: (index) {
setState(() => _selectedIndex = index);
Expand Down
14 changes: 5 additions & 9 deletions example/lib/examples/without_background_bar_items_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.grey[100],
appBar: AppBar(
backgroundColor: Colors.purple,
title: Text('bottom_bar_with_sheet v1.1.0',
title: Text('bottom_bar_with_sheet v2.0.0',
style: TextStyle(color: Colors.white)),
),
body: Center(child: Text("Place for your content")),
Expand All @@ -40,7 +40,6 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.purple,
itemIconColor: Colors.white,
selectedItemIconColor: Colors.white,
selectedItemBackgroundColor: Colors.purple,
height: 70,
heightClosed: 80,
mainButtonPosition: MainButtonPosition.middle,
Expand All @@ -56,13 +55,10 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
),
mainActionButton: MainActionButton(
width: 50,
child: Icon(
Icons.menu,
color: Colors.white,
size: 30,
),
mainActionButton: Icon(
Icons.menu,
color: Colors.white,
size: 30,
),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [
Expand Down
106 changes: 27 additions & 79 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
int _selectedIndex = 0;
final _bottomBarController = BottomBarWithSheetController(initialIndex: 0);

@override
void initState() {
_bottomBarController.itemsStream.listen((i) {
print('Index $i is selcted');
});
super.initState();
}

@override
Widget build(BuildContext context) {
Expand All @@ -41,7 +49,24 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
bottomNavigationBar: BottomBarWithSheet(
selectedIndex: _selectedIndex,
controller: _bottomBarController,
bottomBarTheme: BottomBarTheme(
mainButtonPosition: MainButtonPosition.middle,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(25)),
),
itemIconColor: Colors.grey,
itemTextStyle: TextStyle(
color: Colors.grey,
fontSize: 10.0,
),
selectedItemTextStyle: TextStyle(
color: Colors.blue,
fontSize: 10.0,
),
),
onSelectItem: (index) => print(index),
sheetChild: Center(
child: Text(
"Another content",
Expand All @@ -52,7 +77,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [
BottomBarWithSheetItem(icon: Icons.people),
BottomBarWithSheetItem(icon: Icons.shopping_cart),
Expand All @@ -63,79 +87,3 @@ class _MyHomePageState extends State<MyHomePage> {
);
}
}

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

// void main() => runApp(MyApp());

// class MyApp extends StatelessWidget {
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// debugShowCheckedModeBanner: false,
// home: MyHomePage(),
// );
// }
// }

// class MyHomePage extends StatefulWidget {
// @override
// _MyHomePageState createState() => _MyHomePageState();
// }

// class _MyHomePageState extends State<MyHomePage> {
// int _selectedIndex = 0;

// @override
// Widget build(BuildContext context) {
// return Scaffold(
// backgroundColor: Colors.blue,
// body: Center(
// child: Text(
// "Place for your content",
// style: TextStyle(
// color: Colors.white,
// fontSize: 20,
// fontWeight: FontWeight.w900,
// ),
// ),
// ),
// bottomNavigationBar: BottomBarWithSheet(
// selectedIndex: _selectedIndex,
// sheetChild: Center(
// child: Text(
// "Another content",
// style: TextStyle(
// color: Colors.grey[600],
// fontSize: 20,
// fontWeight: FontWeight.w900,
// ),
// ),
// ),
// bottomBarTheme: BottomBarTheme(
// mainButtonPosition: MainButtonPosition.middle,
// selectedItemBackgroundColor: Colors.white,
// selectedItemIconColor: Colors.blue,
// selectedItemIconSize: 20,
// ),
// mainActionButtonTheme: MainActionButtonTheme(
// size: 55,
// icon: Icon(
// Icons.add,
// color: Colors.white,
// size: 35,
// ),
// ),
// onSelectItem: (index) => setState(() => _selectedIndex = index),
// items: [
// BottomBarWithSheetItem(icon: Icons.people),
// BottomBarWithSheetItem(icon: Icons.shopping_cart),
// BottomBarWithSheetItem(icon: Icons.settings),
// BottomBarWithSheetItem(icon: Icons.favorite),
// ],
// ),
// );
// }
// }
//
17 changes: 1 addition & 16 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.1"
version: "2.0.0"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -88,27 +88,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
provider:
dependency: transitive
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -172,4 +158,3 @@ packages:
version: "2.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.16.0"
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.1+1
version: 2.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down
Loading

0 comments on commit ee7764b

Please sign in to comment.