Giter Club home page Giter Club logo

gradient-widgets's People

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

gradient-widgets's Issues

How to use this package in listview

I tried using this package with my listview.but I am getting tons of errors .please help

import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gradient_app_bar/gradient_app_bar.dart';
import 'package:gradient_widgets/gradient_widgets.dart';

class RamList extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return _myListView(context);
  }
}

Widget _myListView(BuildContext context) {
  final titles = [
    '1.1st',
    '2.2nd',
    '3.3rd',
    '4.4th',
    '5.5th',
  ];

  final numbers = [
    '1 ',
    '2 ',
    '3 ',
    '4 ',
    '5 ',
  ];

  class NamedGradient {
  NamedGradient(this.gradient, this.name);

  LinearGradient gradient;
  String name;
  }

  List<NamedGradient> gradients = [
  NamedGradient(Gradients.hotLinear, 'Hot Linear'),
  NamedGradient(Gradients.jShine, 'J Shine'),
  NamedGradient(Gradients.aliHussien, 'Golden Sunset'),
  NamedGradient(Gradients.rainbowBlue, 'Rainbow'),
  NamedGradient(Gradients.ali, 'Techno'),
  NamedGradient(Gradients.cosmicFusion, 'Cosmic Fusion'),
  NamedGradient(Gradients.backToFuture, 'Back to Future'),
  NamedGradient(Gradients.blush, 'Blush'),
  NamedGradient(Gradients.byDesign, 'By Design'),
  NamedGradient(Gradients.coldLinear, 'Cold Linear'),
  NamedGradient(Gradients.haze, 'Haze'),
  NamedGradient(Gradients.hersheys, 'Hersheys'),
  NamedGradient(Gradients.tameer, 'Tameer'),
  NamedGradient(Gradients.taitanum, 'Taitanum'),
  NamedGradient(Gradients.deepSpace, 'Deep Space'),
  ];









  functionOne() {
    Navigator.push(
        context, new MaterialPageRoute(builder: (context) => new RamOne()));
  }

  functionTwo() {
    Navigator.push(context, MaterialPageRoute(builder: (context) => RamTwo()));
  }

  functionThree() {
    Navigator.push(
        context, MaterialPageRoute(builder: (context) => RamThree()));
  }

  functionFour() {
    Navigator.push(context, MaterialPageRoute(builder: (context) => RamFour()));
  }

  functionFive() {
    Navigator.push(context, MaterialPageRoute(builder: (context) => RamFive()));
  }

  final List<Function> onTaps = [
    functionOne,
    functionTwo,
    functionThree,
    functionFour,
    functionFive
  ];

  return ListView.builder(
      itemCount: titles.length,
      itemBuilder: (context, index) {
        return Card(
            elevation: 10,
            child: InkWell(
              splashColor: Colors.green,
              highlightColor: Colors.red,
              child: Row(
                children: <Widget>[
                  Container(
                    height: 100.0,

                    // width: 42.0,
                    //color: Colors.red,
                  ),

                  Container(
                      margin: EdgeInsets.all(10),
                      child: Text(
                        numbers[index],
                      )),
                  Container(
                    height: 90.0,
                    width: 20.0,
                    color: Colors.blue,
                  ),
//Container(color: colors[index],),
                  Container(
                    margin: EdgeInsets.all(10),
                    child: Text(titles[index]),
                  )
                ],
              ),
              onTap: () => onTaps[index](),
            ));
      });
//

//  return ListView.builder(
//    itemCount: titles.length,
//    itemBuilder: (context, index) {
//      return Card(
//        color: Colors.black87,
//        //                           <-- Card widget
//        child: ListTile(
//          title: Text(
//            titles[index],
//            style: TextStyle(
//                fontSize: 18.0,
//                color: Colors.white,
//                fontWeight: FontWeight.w600,
//                fontFamily: 'Patrick Hand'),
//          ),
//          onTap: () {
//            onTaps[index]();
//          },
//        ),
//      );
//    },
//  );
}

const String _r1 = """ ##  step1

""";

class RamOne extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: GradientAppBar(
                gradient: LinearGradient(
                    colors: [Colors.blue, Colors.purple, Colors.red])),
            body: const Markdown(data: _r1)));
  }
}

const String _ram2 = """ 

step-2
 
""";

class RamTwo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: new Scaffold(
            appBar: GradientAppBar(
                gradient: LinearGradient(
                    colors: [Colors.blue, Colors.purple, Colors.red])),
            body: const Markdown(data: _ram2)));
  }
}

const String _ram3 = """ 

 step-3
""";

class RamThree extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: new Scaffold(
            appBar: GradientAppBar(
                gradient: LinearGradient(
                    colors: [Colors.blue, Colors.purple, Colors.red])),
            body: const Markdown(data: _ram3)));
  }
}

const String _ram4 = """ 

 step4
""";

