cosmos 0.3.3 cosmos: ^0.3.3 copied to clipboard
Thanks to this package, which brings together the challenging materials created as a result of the efforts of many developers, no application will make you struggle with lines of code!
import 'package:cosmos/cosmos.dart';
import 'package:flutter/material.dart';
void main() => runApp(const CosmosExample());
class CosmosExample extends StatelessWidget {
const CosmosExample({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Cosmos Example App',
home: Scaffold(
backgroundColor: Colors.black,
body: CosmosSideMenu.builder(
sideMenu: CosmosSideMenu.sideMenu(
backgroundColor: const Color.fromARGB(255, 23, 23, 23),
children: [
const SizedBox(height: 20),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Back",
width: double.infinity,
onTap: () {
CosmosSideMenu.closeSideMenu();
},
),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Border Button",
width: double.infinity,
onTap: () {},
),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Border Button",
width: double.infinity,
onTap: () {},
),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Border Button",
width: double.infinity,
onTap: () {},
),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Border Button",
width: double.infinity,
onTap: () {},
),
CosmosButton.borderButton(
margin: const EdgeInsets.symmetric(horizontal: 10),
text: "Border Button",
width: double.infinity,
onTap: () {},
),
const SizedBox(height: 20),
],
),
home: CosmosBody(
scrollable: true,
scrollDirection: Axis.vertical,
children: [
CosmosTopBar(
logo: const Text(
"Cosmos!",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white,
),
),
leftIcon: Icons.menu,
rightIcon: Icons.whatshot,
children: [
CosmosButton.button(
text: "Classic Button",
onTap: () {},
),
CosmosButton.borderButton(
text: "Border Button",
onTap: () {},
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 10),
width: 2,
height: 20,
color: Colors.white,
),
CosmosButton.iconButton(
icon: Icons.link,
uri: "https://bybug.net",
),
CosmosButton.iconButton(
icon: Icons.menu,
onTap: () {
CosmosSideMenu.openSideMenu();
},
),
CosmosButton.iconButton(
icon: Icons.person,
uri: "https://bybug.net",
),
],
),
],
),
),
),
);
}
}