Git Product home page Git Product logo

convex_bottom_bar's Introduction

appBar preview

pub.dev github coverage likes popularity build status license

English | 简体中文


The official BottomAppBar can only display a notch FAB with an app bar, and sometimes we need a convex FAB. BottomAppBar and NotchShape's implementation inspires this ConvexAppBar.

Online example can be found at https://appbar.codemagic.app.

convex_bottom_bar is now a Flutter Favorite package!

Here are some supported style:

fixed react badge chip
fixedCircle reactCircle flip
textIn titled tab image
button fixed corner

How to use

Typically ConvexAppBar can work with Scaffold by setup its bottomNavigationBar.

The ConvexAppBar has two constructors. The ConvexAppBar() will use the default style to simplify the tab creation.

Add this to your package's pubspec.yaml file, use the latest version Pub:

dependencies:
  convex_bottom_bar: ^latest_version
import 'package:convex_bottom_bar/convex_bottom_bar.dart';

Scaffold(
  bottomNavigationBar: ConvexAppBar(
    items: [
      TabItem(icon: Icons.home, title: 'Home'),
      TabItem(icon: Icons.map, title: 'Discovery'),
      TabItem(icon: Icons.add, title: 'Add'),
      TabItem(icon: Icons.message, title: 'Message'),
      TabItem(icon: Icons.people, title: 'Profile'),
    ],
    onTap: (int i) => print('click index=$i'),
  )
);

Flutter Version Support
As Flutter is developing fast. There can be breaking changes. We will be trying to support the stable version and beta version through different package versions.

Stable Flutter Version Package Version More
>=3.7.0 >=3.2.0 Since v3.7.0, the stable version changed the DefaultTabController api
>=1.20 >=2.4.0 Since v1.20, the stable version changed the Stack api
<1.20 <=2.3.0 Support for stable version such as v1.17, v1.12 is not going to be updated

Features

  • Provide multiple internal styles
  • Ability to change the theme of AppBar
  • Provide builder API to customize a new style
  • Add badge on the tab menu
  • Elegant transition animation
  • Provide hook API to override some of the internal styles
  • RTL support

Table of contents

Theming

The bar will use default style, you may want to theme it. Here are some supported attributes:

Attributes Description
backgroundColor AppBar background
gradient gradient will override backgroundColor
height AppBar height
color tab icon/text color
activeColor tab icon/text color when selected
curveSize size of the convex shape
top top edge of the convex shape relative to AppBar
cornerRadius draw the background with topLeft and topRight corner; Only work with fixed tab style
style style to describe the convex shape: fixed, fixedCircle, react, reactCircle, ...
chipBuilder custom badge builder, use ConvexAppBar.badge for default badge

Badge

If you need to add a badge on the tab, use the ConvexAppBar.badge to get it done.

badge demo

ConvexAppBar.badge({0: '99+', 1: Icons.assistant_photo, 2: Colors.redAccent},
  items: [
    TabItem(icon: Icons.home, title: 'Home'),
    TabItem(icon: Icons.map, title: 'Discovery'),
    TabItem(icon: Icons.add, title: 'Add'),
  ],
  onTap: (int i) => print('click index=$i'),
);

The badge() method accepts an array of badges; The badges is a map with tab items. Each value of entry can be either String, IconData, Color or Widget.

Single Button

If you only need a single button, checkout the ConvexButton.

button

Scaffold(
  appBar: AppBar(title: const Text('ConvexButton Example')),
  body: Center(child: Text('count $count')),
  bottomNavigationBar: ConvexButton.fab(
    onTap: () => setState(() => count++),
  ),
);

Style Hook

Hook for internal tab style. Unlike the ConvexAppBar.builder, you may want to update the tab style without defining a new tab style.

Warning:
This hook is limited and can lead to overflow broken if the size you provide does not match with internal style.

StyleProvider(
  style: Style(),
  child: ConvexAppBar(
    initialActiveIndex: 1,
    height: 50,
    top: -30,
    curveSize: 100,
    style: TabStyle.fixedCircle,
    items: [
      TabItem(icon: Icons.link),
      TabItem(icon: Icons.import_contacts),
      TabItem(title: "2020", icon: Icons.work),
    ],
    backgroundColor: _tabBackgroundColor,
  ),
)
class Style extends StyleHook {
  @override
  double get activeIconSize => 40;

