1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2025-11-08 20:50:04 +00:00

implementation of listwheelscrollview widget (#65)

This commit is contained in:
ralphcoder
2021-07-26 00:29:50 +05:30
committed by GitHub
parent ef8f5fd321
commit 4b66929f42
73 changed files with 1938 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'roundcontainer.dart';
class Listwheel extends StatefulWidget {
@override
_ListwheelState createState() => _ListwheelState();
}
class _ListwheelState extends State<Listwheel> {
double size = 28;
int radius = 8;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white70,
body: Container(
child: ListWheelScrollView(
children: [
NewWidget(
size: size,
l: Icon(
Icons.brush,
color: Colors.white54,
size: size,
),
s: 'Brush'),
NewWidget(
size: size,
l: Icon(
Icons.style,
color: Colors.white54,
size: size,
),
s: 'Style'),
NewWidget(
size: size,
l: Icon(
Icons.build,
color: Colors.white54,
size: size,
),
s: 'Build'),
NewWidget(
size: size,
l: Icon(
Icons.add,
color: Colors.white54,
size: size,
),
s: 'Add'),
NewWidget(
size: size,
l: Icon(
Icons.delete,
color: Colors.white54,
size: size,
),
s: 'Delete'),
NewWidget(
size: size,
l: Icon(
Icons.details,
color: Colors.white54,
size: size,
),
s: 'Details'),
NewWidget(
size: size,
l: Icon(
Icons.email,
color: Colors.white54,
size: size,
),
s: 'Email'),
],
squeeze: 1.0,
itemExtent: 180,
diameterRatio: 1.9,
offAxisFraction: -0.5,
),
),
);
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'listwheel.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: Color(0XFF0A0E21),
),
home: Listwheel(),
);
}
}

View File

@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
class NewWidget extends StatelessWidget {
final Widget l;
final String s;
double radius = 8;
NewWidget({this.size, this.l, this.s});
final double size;
@override
Widget build(BuildContext context) {
return AnimatedContainer(
duration: Duration(milliseconds: 1000),
curve: Curves.elasticInOut,
margin: EdgeInsets.symmetric(horizontal: 70, vertical: 20),
decoration: BoxDecoration(
color: Colors.black12,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [
BoxShadow(
offset: Offset(5, 5),
blurRadius: radius,
color: Color(0XFF585858).withOpacity(.3),
// color: Color(0XFF383838).withOpacity(.4),
),
],
),
child: Center(
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 25),
leading: l,
trailing: Text(
s,
style: TextStyle(
fontSize: 21,
color: Colors.white54,
fontWeight: FontWeight.w200),
),
),
),
);
}
}