flutter_androssy 0.1.7-alpha2 copy "flutter_androssy: ^0.1.7-alpha2" to clipboard
flutter_androssy: ^0.1.7-alpha2 copied to clipboard

outdated

Collection of service with advanced style and controlling system.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_androssy/widgets.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Androssy',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const Example(),
    );
  }
}

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

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  ButtonController button = ButtonController();
  TextViewController textController = TextViewController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("TextView"),
      ),
      body: LinearLayout(
        padding: 24,
        scrollable: true,
        paddingBottom: 40,
        children: [
          EditForm(
            marginTop: 24,
            onValid: button.setEnabled,
            children: [
              EditText(
                marginTop: 24,
                id: "email",
                hint: "Email",
                inputType: TextInputType.emailAddress,
                background: context.primaryColor.withAlpha(50),
                paddingHorizontal: 24,
                paddingVertical: 0,
                borderRadius: 12,
                onValidator: (v) {
                  return v.contains("a");
                },
              ),
              EditText(
                marginTop: 24,
                id: "password",
                hint: "Password",
                inputType: TextInputType.datetime,
                onValidator: (v) {
                  return v.contains("1");
                },
              ),
            ],
          ),
          MaterialEditForm(
            marginTop: 24,
            onValid: button.setEnabled,
            children: [
              MaterialEditText(
                marginTop: 24,
                id: "email",
                autoFocus: true,
                primary: Colors.blue,
                hint: "Email",
                drawablePadding: 24,
                maxCharacters: 15,
                minCharacters: 10,
                counterVisible: true,
                helperText: "abc@gmail.com",
                textSize: 18,
                floatingLabelVisible: true,
                inputType: TextInputType.emailAddress,
                onValidator: (v) {
                  return v.contains("abc@gmail.com");
                },
                onError: (v) {
                  return v.isEmpty ? "" : "Not matched by abc@gmail.com";
                },
              ),
              MaterialEditText(
                marginTop: 24,
                id: "password",
                autoFocus: true,
                counterVisible: true,
                primary: Colors.blue,
                hint: "Password",
                drawablePadding: 24,
                textSize: 18,
                floatingLabelVisible: true,
                inputType: TextInputType.visiblePassword,
                onValidator: (v) {
                  return v.contains("123456");
                },
                onError: (v) {
                  return v.isEmpty ? "" : "Not matched by 123456";
                },
              ),
            ],
          ),
          Button(
            width: double.infinity,
            marginTop: 24,
            controller: button,
            text: "Sign in",
            enabled: false,
            onClick: (context) {},
          ),
        ],
      ),
    );
  }
}
5
likes
0
points
248
downloads

Publisher

unverified uploader

Weekly Downloads

Collection of service with advanced style and controlling system.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

badges, cached_network_image, flutter, flutter_svg

More

Packages that depend on flutter_androssy