  @override
  double get activeIconMargin => 10;

  @override
  double get iconSize => 20;

  @override
  TextStyle textStyle(Color color) {
    return TextStyle(fontSize: 20, color: color);
  }
}

RTL Support

RTL is supported internally, and if you define the TextDirection inside the app, the AppBar should work fine. Both RTL and LTR can be configured through Directionality:

Directionality(
  textDirection: TextDirection.rtl,
  child: Scaffold(body:ConvexAppBar(/*TODO ...*/)),
)

Custom Example

If the default style does not match your situation, try with ConvexAppBar.builder(), allowing you to custom nearly all the tab features.

Scaffold(
  bottomNavigationBar: ConvexAppBar.builder(
    count: 5,
    backgroundColor: Colors.blue,
    itemBuilder: Builder(),
  )
);

// user defined class
class Builder extends DelegateBuilder {
  @override
  Widget build(BuildContext context, int index, bool active) {
    return Text('TAB $index');
  }
}

Full custom example can be found at example.

FAQ

Please file feature requests and bugs at the issue tracker.

Donate

You like the package ? Buy me a coffee :)

ko-fi

convex_bottom_bar's People

Contributors

aakira avatar avenwu avatar hidrodixtion avatar j-j-gajjar avatar moein-keyvani-pur avatar qixotic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

convex_bottom_bar's Issues

Replacement of overflow in Stack widget with clipbehaviour in Flutter v1.20

Describe the bug
Hi, first of thanks for this wonderful package! I think this package have problem after update to Flutter 1.20. The Flutter team have replace the overflow with clip behaviour but this package is still using it(https://api.flutter.dev/flutter/widgets/Stack/overflow.html). Below is the error I get
image

Environment details
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.0, on Microsoft Windows [Version 10.0.18363.959], locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.47.3)
[√] VS Code, 64-bit edition (version 1.47.2)
[√] Connected device (1 available)
Paste the package version.

dependencies:
convex_bottom_bar: ^2.3.0

**To Reproduce**

Steps to reproduce the behavior:
1. Just update Flutter to latest 1.20 in stable
2. Run the example project


**Expected behavior**
Should works 

Flutter team new annocement for clip behaviour
https://docs.google.com/document/d/1gC5Di4ykTCqupD77PWpy9D8xXo0Ide5CnrH0zzVIhKo/edit#heading=h.pub7jnop54q0

The active icon is reset when returning with Navigator.push after Navigator.push.

I used this to create a custom appbar.

It looks good, but has the following issues:

The active icon is reset when returning with Navigator.push after Navigator.push.

Here is my code. What's wrong.

class _CustomBuilder extends DelegateBuilder {
  _CustomBuilder(this.items);

  final List<TabItem> items;

  @override
  Widget build(BuildContext context, int index, bool active) {
    final navigationItem = items[index];
    final _color = active ? Colors.red : const Color(0xff9F9F9F);
    if (index == items.length ~/ 2) {
      return Container(
        width: 80,
        height: 80,
        padding: const EdgeInsets.only(bottom: 2),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            Icon(
              Icons.trending_up,
              size: 45, //35
              color: _color,
            ),
            Text(
              'TEXT',
              style: TextStyle(
                color: _color,
                fontSize: 11,
              ),
            ),
          ],
        ),
      );
    }

    final dynamic _icon = active
        ? navigationItem.activeIcon ?? navigationItem.icon
        : navigationItem.icon;
    return Container(
      color: Colors.transparent,
      padding: const EdgeInsets.only(bottom: 2),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
          Icon(
            _icon,
            color: _color,
          ),
          Text(
            navigationItem.title,
            style: TextStyle(
              color: _color,
              fontSize: 11,
            ),
          )
        ],
      ),
    );
  }

  @override
  bool fixed() {
    return true;
  }
}

Compiling on Macos fails

Describe the bug

I tried to compile for Macos Desktop and the compilation fails.

Environment details

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G73, locale en-GB)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.47.2)
[✓] Connected device (3 available)

• No issues found!
flutter --version
Flutter 1.21.0-1.0.pre • channel dev • https://github.com/flutter/flutter.git
Framework • revision f25bd9c55c (10 days ago) • 2020-07-14 20:26:01 -0400
Engine • revision 99c2b3a245
Tools • Dart 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)
dependencies:
  convex_bottom_bar: 2.3.0

