Skip to content

Commit

Permalink
Merge pull request #22 from Frezyx/dev
Browse files Browse the repository at this point in the history
0.5.3 update
  • Loading branch information
Frezyx authored Dec 4, 2020
2 parents f52a716 + f810c70 commit bad071a
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 38 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.5.3 - 4-12-2020

* Added new usage examples
* Update documentation

## 0.5.2 - 4-12-2020

* Added selectedItemIconSize field in BottomBarTheme class
* Remove ci/cd logic from travis to GithubActions

## 0.5.1 - 5-11-2020

### Created Widget tests
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@

| ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example1.gif?raw=true) | ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example2.gif?raw=true) | ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example3.gif?raw=true) |
| :------------: | :------------: | :------------: |
| ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example4.gif?raw=true) | ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example5.gif?raw=true) | ![Image](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/example/rep_files/example6.gif?raw=true) |


## Getting Started

### Add dependency

```yaml
dependencies:
bottom_bar_with_sheet: ^0.5.1
bottom_bar_with_sheet: ^0.5.3
```
### Add import package
Expand Down Expand Up @@ -61,6 +63,8 @@ Scaffold(
);
```

**More examples you can see** [here](https://github.com/Frezyx/bottom_bar_with_sheet/tree/master/example/lib)

## Attributes

| Attribute | Type | Annotation |
Expand Down Expand Up @@ -96,6 +100,7 @@ Scaffold(
| 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 |

## Attributes of MainActionButtonTheme
Expand Down
2 changes: 1 addition & 1 deletion example/lib/examples/custom_main_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('bottom_bar_with_sheet v0.5.1',
title: Text('bottom_bar_with_sheet v0.5.3',
style: TextStyle().copyWith(color: Colors.white)),
),
body: Center(child: Text("Place for your content")),
Expand Down
14 changes: 13 additions & 1 deletion example/lib/examples/fab_outside_bottom_bar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
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();
Expand All @@ -15,7 +27,7 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
backgroundColor: Color(0xFFFFEEEE),
appBar: AppBar(
title: Text('bottom_bar_with_sheet v0.5.1',
title: Text('bottom_bar_with_sheet v0.5.3',
style: TextStyle().copyWith(color: Colors.white)),
backgroundColor: Color(0xFFFF8D8D),
),
Expand Down
92 changes: 92 additions & 0 deletions example/lib/examples/v0.6.0-beta-preview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
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.indigo[900],
body: Padding(
padding: const EdgeInsets.all(36.0).copyWith(top: 60.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bottom Bar With Sheet",
style: TextStyle(
color: Colors.white,
fontSize: 42.0,
fontWeight: FontWeight.w900,
),
),
SizedBox(height: 10.0),
Text(
"v 0.6.0-beta",
style: TextStyle(
color: Colors.white,
fontSize: 36.0,
fontWeight: FontWeight.w300,
),
),
],
),
),
bottomNavigationBar: Padding(
padding: const EdgeInsets.only(bottom: 30),
child: BottomBarWithSheet(
selectedIndex: _selectedIndex,
sheetChild: Center(child: Text("Place for your another content")),
curve: Curves.easeOutExpo,
duration: Duration(seconds: 1),
bottomBarTheme: BottomBarTheme(
mainButtonPosition: MainButtonPosition.Middle,
selectedItemIconColor: Colors.blue,
selectedItemBackgroundColor: Colors.transparent,
selectedItemIconSize: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.03),
blurRadius: 15.0,
spreadRadius: 3.0,
offset: Offset(5.0, 5.0),
)
],
),
),
mainActionButton: MainActionButton(
width: 50,
child: FlutterLogo(size: 50),
),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [
BottomBarWithSheetItem(icon: Icons.home),
BottomBarWithSheetItem(icon: Icons.favorite),
BottomBarWithSheetItem(icon: Icons.folder),
BottomBarWithSheetItem(icon: Icons.settings),
],
),
),
);
}
}
77 changes: 77 additions & 0 deletions example/lib/examples/without_background_bar_items_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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.grey[100],
appBar: AppBar(
backgroundColor: Colors.purple,
title: Text('bottom_bar_with_sheet v0.5.3',
style: TextStyle(color: Colors.white)),
),
body: Center(child: Text("Place for your content")),
bottomNavigationBar: BottomBarWithSheet(
selectedIndex: _selectedIndex,
sheetChild: Center(
child: Text("Place for your another content",
style: TextStyle(color: Colors.white))),
bottomBarTheme: BottomBarTheme(
backgroundColor: Colors.purple,
itemIconColor: Colors.white,
selectedItemIconColor: Colors.white,
selectedItemBackgroundColor: Colors.purple,
height: 70,
heightClosed: 80,
mainButtonPosition: MainButtonPosition.Middle,
selectedItemIconSize: 20,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 10.0,
spreadRadius: 3.0,
offset: Offset(5.0, 5.0),
)
],
),
),
mainActionButton: MainActionButton(
width: 50,
child: Icon(
Icons.menu,
color: Colors.white,
size: 30,
),
),
onSelectItem: (index) => setState(() => _selectedIndex = index),
items: [
BottomBarWithSheetItem(icon: Icons.people),
BottomBarWithSheetItem(icon: Icons.shopping_cart),
BottomBarWithSheetItem(icon: Icons.settings),
BottomBarWithSheetItem(icon: Icons.favorite),
],
),
);
}
}
2 changes: 1 addition & 1 deletion 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: "0.5.1"
version: "0.5.3"
characters:
dependency: transitive
description:
Expand Down
Binary file added example/rep_files/example4.gif
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 example/rep_files/example5.gif
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 example/rep_files/example6.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 0 additions & 30 deletions example/test/widget_test.dart

This file was deleted.

8 changes: 5 additions & 3 deletions lib/src/bottom_bar_with_sheet_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class BottomBarWithSheetItem extends StatelessWidget {
);
}

Widget _buildOpenedButton(IconData icon, Color selectedItemIconColor) {
Widget _buildOpenedButton(
IconData icon, Color selectedItemIconColor, double selectedItemIconSize) {
return Center(
child: ClipOval(
child: Material(
Expand All @@ -69,7 +70,7 @@ class BottomBarWithSheetItem extends StatelessWidget {
padding: const EdgeInsets.all(12.0),
child: Icon(
icon,
size: 17,
size: selectedItemIconSize,
color: selectedItemIconColor,
),
)),
Expand Down Expand Up @@ -112,7 +113,8 @@ class BottomBarWithSheetItem extends StatelessWidget {
double iconTopSpacer = isSelected ? 0 : 2;
Widget labelWidget = _buildText(label);
Widget iconAreaWidget = isSelected
? _buildOpenedButton(icon, _bottomBarTheme.selectedItemIconColor)
? _buildOpenedButton(icon, _bottomBarTheme.selectedItemIconColor,
_bottomBarTheme.selectedItemIconSize)
: _buildClosedButton(icon);

return AnimatedContainer(
Expand Down
4 changes: 4 additions & 0 deletions lib/src/bottom_bar_with_sheet_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class BottomBarTheme {
/// [EdgeInsets] to create padding between content of widget and sides
final EdgeInsets contentPadding;

/// [double] size of item icon when item is pressed
final double selectedItemIconSize;

static const _selectedItemDefaultTextStyle = TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w500,
Expand Down Expand Up @@ -109,5 +112,6 @@ class BottomBarTheme {
borderRadius: _defaultBorderRadius,
boxShadow: _defaultboxShadow,
),
this.selectedItemIconSize = 17,
});
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: bottom_bar_with_sheet
description: This package help you to create bottom bar with FloatingActionButton which buld BottomSheet widget on every page.
version: 0.5.1
version: 0.5.3
author: youngfrezyx@gmail.com
homepage: https://github.com/Frezyx/bottom_bar_with_sheet

Expand Down

0 comments on commit bad071a

Please sign in to comment.