Skip to content

Commit 1cd8fff

Browse files
authored
Merge pull request #125 from deepikahr/shimmer
issues #123 #124 fixed
2 parents 881a953 + 52a33d9 commit 1cd8fff

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

example/lib/main_temp.dart

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,25 @@ class _MyHomePageState extends State<MyHomePage>
253253
mainAxisAlignment: MainAxisAlignment.center,
254254
crossAxisAlignment: CrossAxisAlignment.center,
255255
children: <Widget>[
256-
GFFloatingWidget(
257-
child: GFToast(
258-
text: 'This item already has the label “travel”',
259-
autoDismiss: true,
260-
),
261-
body: Container(
262-
color: Colors.blueAccent,
263-
child: Text('body or any kind of widget here..'),
264-
)),
256+
257+
GFAccordion(
258+
titleChild: Text('fgk'),
259+
contentChild: Text('hhjk'),
260+
// title: 'GF Accordion',
261+
// content: 'GetFlutter is an open source library that comes with pre-build 1000+ UI components.',
262+
collapsedIcon: Text('Show'),
263+
expandedIcon: Text('Hide')
264+
),
265+
266+
// GFFloatingWidget(
267+
// child: GFToast(
268+
// text: 'This item already has the label “travel”',
269+
// autoDismiss: true,
270+
// ),
271+
// body: Container(
272+
// color: Colors.blueAccent,
273+
// child: Text('body or any kind of widget here..'),
274+
// )),
265275

266276
// GFRating(
267277
// value: _rating,

lib/components/accordian/gf_accordian.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:getflutter/getflutter.dart';
44
class GFAccordion extends StatefulWidget {
55
const GFAccordion(
66
{Key key,
7-
this.child,
7+
this.titleChild,
88
this.content,
99
this.collapsedTitlebackgroundColor = GFColors.WHITE,
1010
this.expandedTitlebackgroundColor = const Color(0xFFE0E0E0),
@@ -21,8 +21,8 @@ class GFAccordion extends StatefulWidget {
2121
this.margin})
2222
: super(key: key);
2323

24-
/// child of type [Widget]is alternative to title key. title will get priority over child
25-
final Widget child;
24+
/// child of type [Widget]is alternative to title key. title will get priority over titleChild
25+
final Widget titleChild;
2626

2727
/// content of type[String] which shows the messages after the [GFAccordion] is expanded
2828
final String content;
@@ -42,7 +42,7 @@ class GFAccordion extends StatefulWidget {
4242
///expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
4343
final Widget expandedIcon;
4444

45-
/// text of type [String] is alternative to child. text will get priority over child
45+
/// text of type [String] is alternative to child. text will get priority over titleChild
4646
final String title;
4747

4848
/// textStyle of type [textStyle] will be applicable to text only and not for the child
@@ -140,7 +140,7 @@ class _GFAccordionState extends State<GFAccordion>
140140
Expanded(
141141
child: widget.title != null
142142
? Text(widget.title, style: widget.textStyle)
143-
: (widget.child ?? Container()),
143+
: (widget.titleChild ?? Container()),
144144
),
145145
showAccordion ? widget.expandedIcon : widget.collapsedIcon
146146
],

lib/components/carousel/gf_carousel.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class _GFCarouselState extends State<GFCarousel> with TickerProviderStateMixin {
224224
scrollDirection: widget.scrollDirection,
225225
controller: widget.pageController,
226226
reverse: widget.reverse,
227-
itemCount: widget.enableInfiniteScroll ? null : widget.items.length,
227+
itemCount: widget.items.length == 1 ? widget.items.length : widget.enableInfiniteScroll ? null : widget.items.length,
228228
onPageChanged: (int index) {
229229
int currentPage;
230230
currentPage = _getRealIndex(index + widget.initialPage,

0 commit comments

Comments
 (0)