Additional context

Using flutter run in verbose mode I get the following related to the project:

[  +25 ms] ../../../SOFTWARE/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:69:13: Error: No named
parameter with the name 'overflow'.
[        ]             overflow: overflow);
[        ]             ^^^^^^^^
[  +14 ms] ../../../SOFTWARE/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:73:9: Error: The getter
'overflow' isn't defined for the class '_RenderStack'.
[        ]  - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart'
('../../../SOFTWARE/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart').
[        ] Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
[        ]     if (overflow == Overflow.visible || size.contains(position)) {

Bad behavior when used when tab controller

Describe the bug

When you use the bottom bar together with the tab controller, if you slide the table controller (from the right to the left), the icons in the bottom bar goes to the first one and then move back to the correct icon.
this is the example code:
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(AppStrings.appBarTitle),
actions: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: IconButton(
icon: Icon(Icons.send),
onPressed: () {
checkAndSendData();
},
),
)
],
),
//
body: TabBarView(
children: _kTabPages,
),
bottomNavigationBar: ConvexAppBar(
backgroundColor: Theme.of(context).primaryColor,
height: 60,
items: [
TabItem(
icon: FontAwesomeIcons.infoCircle,
title: AppStrings.stepOneIcon),
TabItem(
icon: FontAwesomeIcons.peopleArrows,
title: AppStrings.stepTwoIcon),
TabItem(
icon: FontAwesomeIcons.handsWash,
title: AppStrings.stepThreeIcon),
],
onTap: (int i) => print('click index=$i'),
)),

Stack.dart clipBehavior is Error

