ag_widgets 1.1.0 copy "ag_widgets: ^1.1.0" to clipboard
ag_widgets: ^1.1.0 copied to clipboard

Enhance your apps with our versatile smart widgets. Designed for daily development projects, they streamline workflows and boost functionality.

example/lib/main.dart

import 'dart:async';

import 'package:ag_widgets/ag_widgets.dart';
import 'package:ag_widgets/widgets/ag_tap_effect_widget.dart';
import 'package:flutter/material.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.

    if (!mounted) return;
  }

  Widget wrapThemeExpansionWidget({required List<Widget> children, required String title}) {
    return Theme(
      data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
      child: ExpansionTile(
        title: Text(title, style: TextStyle(fontSize: 18)),
        collapsedBackgroundColor: Colors.white,
        backgroundColor: Colors.grey[50],
        childrenPadding: EdgeInsets.all(16),
        children: children,
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('ag_widgets examples'),
          elevation: 2,
        ),
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              wrapThemeExpansionWidget(
                title: 'Ag Load Image Example',
                children: [
                  Wrap(
                    crossAxisAlignment: WrapCrossAlignment.start,
                    spacing: 16,
                    runSpacing: 16,
                    children: [
                      "assets/ic_add.png".agLoadImage(),
                      "assets/ic_terms.svg".agLoadImage(),
                      "https://www.svgrepo.com/show/67806/bar-chart.svg".agLoadImage(),
                      "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/Steps.svg".agLoadImage(),
                      "https://www.svgrepo.com/show/84654/folder.svg".agLoadImage(),
                      "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ-8yRs3oYczLKCWjJviSo0_BMXpK8yqzeXZg&s".agLoadImage(),
                    ],
                  )
                ],
              ),
              wrapThemeExpansionWidget(
                title: "Custom Divider Example",
                children: [
                  AgCustomDividerWidget(style: DividerStyle.dottedLine, weight: 1),
                  SizedBox(height: 20),
                  AgCustomDividerWidget(style: DividerStyle.gradientLine, weight: 1),
                  SizedBox(height: 20),
                  AgCustomDividerWidget(style: DividerStyle.plainLine, weight: 1),
                  SizedBox(height: 20),
                  AgCustomDividerWidget(style: DividerStyle.gradientDottedLine, weight: 1),
                ],
              ),
              wrapThemeExpansionWidget(
                title: 'Ag Tap Widget',
                children: [
                  AgTapEffect(
                    child: Container(
                      padding: EdgeInsets.all(16),
                      decoration: BoxDecoration(color: Colors.blueAccent, borderRadius: BorderRadius.circular(16)),
                      child: Text('Tap Me', style: TextStyle(fontSize: 18, color: Colors.white)),
                    ),
                  )
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
150
points
66
downloads

Publisher

verified publisherankitgada.in

Weekly Downloads

Enhance your apps with our versatile smart widgets. Designed for daily development projects, they streamline workflows and boost functionality.

Homepage
Repository (GitHub)
View/report issues

Topics

#widget #customization #extensions

Documentation

API reference

License

MIT (license)

Dependencies

extended_image, flutter, flutter_svg, flutter_web_plugins, nb_utils, plugin_platform_interface, web

More

Packages that depend on ag_widgets