Skip to content

Commit bb8e118

Browse files
Merge branch 'master' into patch-3
2 parents 5db9829 + 2b2e20e commit bb8e118

File tree

15 files changed

+876
-34
lines changed

15 files changed

+876
-34
lines changed

example/lib/main_temp.dart

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
import 'package:flutter/cupertino.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter/widgets.dart';
4+
import 'package:getwidget/getwidget.dart';
5+
6+
final List<String> imageList = [
7+
'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg',
8+
'https://cdn.pixabay.com/photo/2017/12/13/00/23/christmas-3015776_960_720.jpg',
9+
'https://cdn.pixabay.com/photo/2019/12/19/10/55/christmas-market-4705877_960_720.jpg',
10+
'https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg',
11+
'https://cdn.pixabay.com/photo/2019/12/22/04/18/x-mas-4711785__340.jpg',
12+
'https://cdn.pixabay.com/photo/2016/11/22/07/09/spruce-1848543__340.jpg',
13+
'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg',
14+
'https://cdn.pixabay.com/photo/2017/12/13/00/23/christmas-3015776_960_720.jpg',
15+
];
16+
17+
void main() => runApp(MyApp());
18+
19+
class MyApp extends StatelessWidget {
20+
@override
21+
Widget build(BuildContext context) => MaterialApp(
22+
title: 'GetWidget Example',
23+
theme: ThemeData(
24+
primarySwatch: Colors.blue,
25+
),
26+
debugShowCheckedModeBanner: false,
27+
home: const MyHomePage(title: 'GetWidget Example'),
28+
);
29+
}
30+
31+
class MyHomePage extends StatefulWidget {
32+
const MyHomePage({Key key, this.title}) : super(key: key);
33+
34+
final String title;
35+
36+
@override
37+
_MyHomePageState createState() => _MyHomePageState();
38+
}
39+
40+
class _MyHomePageState extends State<MyHomePage>
41+
with SingleTickerProviderStateMixin {
42+
final _scaffoldKey = new GlobalKey<ScaffoldState>();
43+
TabController tabController;
44+
final _ratingController = TextEditingController();
45+
bool check = false;
46+
String searchData;
47+
final TextEditingController _searchController = TextEditingController();
48+
int groupValue = 0;
49+
final GFBottomSheetController _controller = GFBottomSheetController();
50+
double foo = 100.0;
51+
52+
@override
53+
void initState() {
54+
super.initState();
55+
_ratingController.text = '4.5';
56+
tabController = TabController(length: 6, initialIndex: 3, vsync: this);
57+
}
58+
59+
@override
60+
void dispose() {
61+
tabController.dispose();
62+
super.dispose();
63+
}
64+
65+
bool switchValue = true;
66+
bool showToast = false;
67+
68+
List list = [
69+
'Flutter',
70+
'React',
71+
'Ionic',
72+
'Xamarin',
73+
'Flutter2',
74+
'React2',
75+
'Ionic2',
76+
'Xamarin2',
77+
];
78+
79+
void _persistentBottomSheet() {
80+
_scaffoldKey.currentState.showBottomSheet((context) => Container(
81+
color: Colors.redAccent,
82+
height: 250,
83+
child: const Center(
84+
child: Text('Hey! guys , this is a persistent bottom sheet'),
85+
),
86+
));
87+
}
88+
89+
void _modalBottomSheetMenu() {
90+
showModalBottomSheet(
91+
context: context,
92+
elevation: 10,
93+
builder: (builder) => Container(
94+
height: 350,
95+
color: Colors.transparent,
96+
child: Container(
97+
decoration: const BoxDecoration(
98+
color: Colors.white,
99+
borderRadius: BorderRadius.only(
100+
topLeft: Radius.circular(10),
101+
topRight: Radius.circular(10))),
102+
child: const Center(
103+
child: Text('This is a modal sheet'),
104+
)),
105+
));
106+
}
107+
108+
@override
109+
Widget build(BuildContext context) => Scaffold(
110+
key: _scaffoldKey,
111+
appBar: GFAppBar(
112+
backgroundColor: Colors.blueGrey,
113+
title: const Text('UI Kit'),
114+
centerTitle: true,
115+
),
116+
body: SingleChildScrollView(
117+
child: Column(
118+
mainAxisAlignment: MainAxisAlignment.start,
119+
crossAxisAlignment: CrossAxisAlignment.center,
120+
children: [
121+
Container(
122+
height: 10,
123+
),
124+
Radio(
125+
value: 0,
126+
groupValue: groupValue,
127+
onChanged: (val) {
128+
setState(() {
129+
groupValue = val;
130+
});
131+
},
132+
),
133+
Radio(
134+
value: 1,
135+
groupValue: groupValue,
136+
onChanged: (val) {
137+
setState(() {
138+
groupValue = val;
139+
});
140+
},
141+
),
142+
// Expanded(child: SizedBox.expand(
143+
// child: DraggableScrollableSheet(
144+
// builder: (BuildContext context, ScrollController scrollController) => Container(
145+
// color: Colors.blue[100],
146+
// child: ListView.builder(
147+
// controller: scrollController,
148+
// itemCount: 25,
149+
// itemBuilder: (BuildContext context, int index) => ListTile(title: Text('Item $index')),
150+
// ),
151+
// ),
152+
// ),
153+
// ),)
154+
],
155+
),
156+
),
157+
bottomSheet: GFBottomSheet(
158+
controller: _controller,
159+
// minContentHeight: 100,
160+
maxContentHeight: 500,
161+
// elevation: 10,
162+
stickyHeader: Container(
163+
decoration: BoxDecoration(
164+
borderRadius: BorderRadius.circular(10),
165+
color: Colors.tealAccent),
166+
height: 50,
167+
child: const Center(
168+
child: Text('Swipe me!'),
169+
),
170+
),
171+
contentBody: Container(
172+
child: ListView(
173+
children: const [
174+
Text('fhj'),
175+
Text('fhj'),
176+
Text('fhj'),
177+
Text('fhj'),
178+
Text('fhj'),
179+
Text('fhj'),
180+
],
181+
),
182+
),
183+
stickyFooter: Container(
184+
color: Theme.of(context).primaryColor,
185+
height: 100,
186+
child: const Center(
187+
child: Text('I am Footer!'),
188+
),
189+
),
190+
stickyFooterHeight: 50,
191+
),
192+
floatingActionButton: FloatingActionButton(
193+
child: const Icon(Icons.stars),
194+
onPressed: () {
195+
// _persistentBottomSheet();
196+
// _modalBottomSheetMenu();
197+
_controller.isBottomSheetOpened
198+
? _controller.hideBottomSheet()
199+
: _controller.showBottomSheet();
200+
}),
201+
);
202+
}