Compiler message:
../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart:43:11: Error: No named parameter with the name 'clipBehavior'.
clipBehavior: clipBehavior,
^^^^^^^^^^^^
../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart:53:21: Error: The getter 'clipBehavior' isn't defined for the class 'Stack'.

  • 'Stack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'clipBehavior'.
    clipBehavior: clipBehavior,
    ^^^^^^^^^^^^
    ../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart:70:11: Error: No named parameter with the name 'clipBehavior'.
    clipBehavior: clipBehavior,
    ^^^^^^^^^^^^
    ../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart:76:9: Error: The getter 'clipBehavior' isn't defined for the class '_RenderStack'.
  • '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/convex_bottom_bar-2.4.1/lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'clipBehavior'.
    if (clipBehavior == Clip.none || size.contains(position)) {
    ^^^^^^^^^^^^

I get bug when I run example

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...

../lib/src/stack.dart:42:11: Error: No named parameter with the name 'clipBehavior'.
clipBehavior: clipBehavior,
^^^^^^^^^^^^
../lib/src/stack.dart:52:21: Error: The getter 'clipBehavior' isn't defined for the class 'Stack'.

  • 'Stack' is from 'package:convex_bottom_bar/src/stack.dart' ('../lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'clipBehavior'.
    clipBehavior: clipBehavior,
    ^^^^^^^^^^^^
    ../lib/src/stack.dart:69:11: Error: No named parameter with the name 'clipBehavior'.
    clipBehavior: clipBehavior,
    ^^^^^^^^^^^^
    ../lib/src/stack.dart:75:9: Error: The getter 'clipBehavior' isn't defined for the class '_RenderStack'.
  • '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'clipBehavior'.
    if (clipBehavior == Clip.none || size.contains(position)) {
    ^^^^^^^^^^^^
    Xcode build done. 2.9s
    Failed to build iOS app
    Error output from Xcode build:

    ** BUILD FAILED **
    Xcode's output:

    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    error: /Users/fenghai/code/flutter/plugin/bottom_navigation/convex_bottom_bar/example/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')
    error: /Users/fenghai/code/flutter/plugin/bottom_navigation/convex_bottom_bar/example/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')
    error: /Users/fenghai/code/flutter/plugin/bottom_navigation/convex_bottom_bar/example/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
    Could not build the application for the simulator.
    Error launching application on iPhone 11 Pro Max.
    Exited (sigterm)

please add suppot in RTL

Great Work but not supporting RTL.

To Reproduce

    return MaterialApp(
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: [
        Locale("he"),
        Locale("en"),
      ],
     .
     .
     .

Convex tab item displays in wrong position when a keyboard covers the app bar

Describe the bug

The convex item displays in wrong position after a keyboard (when using TextField) covers it.

Environment details

[√] Flutter (Channel beta, 1.19.0-4.3.pre, on Microsoft Windows [Version 10.0.19041.329], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.46.1)

Flutter 1.19.0-4.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8fe7655ed2 (8 days ago) • 2020-07-01 14:31:18 -0700
Engine • revision 9a28c3bcf4
Tools • Dart 2.9.0 (build 2.9.0-14.1.beta)
dependencies:
  convex_bottom_bar: 2.2.4

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'ReviewScreen'
  2. Click on 'PhoneNumberTextField'
  3. Dismiss the keyboard after editting the 'PhoneNumberTextField'
  4. See error

Screenshots

bug

Fail to compile on flutter dev channel

Thank you for your plugin!

Describe the bug

On flutter dev the following error occurs:

../../../../../../../app/flutter/dev/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.3/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
            overflow: overflow);

Indeed RenderStack no longer has a overflow parameter.

Environment details

flutter --version
Flutter 1.20.0-2.0.pre • channel dev • https://github.com/flutter/flutter.git
Framework • revision 15a28159bc (8 days ago) • 2020-06-23 04:52:58 -0700
Engine • revision 91a63d6a44
Tools • Dart 2.9.0 (build 2.9.0-19.0.dev 7e72c9ae7e)

Paste the package version.

dependencies:
  convex_bottom_bar: 2.2.3

To Reproduce

Steps to reproduce the behavior:

  1. Switch to flutter dev channel
  2. Try to compile any app using convex_bottom_bar
  3. Compilation error

Expected behavior

It should compile!

Thanks!

Error: No named parameter with the name 'overflow'.

Describe the bug
Showing below error when I run for any platform

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
            overflow: overflow);
            ^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:73:9: Error: The getter 'overflow' isn't defined for the class '_RenderStack'.
 - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
    if (overflow == Overflow.visible || size.contains(position)) {

My Usage

ConvexAppBar.badge(
        {3: const CartCountBadge()},
        backgroundColor: Colors.teal.shade400,
        initialActiveIndex: _currentTab,
        activeColor: Colors.limeAccent,
        style: TabStyle.reactCircle,
        color: Colors.teal.shade900,
        top: -12,
        height: 52,
        onTap: (index) {
          setState(() {
            _child = null;
            _currentTab = index;
            context.read<BottomTab>().setActiveTab(index);
          });
        },
        items: <TabItem>[
          TabItem(
            icon: Icon(
              CupertinoIcons.home,
              semanticLabel: Translations.of(context).home,
            ),
            title: cutoff(Translations.of(context).home, cuttoffLimit()),
          ),
          TabItem(
              icon: Icon(
                CupertinoIcons.collections,
                semanticLabel: Translations.of(context).categories,
              ),
              title: cutoff(Translations.of(context).categories, cuttoffLimit())),
          TabItem(
            icon: Icon(
              CupertinoIcons.search,
              semanticLabel: Translations.of(context).search,
            ),
            title: cutoff(Translations.of(context).search, cuttoffLimit()),
          ),
          TabItem(
            icon: Icon(
              CupertinoIcons.shopping_cart,
              semanticLabel: Translations.of(context).cart,
            ),
            title: cutoff(Translations.of(context).cart, cuttoffLimit()),
          ),
          TabItem(
            icon: Icon(
              CupertinoIcons.person,
              semanticLabel: Translations.of(context).account,
            ),
            title: cutoff(Translations.of(context).account, cuttoffLimit()),
          )
        ],
      ),

Environment details

Paste the flutter environment detail.

flutter doctor
flutter --version
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.20.0-7.2.pre, on Mac OS X 10.15.5 19F101, locale
    en-IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.2)
[✓] Connected device (3 available)

! Doctor found issues in 1 category.
Flutter 1.20.0-7.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision a2bde82fbd (3 days ago) • 2020-07-18 15:16:35 -0700
Engine • revision 60b269d898
Tools • Dart 2.9.0 (build 2.9.0-21.2.beta)

To Reproduce

Steps to reproduce the behavior:

  1. change to flutter beta channel
  2. Add convex_bottom_bar: ^2.3.0 in dependencies
  3. run the app
  4. See error

Error: After updating Flutter to latest beta version (1.20.0-7.2.pre)

Describe the bug

After updating Flutter to the latest beta version (1.20.0-7.2.pre), the app doesn't compile. Following is the error:

../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.5+1/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
            overflow: overflow);                                        
            ^^^^^^^^                                                    
../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.5+1/lib/src/stack.dart:73:9: Error: The getter 'overflow' isn't defined for the class '_RenderStack'.
 - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.5+1/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
    if (overflow == Overflow.visible || size.contains(position)) {      
        ^^^^^^^^                                                        
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/home/sifrant/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildDebug'.              
> Process 'command '/home/sifrant/development/flutter/bin/flutter'' finished with non-zero exit value 1

Environment details

  • flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.20.0-7.2.pre, on Linux, locale en_GB.UTF-8)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.47.2)
