devkit 0.0.4 devkit: ^0.0.4 copied to clipboard
Devkit is a collection of widgets developed by flutter, You can unify styles and generate widgets with the same style, just like using CSS syntax.
import 'package:devkit/devkit.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
DButtonWidget(
text: 'Sign up with Email',
width: 300,
iconData: Icons.assignment_ind,
type: ButtonType.outline,
// bgColor: const Color(0xffffffff),
color: const Color(0xfffe7a1f),
// borderColor: const Color(0xfffe7a1f),
borderRadius: 10,
clickCallBack: () {
debugPrint('click');
},
),
DButtonWidget(
text: 'Sign up with Email',
width: 300,
iconData: Icons.assignment_ind,
type: ButtonType.round,
// bgColor: const Color(0xfffe7a1f).withOpacity(0.1),
color: const Color(0xfffe7a1f),
// borderRadius: 25,
borderWidth: 1,
borderColor: const Color(0xfffe7a1f),
clickCallBack: () {
debugPrint('click');
},
),
DButtonWidget(
text: 'Sign up with Email',
width: 260,
iconData: Icons.flight_takeoff,
backgroundColor: const Color(0xfffe7a1f),
borderRadius: 20,
color: const Color(0xffffffff),
clickCallBack: () {
debugPrint('click');
},
),
DButtonWidget(
type: ButtonType.circle,
width: 60,
iconData: Icons.flight_takeoff,
backgroundColor: const Color(0xfffe7a1f),
borderRadius: 20,
color: const Color(0xffffffff),
clickCallBack: () {
debugPrint('click');
},
),
DButtonWidget(
type: ButtonType.circleOutline,
width: 60,
iconData: Icons.search,
// bgColor: const Color(0xffffffff),
color: const Color(0xfffe7a1f),
// borderWidth: 1,
// borderColor: Colors.transparent,
borderColor: const Color(0xfffe7a1f),
clickCallBack: () {
debugPrint('click');
},
),
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}