design 0.0.2 copy "design: ^0.0.2" to clipboard
design: ^0.0.2 copied to clipboard

Flutter App Design System

example/lib/main.dart

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.lightGreen,
      ),
      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),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
2
likes
0
pub points
58%
popularity

Publisher

verified publisherlab.mobi

Flutter App Design System

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on design