[✓] Connected device (3 available)

• No issues found!
  • flutter --version
Flutter 1.20.0-7.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision a2bde82fbd (6 days ago) • 2020-07-18 15:16:35 -0700
Engine • revision 60b269d898
Tools • Dart 2.9.0 (build 2.9.0-21.2.beta)

Paste the package version.

dependencies:
  convex_bottom_bar: ^2.3.0

To Reproduce

  • Just add the dependency and run flutter run

Crashing at compile

Describe the bug
Hello, I tried the new version for beta channel but not working and oddly enough it shows v2.3.0?
I have deleted the cache, run flutter clean, run flutter repair still the same thing.
Tried both emulator and web version.

Not compiling:

../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
            overflow: overflow);
            ^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:73:9: Error: The getter 'overflow' isn't defined for the class '_RenderStack'.
 - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
    if (overflow == Overflow.visible || size.contains(position)) {
        ^^^^^^^^
Unhandled exception:
NoSuchMethodError: The getter 'fileOffset' was called on null.
Receiver: null
Tried calling: fileOffset

Environment details

Paste the flutter environment detail.

[✓] Flutter (Channel beta, 1.20.0-7.3.pre, on Mac OS X 10.15.4 19E287, locale ro-RO)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed
      instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)

Flutter 1.20.0-7.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision e606910f28 (3 days ago) • 2020-07-28 16:06:37 -0700
Engine • revision ac95267aef
Tools • Dart 2.9.0 (build 2.9.0-21.10.beta)

Paste the package version.

dependencies:
  convex_bottom_bar: ^2.2.4-flutter-1.20

Steps to reproduce the behavior:

  1. flutter run
  2. see error

Icon doesn't change color

Hi. I've been using your plugin and it's really nice, but I have a small issue. I don't know why the icons don't change color when navigating.

This is how I have it set up:

_items = [ TabItem( icon: Padding( padding: const EdgeInsets.only(top: 8.0), child: Icon( Icons.bookmark, ), ), title: '', ), ]

return ConvexAppBar( items: _items, style: TabStyle.fixedCircle, activeColor: Color(0xff2398C3), color: Colors.blueGrey, backgroundColor: Colors.white, elevation: 1, onTap: (int i) {}, );

Am I doing something wrong?

Rounded border

Hello,

I try to round the corner of my ConvexAppBar. To do that, I add a ClipRRect as parent. The corners are well rounded but the top of the central circle (style:TabStyle.fixedCircle) is cut.

Is it possible to round the corner of the nav bar properly ?

To reproduce :

Widget getBottomNavBar2() {
    return Container(
        decoration: BoxDecoration(
          borderRadius: BorderRadius.only(
              topRight: Radius.circular(30), topLeft: Radius.circular(30)),
          boxShadow: [
            BoxShadow(color: Colors.black38, spreadRadius: 0, blurRadius: 10),
          ],
        ),
        child: ClipRRect(
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(30.0),
              topRight: Radius.circular(30.0),
            ),
            child: ConvexAppBar(
              style: TabStyle.fixedCircle,
              backgroundColor: const Color(0xFFAC2529),

              items: [
                TabItem(
                  icon: Icons.search,
                ),
                TabItem(
                    icon: new ImageIcon(
                        new AssetImage("logo.png"))),
                TabItem(icon: Icons.settings),
              ],
              onTap: (int i) => print('click index=$i'),
            )));
  }