example/pubspec.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

lib/components/accordian/gf_accordian.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ class _GFAccordionState extends State<GFAccordion>
9797
showAccordion = widget.showAccordion;
9898
animationController = AnimationController(
9999
duration: const Duration(seconds: 2),
100-
vsync: this,
101100
);
102101
controller = AnimationController(
103-
vsync: this,
104102
duration: const Duration(milliseconds: 300),
105103
);
106104
offset = Tween(

lib/components/alert/gf_alert.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
6868
void initState() {
6969
animationController = AnimationController(
7070
duration: const Duration(milliseconds: 300),
71-
vsync: this,
7271
);
7372
animation = CurvedAnimation(
7473
parent: animationController,

lib/components/animation/gf_animation.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ class _GFAnimationState extends State<GFAnimation>
118118
if (widget.type == GFAnimationType.rotateTransition) {
119119
controller = widget.controller ??
120120
AnimationController(
121-
duration: widget.duration ?? const Duration(seconds: 2),
122-
vsync: this);
121+
duration: widget.duration ?? const Duration(seconds: 2));
123122
animation = widget.turnsAnimation ??
124123
Tween<double>(begin: 0, end: 20).animate(controller);
125124
if (widget.turnsAnimation == null) {
@@ -128,7 +127,6 @@ class _GFAnimationState extends State<GFAnimation>
128127
} else if (widget.type == GFAnimationType.scaleTransition) {
129128
controller = widget.controller ??
130129
AnimationController(
131-
vsync: this,
132130
duration: widget.duration ?? const Duration(seconds: 2));
133131
animation = widget.scaleAnimation ??
134132
CurvedAnimation(
@@ -137,7 +135,6 @@ class _GFAnimationState extends State<GFAnimation>
137135
} else if (widget.type == GFAnimationType.slideTransition) {
138136
controller = AnimationController(
139137
duration: widget.duration ?? const Duration(seconds: 2),
140-
vsync: this,
141138
)..repeat(reverse: true);
142139
offsetAnimation = Tween<Offset>(
143140
begin: Offset.zero,

0 commit comments

Comments
 (0)