Skip to content

Commit f10df4e

Browse files
committed
floating toggle done
1 parent 376bc80 commit f10df4e

3 files changed

Lines changed: 25 additions & 15 deletions

File tree

example/lib/main.dart

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,20 @@ class _MyHomePageState extends State<MyHomePage> {
9090
GFFloatingWidget(
9191
// horizontalPosition: screenHeight * 0.1,
9292
// verticalPosition: screenWidth* 0.2,
93-
//child: GFToast(
94-
// text: 'hello',
95-
//),
96-
child: GFToggle(onChanged: null, value: null,
97-
type: GFToggleType.ios,
98-
),
93+
child: GFToast(
94+
backgroundColor: GFColor.warning,
95+
96+
button: GFButton(
97+
type: GFType.outline,
98+
text: 'CLICK',
99+
onPressed: null,
100+
// position: GFPosition.end,
101+
),
102+
text: 'Marked as Favorite ',
103+
),
104+
// child: GFToggle(onChanged: null, value: null,
105+
// type: GFToggleType.ios,
106+
// ),
99107
body: SingleChildScrollView(
100108
child:
101109

@@ -182,10 +190,7 @@ class _MyHomePageState extends State<MyHomePage> {
182190
duration: Duration(milliseconds: 400),
183191
),
184192
// text: 'hjkk',
185-
child: GFHeader(
186-
text: 'GFHEADER inside GFTOAST ',
187-
type: GFHeadingType.typo5,
188-
),
193+
text: 'who hbdi h nedj bdj vcej vcbejb yhjycen bcekj bcen bdjn bcenk jhcnekj',
189194
),
190195
),
191196

@@ -200,7 +205,7 @@ class _MyHomePageState extends State<MyHomePage> {
200205
onPressed: null,
201206
// position: GFPosition.end,
202207
),
203-
text: 'Marked as Favorite ',
208+
text: 'Marked',
204209
),
205210
),
206211
Container(

lib/components/toast/gf_floating_widget.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ class _GFFloatingWidgetState extends State<GFFloatingWidget> {
5151
left: widget.verticalPosition != null ? widget.verticalPosition : 0,
5252

5353
// top:20,
54-
child: widget.child ?? Container()
54+
child: Container(
55+
height: 60,
56+
width: MediaQuery.of(context).size.width,
57+
child: widget.child ?? Container(),
58+
)
5559
),
5660

5761

lib/components/toast/gf_toast.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter/widgets.dart';
23
import 'package:ui_kit/colors/gf_color.dart';
34

45
class GFToast extends StatelessWidget {
@@ -31,15 +32,14 @@ class GFToast extends StatelessWidget {
3132
@override
3233
Widget build(BuildContext context) {
3334
return
34-
ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0,), child: Container(
35+
ConstrainedBox(constraints: BoxConstraints(minHeight: 50.0, minWidth: 340), child: Container(
3536
margin: EdgeInsets.only(left: 10, right: 10),
3637
padding: EdgeInsets.all(10),
3738
decoration: BoxDecoration(
3839
borderRadius: BorderRadius.all(Radius.circular(3)),
3940
color: backgroundColor!=null ?getGFColor(backgroundColor):Color(0xff323232),
4041
),
4142
child: Row(
42-
// mainAxisAlignment: MainAxisAlignment.end,
4343
children: <Widget>[
4444
Flexible(
4545
flex: 7,
@@ -54,7 +54,8 @@ class GFToast extends StatelessWidget {
5454
child: Align(
5555
alignment: Alignment.topRight,
5656
child: button,
57-
)):Container()
57+
)
58+
):Container()
5859
],
5960
),
6061
),);

0 commit comments

Comments
 (0)