Regards,
Luc

No named parameter ClipBehaviour

Compiler error:

F:/Android%20Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.4.1/lib/src/stack.dart:42:11: Error: No named parameter with the name 'clipBehavior'.
clipBehavior: clipBehavior,
^^^^^^^^^^^^
/F:/Android%20Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.4.1/lib/src/stack.dart:52:21: Error: The getter 'clipBehavior' isn't defined for the class 'Stack'.

  • 'Stack' is from 'package:convex_bottom_bar/src/stack.dart' ('/F:/Android%20Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.4.1/lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'clipBehavior'.
    clipBehavior: clipBehavior,

The 2.4 broke my app build

Describe the bug

Upgrading the lib to 2.4.0 broke my app which is still on Flutter 1.17.5
while this release is pushed to support 1.20, not everybody have migrated.
I was having ^2.3.0 in my pubspec and I got 2.4.0 which was not compiling because of the clipBehavior.

Environment details

Paste the flutter environment detail.

[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.959], locale bg-BG)
 
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 4.0)
[√] VS Code, 64-bit edition (version 1.47.3)
[√] Connected device (1 available)

Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8af6b2f038 (5 weeks ago) • 2020-06-30 12:53:55 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4

Paste the package version.

dependencies:
  convex_bottom_bar: ^2.3.0

To Reproduce

Steps to reproduce the behavior:

  1. just run flutter pub get today
  2. flutter build

Expected behavior

Since this release adds a breaking change to support 1.20 you should revoke it and release v3.

Badge Alignment issues

Badge is incorrectly aligned

Environment details

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.18362.1016], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.47.3)
[√] Connected device (1 available)

convex_bottom_bar: ^2.4.1

ConvexAppBar.badge(
          {1: '10'},
          items: items,
          height: 65,
          style: TabStyle.fixedCircle,
          backgroundColor: Colors.white,
          color: Color(0xFF007AFF).withOpacity(0.64),
          activeColor: Color(0xFF007AFF),
          onTap: (int i) => _selectedTab(i),
        )

Screenshot_1597325427

in supported style fixed,The protruding part cannot execute the click event,that means ‘top fileds’ can not execute the click event

Describe the bug

A clear and concise description of what the bug is.

Environment details

Paste the flutter environment detail.

flutter doctor
flutter --version

E:\FSP\APP\fsp_serve_app>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.2, on Microsoft Windows [Version 10.0.18362.476], locale zh-CN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[!] IntelliJ IDEA Ultimate Edition (version 2018.3)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] Connected device (1 available)

dependencies:
convex_bottom_bar: 1.1.0


**To Reproduce**

in supported style fixed,The protruding part cannot execute the click event,that means ‘top fileds’ can not execute the click event 

Custom start index

Can you please add a config value such as startIndex to set the active tab at build time? For example, if I want the center tab active at start, and there are 5 tabs, then startIndex = 2.

Deploying on iPhone X simulator the bottom bar too close to bottom

When we deploy to an iPhone that has the notch - the bottom bar is too close to the bottom.

When we then wrap inside a SafeArea - the bottom bar is in the safearea but there is a gap between the bar and the edge of the device .... How to make the convex app bar work correctly on latest iPhones ?

Build failed because of a parameter named 'Overflow' within Stack.dart not found

../../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.3/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
            overflow: overflow);
            ^^^^^^^^
