Custom Widget

 import "package:flutter/material.dart";

import "package:practice/ui_helper/util.dart";
import "package:practice/widgets/rounded_button.dart";

void main()
{
runApp(const MyApp());
}

class MyApp extends StatelessWidget
{
const MyApp({super.key});

@override
Widget build(BuildContext context)
{
return MaterialApp(
title: "Hello",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blueGrey,
),
home: const FlutterApp(),
);
}
}

class FlutterApp extends StatefulWidget
{
const FlutterApp({super.key});

@override
State<StatefulWidget> createState()
{
return FlutterState();
}
}

class FlutterState extends State<FlutterApp>
{
@override
Widget build(BuildContext context)
{
return Scaffold(
drawer: const Drawer(),
appBar: AppBar(
title: const Text("Flutter Custom widget",
style: TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
backgroundColor: Colors.grey,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 150,
height: 70,
child: RoundedButton(
/*btnName: "Login",
icon: const Icon(Icons.lock),*/
btnName: "Play",
icon: const Icon(Icons.play_arrow),
callBack:(){
print("Logged in!!");
},
textStyle: mTextStyle16(),),
),
Container(height: 11),
SizedBox(
width: 150,
height: 70,
child: RoundedButton(
/*btnName: "Login",
icon: const Icon(Icons.lock),*/
btnName: "Press",
//icon: const Icon(Icons.play_arrow),
callBack:(){
print("Logged in!!");
},
bgColor: Colors.orange,
textStyle: mTextStyle30(),),
),
],
),
),
);
}
}

Comments

Popular posts from this blog

Pagination with Bloc Pattern in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter

Pagination First Practical in Flutter