design 0.0.1 design: ^0.0.1 copied to clipboard
Flutter App Design System
import 'package:design/app_primary_button.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Design System Example',
theme: ThemeData(
primarySwatch: Colors.amber,
),
home: const MyHomePage(title: 'Design System Example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Stack(
alignment: Alignment.bottomCenter,
fit: StackFit.expand,
children: [
Padding(
padding: const EdgeInsets.only(left: 16, right: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
AppPrimaryButton(
"Primary - enabled",
minimumSize: const Size(double.infinity, 48),
backgroundColor: const Color(0xFF0B0020),
disabledBackgroundColor: const Color(0xFFCFCED8),
textStyle: const TextStyle(
fontSize: 16,
color: Color(0xFFFFFFFF),
),
onPressed: () {
Fluttertoast.showToast(
msg: 'You pressed on "Primary - enabled',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.black,
textColor: Colors.white,
fontSize: 16,
);
},
),
const SizedBox(height: 12),
AppPrimaryButton(
"Primary - disabled",
disabledBackgroundColor: Colors.blue.shade100,
minimumSize: const Size(double.infinity, 48),
),
const SizedBox(height: 24),
],
),
),
],
),
);
}
}