../../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.3/lib/src/stack.dart:73:9: Error: The getter 'overflow' isn't defined for the class '_RenderStack'.
 - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convex_bottom_bar-2.2.3/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
    if (overflow == Overflow.visible || size.contains(position)) {
        ^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\Android\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 897

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\Android\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 30s

ConvexAppBar.badge - Badge Alignment Problems

Good Day
When using the 3 tab bar example provided by your flutter package see snippet below:

ConvexAppBar.badge({0: '99+', 1: Icons.assistant_photo, 2: Colors.redAccent},
items: [
TabItem(icon: Icons.home, title: 'Home'),
TabItem(icon: Icons.map, title: 'Discovery'),
TabItem(icon: Icons.add, title: 'Add'),
],
onTap: (int i) => print('click index=$i'),
);

The alignment of the badge is off compared to the example demonstrated by the package see screenshot below of code above:
Screenshot 2020-07-31 at 12 52 41

The Icons are expected to display as demonstrated in the following image and supposed to be hidden on selected icon as demonstrated by the gif images on the package:
Screenshot 2020-07-31 at 13 18 31

Additionally the selected circle gets smaller when there is a badge added.

Please can you assist in guiding me on what is wrong or what the problem could be.

Thank you
Much Appreciated

App bar floats up when textfield tapped

When you have the convex bottom bar and a textfield - tapping the textfield displays the on screen keyboard but the convex app bar is scrolled into view when the on screen keyboard appears.

There is a property of a Scaffold called resizeToAvoidBottomPadding This normally resolves the issue but the convex bottom bar still appears...

i.e


Scaffold(
          resizeToAvoidBottomPadding: false,
          body: _buildMainControlWithTextField(),
          bottomNavigationBar: ConvextBottomAppBarWidget()
);          

Feature Request: FAB

Maybe it would be a nice feature that you could replace the middle button with a FAB.
Or when the middle button could have a special color (fixed).
As you have now the +, this is a specific action you want to perform, and therefore maybe not a specific tab page you want to move to.
I think it would be nice to extend the TabItem properties to have fixed colors.
Thanks for this great component!

Delay in convex_bottom_bar/doc/issue-change-active-tab-index.md

There is a delay: When using
TabBarView(
controller: _tabController,
...
)
bottomNavigationBar: ConvexAppBar(controller: _tabController),

Only after the complete tab is loaded the BottomNav is getting updated.
This is easily noticeable even is convex_bottom_bar/doc/tabcontroller_pageview.gif
Is there a way to start the bottom nav animation immediately after the Tab is Swiped?

Environment details

Paste the flutter environment detail.

flutter doctor
Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.48.1)
[√] Connected device (1 available)

flutter --version
Flutter 1.20.2

dependencies:
convex_bottom_bar: 2.4.1

Support flutter v1.20

Are you expected to add support for Flutter v.1.20?

I noticed in a commit that I was preparing the version, but I didn't find any changes made.

Thank you!

how to add custom icons in convex_bottom_bar

Describe the bug

A clear and concise description of what the bug is.

Environment details

Paste the flutter environment detail.

flutter doctor
flutter --version

Paste the package version.

dependencies:
  convex_bottom_bar: x.y.z

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

about reactCircle style

Is there a way to show both the title and the circle icon when the index is selected? It would be more like both react and reactCircle styles combined

how to expand item space?

Hello,

I am using ConvexAppBar.builder and DelegateBuilder to make custom tab items.

I want to make the first item to occupy 2 slots of space, or expand it's width to maximum allowed.

This is my current status:

image

and code:

ConvexAppBar.builder(
       backgroundColor: Colors.grey[900],
       elevation: 0,
       itemBuilder: _CustomBuilder(tabitems),
       count: tabitems.length,
       onTap: (int i) {}
)
class _CustomBuilder extends DelegateBuilder {
  final List<TabItem> items;
  _CustomBuilder(this.items);

  @override
  Widget build(BuildContext context, int index, bool active) {
    var navigationItem = items[index];
    var activeColor = Color.fromRGBO(246, 172, 42, 1);
    var c = Colors.white;
    var _color = active && index != 0 ? activeColor : c;
    var _icon = active
        ? navigationItem.activeIcon ?? navigationItem.icon
        : navigationItem.icon;

    if (index == 0) {
      return Container(
        width: 200,
        child: Row(
          children: <Widget>[
            Icon(_icon, color: _color, size: 11,),
            SizedBox(width: 5,),
            Text(navigationItem.title, style: TextStyle(color: _color, fontSize: 9, letterSpacing: 2.0))
          ],
        ),
      );
    }

    if (index == 1) {
      return SizedBox(width: 10, child: Container(width: 0, color: Colors.red));
    }

    if (index == items.length ~/ 2) {
      return Container(
        width: 65,
        height: 65,
        margin: EdgeInsets.all(5),
        decoration: BoxDecoration(shape: BoxShape.circle, color: activeColor),
        child: Icon(
          Icons.camera_alt,
          size: 25,
          color: Colors.white
        ),
      );
    }
    
    return Container(
      color: Colors.transparent,
      padding: EdgeInsets.only(bottom: 2),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Icon(_icon, color: _color),
          // Text(navigationItem.title, style: TextStyle(color: _color, fontSize: 10, letterSpacing: 2.0))
        ],
      ),
    );
  }

  @override
  bool fixed() {
    return true;
  }
}