class RamFour extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: GradientAppBar(
                gradient: LinearGradient(
                    colors: [Colors.blue, Colors.purple, Colors.red])),
            body: const Markdown(data: _ram4)));
  }
}

const String _ram5 = """ 

  step5
""";

class RamFive extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: GradientAppBar(
                gradient: LinearGradient(
                    colors: [Colors.blue, Colors.purple, Colors.red])),
            body: const Markdown(data: _ram5)));
  }
}

supporting gradient Icon

Is Icon going to be supported also for the gradient class as I think it will look very nice on apps.

'elevation != null && elevation >= 0.0': is not true.

I can't use a simple circular button as shown here:

CircularGradientButton(
              child: Icon(Icons.add_location, size: 32.0),
              callback: (){},
            ),

I's immediately throwing an error as listed and shown here:

A piece of the exception message
I/flutter (29912): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (29912): The following assertion was thrown building CircularGradientButton(dirty, dependencies:
I/flutter (29912): [_LocalizationsScope-[GlobalKey#36ec3], _InheritedTheme], state:
I/flutter (29912): _CircularGradientButtonState#a3b0e(ticker inactive)):
I/flutter (29912): 'package:flutter/src/material/floating_action_button.dart': Failed assertion: line 85 pos 15:
I/flutter (29912): 'elevation != null && elevation >= 0.0': is not true.
I/flutter (29912): 
I/flutter (29912): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (29912): more information in this error message to help you determine and fix the underlying cause.
I/flutter (29912): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (29912):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter (29912): 
I/flutter (29912): When the exception was thrown, this was the stack:
I/flutter (29912): #2      new FloatingActionButton (package:flutter/src/material/floating_action_button.dart:85:15)
I/flutter (29912): #3      _CircularGradientButtonState.build (package:gradient_widgets/src/circular_gradient_button.dart:87:16)
I/flutter (29912): #4      StatefulElement.build (package:flutter/src/widgets/framework.dart:3825:27)
I/flutter (29912): #5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)
I/flutter (29912): #6      Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter (29912): #7      StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter (29912): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter (29912): #9      RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)

image

Supporting AppBar

Is AppBar going to be supported also for the gradient class as I think it will look very nice on apps.

How to handle Dynamic width?

螢幕截圖 2019-07-19 下午3 52 42

I built a horizontal list. When the button is disabled, i use outline button. When the button is enabled, i use gradient button.

But, i found that the gradient button has limit width. How to set it to support dynamic width?

How to test GradientButton callback

Hello. I use the GradientButton from your package. And action of it is callback function.
I write integration test for my application. How can i test it like a tap() on RaisedButton ?
Group 2 (1)

Elevation is weird on GradientCard

elevation: 1.0,
shadowColor: Colors.black,

GradientCard
image

Default Card
image

[✓] Flutter (Channel dev, v1.7.11, on Mac OS X 10.14.5 18F132)

opacity prints

Hello, this isn't exactly an issue, but here we go.

Each time a GradientButton is drawn or pressed, i get a lot of opacity prints in the debug console. Is not a real problem, but a little annoying.

I/flutter (17286): _opacity.value: 0.0
I/flutter (17286): _opacity.value: 0.8630510419607162
I/flutter (17286): _opacity.value: 0.0
I/flutter (17286): _opacity.value: 0.7755804806947708

If I remove my GradientButton, this msg is not shown.

Sorry if I'm wrong or this is not the place.

GradientCard shape bug

It appears to be a bug when trying to set a shape to the GradientCard object.
When trying to set the shape an exception is thrown on:
package:gradient_widgets/src/gradient_card.dart:37:27
The message is:
"exception was thrown: type 'RoundedRectangleBorder' is not a subtype of type 'Decoration'"

Reading the code this makes sense to me since the required type of GradientCard is ShapeBorder, and is trying to pass it as to the decoration argument of Container which is of the type Decoration.

Double Cast issue

Initializing gradle... 0.7s
Resolving dependencies... 1.7s
Running 'gradlew assembleRelease'...
compiler message: file:///C:/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/gradient_widgets-0.3.0/lib/src/gradient_progress_indicator.dart:34:22: Error: A value of type 'dart.core::int' can't be assigned to a
variable of type 'dart.core::double'.
compiler message: Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
compiler message: double prevValue = 0;
compiler message: ^
Compiler terminated unexpectedly.

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\FlutterSDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 428

  • What went wrong:
    Execution failed for task ':app:flutterBuildRelease'.

Process 'command 'C:\FlutterSDK\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 11s 12.3s
Gradle build failed: 1

The getter 'button' isn't defined for the type 'TextTheme'.

/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/gradient_widgets-0.6.0/lib/src/gradient_widget.dart:104:73: Error: The getter 'button' isn't defined for the class 'TextTheme'.

  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'button'.
    final TextStyle textStyleCopy = widget.textStyle ?? theme.textTheme.button!.copyWith(color: Colors.white);

Capture

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.