Skip to content

fancy_gradient_cards: ^ 0.0.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@Arun100203 Arun100203 released this 06 Mar 10:18
· 2 commits to main since this release
7bfdcc2

with this new release, you can:

  • Specify Gradient color using the color1 and color2 property.
  • You can modify height, width, title, subtitle, image.
  • And you can modify image properties inside Image Widget.
  • onTap function is used for specifying functions.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:fancy_gradient_card/fancy_gradient_card.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  void _incrementCounter() {
    if (kDebugMode) {
      print('Card Pressed');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(

        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[

            FancyGradientCard(
              image: 'https://docs.flutter.dev/assets/images/dash/early-dash-sketches5.jpg',
              title: 'Dash!...',
              color2: Colors.blue,
              color1: Colors.purpleAccent,
              subtitle: 'he was fluttering people\'s using flutter',
              width: 280,
              height: 400,
              textColor: Colors.black,
              subtitleColor: Colors.black,
              onTap: _incrementCounter,
              padding: const EdgeInsets.all(1.0),
              titleStyle: const TextStyle(
                  fontSize: 32
              ),
              subtitleStyle: const TextStyle(
                  fontSize: 15
              ),
            )
          ],
        ),
      ),
    );
  }

}

flutter_dash