diff --git a/CHANGELOG.md b/CHANGELOG.md index 359f119..3a61aff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 7b95549..2a982da 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ | ![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 @@ -16,7 +18,7 @@ ```yaml dependencies: - bottom_bar_with_sheet: ^0.5.1 + bottom_bar_with_sheet: ^0.5.3 ``` ### Add import package @@ -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 | @@ -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 diff --git a/example/lib/examples/custom_main_action_button.dart b/example/lib/examples/custom_main_action_button.dart index 2233430..df54eb6 100644 --- a/example/lib/examples/custom_main_action_button.dart +++ b/example/lib/examples/custom_main_action_button.dart @@ -25,7 +25,7 @@ class _MyHomePageState extends State { 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")), diff --git a/example/lib/examples/fab_outside_bottom_bar.dart b/example/lib/examples/fab_outside_bottom_bar.dart index 3c824e1..a3ddf13 100644 --- a/example/lib/examples/fab_outside_bottom_bar.dart +++ b/example/lib/examples/fab_outside_bottom_bar.dart @@ -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(); @@ -15,7 +27,7 @@ class _MyHomePageState extends State { 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), ), diff --git a/example/lib/examples/v0.6.0-beta-preview.dart b/example/lib/examples/v0.6.0-beta-preview.dart new file mode 100644 index 0000000..f62ebf1 --- /dev/null +++ b/example/lib/examples/v0.6.0-beta-preview.dart @@ -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 { + 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), + ], + ), + ), + ); + } +} diff --git a/example/lib/examples/without_background_bar_items_example.dart b/example/lib/examples/without_background_bar_items_example.dart new file mode 100644 index 0000000..96a46f9 --- /dev/null +++ b/example/lib/examples/without_background_bar_items_example.dart @@ -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 { + 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), + ], + ), + ); + } +} diff --git a/example/pubspec.lock b/example/pubspec.lock index 21df368..0a79d53 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -21,7 +21,7 @@ packages: path: ".." relative: true source: path - version: "0.5.1" + version: "0.5.3" characters: dependency: transitive description: diff --git a/example/rep_files/example4.gif b/example/rep_files/example4.gif new file mode 100644 index 0000000..1f1fda8 Binary files /dev/null and b/example/rep_files/example4.gif differ diff --git a/example/rep_files/example5.gif b/example/rep_files/example5.gif new file mode 100644 index 0000000..3555bbc Binary files /dev/null and b/example/rep_files/example5.gif differ diff --git a/example/rep_files/example6.gif b/example/rep_files/example6.gif new file mode 100644 index 0000000..0545f03 Binary files /dev/null and b/example/rep_files/example6.gif differ diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart deleted file mode 100644 index 747db1d..0000000 --- a/example/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:example/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/lib/src/bottom_bar_with_sheet_item.dart b/lib/src/bottom_bar_with_sheet_item.dart index 5ccdd4a..2b74e4c 100644 --- a/lib/src/bottom_bar_with_sheet_item.dart +++ b/lib/src/bottom_bar_with_sheet_item.dart @@ -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( @@ -69,7 +70,7 @@ class BottomBarWithSheetItem extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Icon( icon, - size: 17, + size: selectedItemIconSize, color: selectedItemIconColor, ), )), @@ -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( diff --git a/lib/src/bottom_bar_with_sheet_theme.dart b/lib/src/bottom_bar_with_sheet_theme.dart index d89048c..0decc71 100644 --- a/lib/src/bottom_bar_with_sheet_theme.dart +++ b/lib/src/bottom_bar_with_sheet_theme.dart @@ -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, @@ -109,5 +112,6 @@ class BottomBarTheme { borderRadius: _defaultBorderRadius, boxShadow: _defaultboxShadow, ), + this.selectedItemIconSize = 17, }); } diff --git a/pubspec.yaml b/pubspec.yaml index f18b867..1490780 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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