iampawan / velocityx Goto Github PK
View Code? Open in Web Editor NEWA minimalist Flutter framework for rapidly building Flutter apps.
Home Page: https://velocityx.dev
License: MIT License
A minimalist Flutter framework for rapidly building Flutter apps.
Home Page: https://velocityx.dev
License: MIT License
I'm on
when saving the pubspec.yaml I'm getting this issue,
**Because every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2 and velocity_x >=0.5.0 <2.0.0-nullsafety.0 depends on intl ^0.16.1, flutter_localizations from sdk is incompatible with velocity_x >=0.5.0 <2.0.0-nullsafety.0.
So, because souqcards depends on both velocity_x 1.4.1 and flutter_localizations any from sdk, version solving failed.
pub get failed (1; So, because souqcards depends on both velocity_x 1.4.1 and flutter_localizations any from sdk, version solving failed.)
exit code 1**
Is your feature request related to a problem? Please describe.
As of now we only have the VxTextField which provide great feature of clearing the input, but it's really hard to use with Form and TextFormField.
Describe the solution you'd like
Introduce a new widget VxTextFormField, which can be used with Form, or simply remove VxTextField in favor of VxTextFormField.
Hi @iampawan
When I use key.text.make() it throws an error.
When I use default Text noproblem
class TransactionHistoryWidget extends StatelessWidget {
TransactionHistoryWidget({
@required this.transactions
}): assert(transactions != null);
final List<Map<String, dynamic>> transactions;
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
columns: getColumns(),
rows: getRows()
),
);
}
List<DataColumn> getColumns(){
List<DataColumn> columns = [];
columns.addAll(transactions[0].keys.map((key) => DataColumn(label: key.text.make(), tooltip: key)));
return columns;
}
List<DataRow> getRows(){
List<DataRow> rows = [];
for(int i = 0; i < transactions.length; i++) {
List<DataCell> cells = [];
cells.addAll(transactions[i].values.map((value) => DataCell(Text(value.toString()))));
rows.add(DataRow(cells: cells));
}
return rows;
}
}
I'm see that the current version is not contain text Opacity so may you add it to the next release.
How do I write in Velocity, the Widget Text with overflow,
Text(
this.text,
style: TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
)
when I am using velocity x package it shows me an error.
`
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/dom_canvas.dart:140:10
paint.shader == null
is not true
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 216:49 throw
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 24:3 assertFailed
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/dom_canvas.dart 140:26 _buildDrawRectElement
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/bitmap_canvas.dart 385:34 drawRect
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/html/recording_canvas.dart 979:11 apply
...
====================================================================================================`
@OverRide
SelectableText make({Key key}) {
return SelectableText(
_text,
key: key,
textAlign: _textAlign,
maxLines: _maxLines,
toolbarOptions: const ToolbarOptions(copy: true, cut: true, paste: true, selectAll: true),
onTap: _onTap,
enableInteractiveSelection: true,
// showCursor: true,
// textScaleFactor: _scaleFactor,
after commenting this field project will run successfully.
style: _textStyle?.copyWith(
color: velocityColor,
fontSize: _fontSize ?? 14.0,
fontStyle: _fontStyle ?? FontStyle.normal,
fontFamily: _fontFamily,
fontWeight: _fontWeight,
letterSpacing: _letterSpacing ?? 0.0,
decoration: _decoration ?? TextDecoration.none,
height: _lineHeight,
) ??
TextStyle(
color: velocityColor,
fontSize: _fontSize ?? 14.0,
fontStyle: _fontStyle ?? FontStyle.normal,
fontFamily: _fontFamily,
fontWeight: _fontWeight,
letterSpacing: _letterSpacing ?? 0.0,
decoration: _decoration ?? TextDecoration.none,
height: _lineHeight,
),
);
}
Should have .fontWeight method to set custom weight.
For example, we have large number of horizontal content to be scrolled.
And it should be in same manner - like item should always come to middle after scrolling. Currently with swiper, it hardly scrolls 2-3 views at a time, which is really inconvenient.
Any suggestion to increase the scrolling speed?
BoxFit.cover and rounded does not work with VxSwiper, help please.
VxSwiper.builder(
viewportFraction: 0.9,
enlargeCenterPage: true,
itemCount: 10,
height: 200,
itemBuilder: (context, index) {
return VxBox(
child: Image.network(
pics[index],
fit: BoxFit.cover,
),
).roundedLg.make();
},
),
Describe the bug
When I press the clear icon (the x on the right)
To Reproduce
Steps to reproduce the behavior:
1.Create a VxTextField
2. Enter a value
3. Click on the x
Expected behavior
It should just clear
Smartphone (please complete the following information):
Additional context
A runtime error is thrown inside the decodeEnvelope of the JSONMethodCodec class in the flutter/dart system. The clear does happen correctly afterwards.
E/MethodChannel#flutter/textinput( 5883): Failed to handle method call
E/MethodChannel#flutter/textinput( 5883): java.lang.IndexOutOfBoundsException: invalid selection start: 12
E/MethodChannel#flutter/textinput( 5883): at io.flutter.embedding.engine.systemchannels.TextInputChannel$TextEditState.(TextInputChannel.java:724)
E/MethodChannel#flutter/textinput( 5883): at io.flutter.embedding.engine.systemchannels.TextInputChannel$TextEditState.fromJson(TextInputChannel.java:680)
E/MethodChannel#flutter/textinput( 5883): at io.flutter.embedding.engine.systemchannels.TextInputChannel$1.onMethodCall(TextInputChannel.java:91)
E/MethodChannel#flutter/textinput( 5883): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#flutter/textinput( 5883): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter/textinput( 5883): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#flutter/textinput( 5883): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/textinput( 5883): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#flutter/textinput( 5883): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#flutter/textinput( 5883): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#flutter/textinput( 5883): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/textinput( 5883): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#flutter/textinput( 5883): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Describe the bug
this bug arises when I run my code
FAILURE: Build failed with an exception.
Where:
Script '/home/parag/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 997
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/home/parag/snap/flutter/common/flutter/bin/flutter'' 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 14s
isMaterialAppTheme: isMaterialAppTheme,
^^^^^^^^^^^^^^^^^^
../../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/theme.dart:40:9: Context: Found this candidate, but the arguments don't match.
const Theme({
^^^^^
../../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-1.0.1/lib/src/flutter/theme.dart:47:9: Error: No named parameter with the name 'isMaterialAppTheme'.
isMaterialAppTheme: isMaterialAppTheme,
^^^^^^^^^^^^^^^^^^
../../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/theme.dart:40:9: Context: Found this candidate, but the arguments don't match.
const Theme({
^^^^^
Exception: Gradle task assembleDebug failed with exit code 1
Is your feature request related to a problem? Please describe.
By default, VxTextBuilder
uses default text style, and there's no way to change the default texts style on theme level. Normally, we could have wrap MaterialApp
with DefaultTextStyle
but there's already an open issue that Text doesn't inherit DefaultTextStyle
beyond Scaffold. It's been 2 years to the issue, and it's really inconvenient to change the DefaultTextStyle
for every page.
Describe the solution you'd like
The idea is to bring VxTextTheme
which can be wrapped around MaterialApp
to change the default text style through out the application. VxTextBuilder
will give to priority to VxTextTheme
if any or it will fall back to default.
Add widget tests to ensure that the widgets are rendered correctly. The tests can also be used in CI/CD.
I would like to work on this issue.
I need a suggestion about writing the test. Should I write a different widget test for the various parameter or should I write a single widget test and include all the parameters of the widget?
IMO, having a separate widget test for parameters can ensure that the widgets are correctly responding to the values.
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-1.0.1/lib/src/flutter/theme.dart:27:9: Error: No named parameter with the name 'isMaterialAppTheme'.
isMaterialAppTheme: isMaterialAppTheme
VxTextField(
controller: _searchTextCtrl,
hint: 'Search',
borderType: VxTextFieldBorderType.roundLine,
fillColor: AppColor.dark,
onChanged: _appsCtrl.query,
),
Reproduce the issue:
Type on your VxTextField and click clear from right side of the textfield , then check the onChanged will not call.
velocity x show me this error
/C:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-1.3.1/lib/src/extensions/context_ext.dart:177:36: Error: No named parameter with the name 'nullOk'. Actions.invoke(this, intent, nullOk: nullOk);
pubspec.yaml
`name: mbmelearning
description: A new Flutter application.
publish_to: 'none'
version: 1.0.0+2
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.1
velocity_x: ^1.3.1
flutter_icons: ^1.1.0
firebase: ^7.3.0
firebase_core: ^0.7.0
url_launcher: ^5.7.10
cloud_firestore: ^0.16.0
community_material_icon: ^5.4.55
modal_progress_hud: ^0.1.3
firebase_auth: ^0.20.0+1
google_sign_in: ^4.5.9
dev_dependencies:
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/`
Flutter Doctor
`"C:\Program Files\flutter\bin\flutter.bat" doctor --verbose
[√] Flutter (Channel beta, 1.26.0-17.3.pre, on Microsoft Windows [Version 10.0.20270.1], locale en-IN)
• Flutter version 1.26.0-17.3.pre at C:\Program Files\flutter
• Framework revision 4b50ca7f7f (2 days ago), 2021-02-04 19:44:27 -0800
• Engine revision 2c527d6c7e
• Dart version 2.12.0 (build 2.12.0-259.8.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\lokesh jangid\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.53.0)
• VS Code at C:\Users\lokesh jangid\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.19.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.146
• Edge (web) • edge • web-javascript • Microsoft Edge 88.0.705.56
• No issues found!
Process finished with exit code 0`
Is your feature request related to a problem? Please describe.
I am using this plugin in conjunction with the liquid_ui package, but I feel like this could be both.
Describe the solution you'd like
What I get from the liquid UI are the Buttons, Forms, Badges, Expansion Tiles, etc.
Since this package is inspired by tailwind, maybe we could add some of these widgets matching the tailwind style.
I and others who use this plugin will be ready to help I'm sure .
What limitations do you see with using velocityx to compose an app made up of many non velocity plugins ?
Is your feature request related to a problem? Please describe.
I find myself often in situations like
'New Guy'.text.xl4.bold.white.make(),
'We haven\'t seen you around before'.text.xl4.bold.white.center.make(),
Describe the solution you'd like
It would be nice if we could share styles like
final style = xl4.bold.white;
'New Guy'.text.style(style).make(),
'We haven\'t seen you around before'.text.style(style).center.make(),
As of now we the widget only has shimmerColor
and color
property which doesn't give much control over the widget. Exposing the gradient property instead of colors, or both will be more helpful.
Is your feature request related to a problem? Please describe.
Currently there's no method on List<num>
to calculate sum of the elements in the list, and we have to write for loop every time.
Describe the solution you'd like
List.sum extension to get the sum of all the elements in the list
List.minus extension to get the sum of all the elements in the list
Additional context
Very useful for in our application :P
Adding extension for animated padding.
I would like to work on this issue.
Eg of Syntax:
box.animatedPadding.withpadding()
It's great to have percentage sizes of the screen for VxBox. BUT, what good is it for nested boxes? Say if I have two boxes in an HStack, .wOneFourth and .wThreeFourths, and in those boxes I have of course more boxes/containers. I need to specify the inner boxes as percentages of their outer box, not a percentage of the entire screen.
Can we do this with the current version?
Or, am I being silly and there is a simple formula/function to do this, based on percentage of entire screen?
tnx
A possible feature for people enjoying the speed of coding with VelocityX but want the code to eventually look like native flutter code.
class _VelocityXCardBuilder extends VelocityXWidgetBuilder
with
VelocityColorMixin<_VelocityXCardBuilder>,
VelocityPaddingMixin<_VelocityXCardBuilder>,
VelocityRoundMixin<_VelocityXCardBuilder> {
_VelocityXCardBuilder(
this._child,
) : assert(_child != null) {
setChildToColor(this);
setChildToPad(this);
setChildToRound(this);
}
final Widget _child;
Color _shadowColor;
double _elevation = 1.0;
ShapeBorder _shape;
_VelocityXCardBuilder color(Color val) => this..velocityColor = val;
_VelocityXCardBuilder hexColor(String colorHex) =>
this..velocityColor = VelocityX.hexToColor(colorHex);
_VelocityXCardBuilder elevation(double val) => this.._elevation = val;
_VelocityXCardBuilder get circular => this.._shape = const CircleBorder();
_VelocityXCardBuilder get zeroCircular => this
.._shape = const CircleBorder()
.._elevation = 0.0;
_VelocityXCardBuilder get zero => this.._elevation = 0.0;
@OverRide
Widget make({Key key}) {
return Card(
key: key,
margin: velocityPadding,
child: _child,
color: velocityColor ?? ThemeData().cardColor,
clipBehavior: Clip.antiAlias,
elevation: _elevation,
shape: roundedValue.isNotNull
? RoundedRectangleBorder(borderRadius: BorderRadius.circular(roundedValue))
: _shape,
// shadowColor: _shadowColor,
//<<<---- i have to comment 'shaowColor' field to run the
example project from your github repository.
line 67 in file.
);
}
}
extension CardExtension on Widget {
_VelocityXCardBuilder get card => _VelocityXCardBuilder(this);
}
Namaste Pawan,
I am so happy to send you this mail, I am so greatful for the good work you do and I learnt so much from you. Your velocityX project is totally awesome.
I am Chetan Jain and have create a Vscode extension that has helped 118 people in past 8 days and I would be really happy if you could make a tutorial upon it as I believe your aim is to help which really concides with the aim I built the extension
https://marketplace.visualstudio.com/items?itemName=ChetanJain.flutter-code-generator
Once again Thank you Pawan. Looking forward to hear from you.
Reagards,
Chetan Jain
Please update documentation of newer version.
Compiling lib/main.dart for the Web...
Target dart2js failed: Exception: /opt/hostedtoolcache/flutter/1.24.0-7.0.pre-dev/x64/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:322:57:
Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
/opt/hostedtoolcache/flutter/1.24.0-7.0.pre-dev/x64/packages/flutter/lib/src/material/scaffold.dart:1918:24:
Info: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
Error: Compilation failed.
Compiling lib/main.dart for the Web... 9.6s
Exception: Failed to compile application for the Web.
Error: Process completed with exit code 1.
I am getting this error when deploying web app on firebase with github actions
I am using velocity 1.0
Is your feature request related to a problem? Please describe.
Today VxPlatform only supports Android, iOS and Web.
Describe the solution you'd like
I would like VxPlatform to have desktop also as an option
We could add a extra generic argument to indicate the Desktop Widget type and add a abstract method createDesktopWidget.
I'm happy to help if you agree with this proposal.
VxTextField(
controller: _searchTextCtrl,
hint: 'Search',
borderType: VxTextFieldBorderType.roundLine,
fillColor: AppColor.dark,
onChanged: _appsCtrl.query,
),
Reproduce the issue:
Type on your VxTextField and click clear the onChanged will not called from your widget.
In this docs,
I can not copy the dependency. As it's expected behavior, it needs to be fixed if Flutter web supports it.
Add any other context or screenshots about the feature request here.
And because no versions of firebase_auth_web match >1.0.0 <2.0.0, firebase_auth ^1.0.0 requires firebase_auth_web 1.0.0.
And because firebase_auth_web 1.0.0 depends on intl ^0.17.0 and velocity_x >=0.5.0 <2.0.0-nullsafety.0 depends on intl ^0.16.1, firebase_auth ^1.0.0 is incompatible with velocity_x >=0.5.0 <2.0.0-nullsafety.0.
So, because ecommerceapp depends on both velocity_x 1.4.1 and firebase_auth ^1.0.0, version solving failed.
pub get failed (1; So, because ecommerceapp depends on both velocity_x 1.4.1 and firebase_auth ^1.0.0, version solving failed.)
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-1.0.0/lib/src/extensions/context_ext.dart:132:31: Error: The getter 'TextSelectionTheme' isn't defined for the class 'BuildContext'.
I want to use flutter_form_builder in my project. But I can't because of a dependency clash.
Running "flutter pub get" in evidence-system-ui...
Because every version of velocity_x from git depends on intl ^0.17.0 and flutter_form_builder >=3.7.3 <5.0.0-alpha.1 depends on intl ^0.16.1, velocity_x from git is incompatible with flutter_form_builder >=3.7.3 <5.0.0-alpha.1.
So, because evidence_system_web depends on both flutter_form_builder 4.2.0 and velocity_x from git, version solving failed.
pub get failed (1; So, because evidence_system_web depends on both flutter_form_builder 4.2.0 and velocity_x from git, version solving failed.)
Process finished with exit code 1
It would be great if the intl dependency could be updated.
Thank you very much.
Describe the bug
/C:/development/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-2.3.1-nullsafety.0/lib/src/extensions/context_ext.dart:177:36: Error: No named parameter with the name 'nullOk'.
Actions.invoke(this, intent, nullOk: nullOk) as bool?;
^^^^^^
/C:/development/flutter/packages/flutter/lib/src/widgets/actions.dart:898:18: Context: Found this candidate, but the arguments don't match.
static Object? invoke<T extends Intent>(
^^^^^^
FAILURE: Build failed with an exception.
I tried to run a flutter project, but I ended up with this error.
I am also attaching my dependencies list
cupertino_icons: ^1.0.2
http: ^0.13.0
package_info: ^2.0.0
launch_review: ^2.0.0
url_launcher: ^6.0.2
firebase_core: ^1.0.0
firebase_auth: ^1.0.0
firebase_messaging: ^9.0.0
fluttertoast: ^7.0.4
velocity_x: ^2.3.1-nullsafety.0
firebase_auth_web: ^1.0.0
pin_code_fields: ^6.1.0
shared_preferences: ^2.0.3
simple_animations: ^2.2.2
supercharged: ^1.10.0
keyboard_avoider: ^0.1.2
intl: ^0.17.0
Add support for labelText and labelStyle to VxTextField
Page not found Showing on Example Click
On README.md file preview when we click on any of the examples of "Some Popular Vx Widgets" it redirects us to Page not found screen
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
It has to redirect on relevant example code
Screenshots
If applicable, add screenshots to help explain your problem.
This isn't but it does not feature either but related to performance so I made this issue.
This library is awesome and it's no brainer that there should be an easier way to implement easy stuff like padding, opacity, margin, transform etc than having to increase the height of the Christmas tree. But I have a curiosity regarding performance issues, how the internals are designed to address this aspect.
So as we make extensive use of (extension) functions in this library (at least in my understanding), what are we losing in terms of performance that we gained using StatelessWidget?
As per this answer from Remi Rousselet (https://github.com/rrousselGit, we might be losing some performance using functions in place of stateless Widget?
If we are losing performance, do you have anything planned to address this issue?
ZStack don't working in velocity_x 2.6.0 => type 'List<Widget?>' is not a subtype of type 'List' in type cast
Like normal BoxDecoration, we can't set the start and end of the linear gradient. It's always set from left-center to right-center.
To Reproduce
VxBox().linearGradient(
[
Colors.black.withOpacity(0.8),
Colors.black.withOpacity(0)
],
).make(),
We should use ?.isEmpty in the extension. I'll raise a PR for fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.