I've created flutter with PaginatedDataTable2 as below source code
Expanded(
child: Theme(
data: Theme.of(context).copyWith(
cardColor: backgroundEndColor, dividerColor: Colors.white),
child: PaginatedDataTable2(
controller: paginatorController,
hidePaginator: true,
headingRowColor: MaterialStateColor.resolveWith(
(states) {
return Colors.white;
},
),
source: dataTable,
header: const ListHeader(),
columns: tableColumns,
columnSpacing: 0,
horizontalMargin: 10,
rowsPerPage: projectPartProgressController.rowsPerPage.value,
showCheckboxColumn: false,
)),
)
But the last page result is showing with horizontal border that no value inside as below
Is there any way to remove the border for those no value row?
Related
How to make default flutter ratingbar non clickable ?
I have to disable rating option once user give feedback. How do I do it.
RatingBar(
itemSize: 35,
initialRating: 0,
glowColor: Colors.transparent,
direction: Axis.horizontal,
allowHalfRating: false,
tapOnlyMode: false,
itemCount: 5,
itemPadding: const EdgeInsets.symmetric(horizontal: 0.0),
ratingWidget: RatingWidget(
full: Image.asset(img_star_rating_fill, width: 25.w, height: 25.h),
// full: const Icon(Icons.star, color:yellow_FFC800),
half: Image.asset(img_star_rating_fill, width: 25.w, height: 25.h),
// half: const Icon(Icons.star_half, color:yellow_FFC800,),
empty:
Image.asset(img_star_rating_empty, width: 25.w, height: 25.h),
),
// empty: const Icon(Icons.star_outline, color:gray_868590,)),
onRatingUpdate: (value) {
setState(() {
_ratingValue = value;
printData(
'Rating to consultation booking ID', _ratingValue.toString());
controller
.callRateConsultationAPI(
widget.i,
controller.pastBookingList[widget.i].id.toString(),
value.toString())
.then((value) {
setState(() {
// ratingBar.setFocusable(false);
});
});
});
})
You can set ignoreGestures to true, like this:
RatingBar(
ignoreGestures: true, // <---- add this
itemSize: 35,
initialRating:0,
glowColor: Colors.transparent,
direction: Axis.horizontal,
allowHalfRating: false,
...
)
IgnorePointer(child:RatingWidget)
Is there a keyboardtype that shows the emojies of the keyboard or is there any package (not the EmojiPicker) that implements such for Flutter? Unfortunately I can't include the EmojiPicker in the normal keyboard. So the package is not an option for me. The best option would be one that calls the normal emoji keyboard. Are there any commands or functions for this?
There are some alternatives to emoji_picker package; https://pub.dev/packages?q=emoji+picker+keyboard but also the package you said it's deprecated and replaced by this one https://pub.dev/packages/emoji_picker_flutter
Just use emoji_picker_flutter: ^1.3.1
EmojiPicker(
onEmojiSelected: (category, emoji) {
// Do something when emoji is tapped (optional)
},
onBackspacePressed: () {
// Do something when the user taps the backspace button (optional)
},
textEditingController: textEditionController, // pass here the same [TextEditingController] that is connected to your input field, usually a [TextFormField]
config: Config(
columns: 7,
emojiSizeMax: 32 * (Platform.isIOS ? 1.30 : 1.0), // Issue: https://github.com/flutter/flutter/issues/28894
verticalSpacing: 0,
horizontalSpacing: 0,
gridPadding: EdgeInsets.zero,
initCategory: Category.RECENT,
bgColor: Color(0xFFF2F2F2),
indicatorColor: Colors.blue,
iconColor: Colors.grey,
iconColorSelected: Colors.blue,
progressIndicatorColor: Colors.blue,
backspaceColor: Colors.blue,
skinToneDialogBgColor: Colors.white,
skinToneIndicatorColor: Colors.grey,
enableSkinTones: true,
showRecentsTab: true,
recentsLimit: 28,
noRecents: const Text(
'No Recents',
style: TextStyle(fontSize: 20, color: Colors.black26),
textAlign: TextAlign.center,
),
tabIndicatorAnimDuration: kTabScrollDuration,
categoryIcons: const CategoryIcons(),
buttonMode: ButtonMode.MATERIAL,
),
)
I am implementing a SFSlider in my app. When I try to give a theme to the slider using SfTheme, I get an error:
RenderBox was not laid out: _RenderSlider#850b3 relayoutBoundary=up7 'package:flutter/src/rendering/box.dart': Failed assertion: line 2009 pos 12: 'hasSize'
My code is :
Container(
height: constraints.maxHeight*0.1,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: SfTheme(
data: SfThemeData(
sliderThemeData: SfSliderThemeData(
activeLabelStyle: TextStyle(color: Colors.white),
inactiveLabelStyle: TextStyle(color: Colors.white),
)
),
child: SfSlider(activeColor: Colors.green,
inactiveColor: Colors.grey,
min: 0.0,
max: 100.0,
value: _value,
interval: 25,
showTicks: true,
showLabels: true,
enableTooltip: true,
minorTicksPerInterval: 1,
onChanged: (dynamic value) async {
totalAmount = await calculateData();
totalAmount = totalAmount.ceil() + 0.0;
setState(() {
_value = value;
total_amount_display = totalAmount;
});
},
),),),),
The Container is inside a column, which in turn is inside a container in dialog box.
When I remove the theme, the slider is rendered perfectly.
You can overcome this issue by setting color and fontSize when setting the text style for the active and inactive labels in SfSliderThemeData.
SfTheme(
data: SfThemeData(
sliderThemeData: SfSliderThemeData(
activeLabelStyle: const TextStyle(color: Colors.red, fontSize: 14),
inactiveLabelStyle: const TextStyle(color: Colors.red, fontSize: 14),
)
),
)
If you like to set the color alone for the label,then you can use the textTheme’s text style values retrieved from context’s ThemeData and using the copyWith() method to set the desired color.
final ThemeData themeData = Theme.of(context);
SfTheme(
data: SfThemeData(
sliderThemeData: SfSliderThemeData(
activeLabelStyle: themeData.textTheme.bodyText1!.copyWith(color: Colors.red),
inactiveLabelStyle: themeData.textTheme.bodyText1!.copyWith(color: Colors.red),
)
),
)
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/i4007071991344175
How can we get htmltoolbar and htmlEditor separate background color
My work
Expectation:
htmlToolbarOptions: HtmlToolbarOptions(
dropdownFocusColor: borderColor,
dropdownBoxDecoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
),
buttonFillColor: yellowColor,
renderBorder: true,
toolbarType: ToolbarType.nativeExpandable,
textStyle: const TextStyle(color:Color(0xff344054),),
initiallyExpanded: false,
),
htmlEditorOptions: HtmlEditorOptions(
shouldEnsureVisible: true,
initialText: data.taskStatus,
hint: S.current.task_description,
spellCheck: true,
autoAdjustHeight: true,
adjustHeightForKeyboard: false,
),
otherOptions: const OtherOptions(height: 1500),
);
I have a PopupMenuButton which displays items from a List.
List<Subject> subjects = [
Subject(
name: 'English',
iconFile: 'english.jpg',
),
Subject(
name: 'Mathematics',
iconFile: 'maths.jpg',
),
Subject(
name: 'Business Studies',
iconFile: 'business.jpg',
),
];
Below is PopupMenuButton code where the list is used to generate the menu items:
child: PopupMenuButton<Subject>(
color: Color.fromARGB(255, 95, 115, 231),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
onSelected: _changeSubject,
itemBuilder: (BuildContext context) {
return subjects.map((Subject subject) {
return PopupMenuItem<Subject>(
value: subject,
child: Text(subject.name),
);
}).toList();
},
),
This works as intended. Now I want to add another item "Sign Out" below "Business Studies" (as in this image link -> PopupMenuButton) and a divider between them. I don't want to add "Sign Out" to the subjects list. Is it possible to add another PopupMenuItem manually after all the generated items?
`
Subject signOutSubject = Subject(
name: 'Sign Out',
iconFile: 'signOut.jpg',
);
add to the end of the toList() function
toList()..add(PopupMenuItem<Subject>(
value: signOutSubject,
child: Text(signOutSubject.name),
);)
`
You can do like this.
result image
return PopupMenuButton(
color: const Color.fromARGB(255, 95, 115, 231),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
itemBuilder: (context) => <PopupMenuEntry>[
...subjects
.map((s) => PopupMenuItem(value: s, child: Text(s.name)))
.toList(),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
value: "LogOut",
child: const Text('LogOut'),
),
],
);