About some questions?

Why does the selection at the bottom change slowly when changing options by sliding the content area?

More customization for TabItem (e.g. shadow, elevation)

I am trying to make the middle tabItem to act more as FAB. First problem that I encountered is that the activeColor/Color is working for the whole Bar and not on each TabItem

ConvexAppBar(
        style: TabStyle.fixedCircle,
        color: Colors.white,
        curveSize: 0,
        items: [
          TabItem(icon: Icons.home, title: 'Home'),
          TabItem(icon: Icons.map, title: 'Discovery'),
          TabItem(icon: Icons.add, title: 'Add'),
          TabItem(icon: Icons.message, title: 'Message'),
          TabItem(icon: Icons.people, title: 'Profile'),
        ],
        onTap: (int i) => print('click index=$i'),
      )

Thanks and good job!

Is there anyway to remove elevation in the bottom bar?

Hi,

I'm having an issue when using this package
image

As you can see, in iphone X it's not working as expected since it's rendering in the SafeArea, but if i put this into a SafeArea layout, there will be a elevation.

We could work around this one by making the background for this as the same color, but since there are some shadow on it, so it will look weird.

So do we have any way to remove the shadow ?

Thanks

After upgrading flutter to version 1.20, convex bottom bar doesn't work.

Describe the bug

After upgrading flutter to version 1.20, convex bottom bar doesn't work. I can't debug my application. When im starting debug i get this:

../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:69:13: Error: No named parameter with the name 'overflow'.
overflow: overflow);

../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart:73:9: Error: The getter 'overflow' isn't defined for the class '_RenderStack'.

  • '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.3.0/lib/src/stack.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'overflow'.
    if (overflow == Overflow.visible || size.contains(position)) {

Environment details
I'm using windows 10 pro, 64bit

Paste the flutter environment detail.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.0, on Microsoft Windows [Version 10.0.19041.388], locale cs-CZ)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.3)
[✓] Connected device (1 available)

• No issues found!

Paste the package version.

dependencies:
  convex_bottom_bar: ^2.3.0

When the PageView content is sliding, the activity state of the BottomBar will not change

When the PageView slides, the page has changed, but the activity color of the bottomBar has not changed. It should be said that the state of the entire bottomBar has not changed. But I think the demo has state changes. I have attached the code.

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

class HomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _HomePage();
}

class _HomePage extends State<HomePage>
    with SingleTickerProviderStateMixin {
  PageController _pageController;

  TabController _tabController;

  List<Widget> _pageList;

  int pageIndex = 0;

  @override
  void initState() {
    _pageList = [
      Test("Page 1",Colors.indigo),
      Test("Page 2",Colors.pink),
      Test("Page 3",Colors.purple),
    ];

    _pageController = PageController(initialPage: pageIndex);

    _tabController = TabController(length: _pageList.length, vsync: this);

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: PageView(
          controller: _pageController,
          children: _pageList,
          onPageChanged: (index) {
            setState(() {
              pageIndex = index;
            });
          },
        ),
        bottomNavigationBar: ConvexAppBar(
          initialActiveIndex: pageIndex,
          controller: _tabController,
          color: Colors.black,
          activeColor: Colors.red,
          backgroundColor: Colors.white,
          style: TabStyle.fixed,
          items: [
            TabItem<Icon>(icon: Icon(Icons.title), title: 'Page1'),
            TabItem<Icon>(icon: Icon(Icons.home), title: 'Page2'),
            TabItem<Icon>(icon: Icon(Icons.person), title: 'page3'),
          ],
          onTap: (index) {
            _pageController.jumpToPage(index);
          },
        ));
  }
}

class Test extends StatefulWidget {
  final String title;

  final Color color;

  final Key key;
  Test(this.title, this.color, {this.key});

  @override
  State<StatefulWidget> createState() => _Test();
}

class _Test extends State<Test> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text(
          widget.title,
          style: TextStyle(fontSize: 50,color: widget.color),
        ),
      ),
    );
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.