hello_world_lib 1.0.0
hello_world_lib: ^1.0.0 copied to clipboard
A simple Hello World library for Flutter
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:hello_world_lib/hello_world_lib.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hello World Lib Example',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Hello World Library Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
HelloWorldWidget(),
SizedBox(height: 20),
HelloWorldWidget(
name: 'Flutter Developer',
textStyle: TextStyle(fontSize: 20, color: Colors.blue),
),
SizedBox(height: 20),
HelloWorldWidget(
name: 'World',
showTime: true,
textStyle: TextStyle(fontSize: 18, color: Colors.green),
),
],
),
),
);
}
}