From b763e8895748ebd010596df74a9d5a251f49e7b4 Mon Sep 17 00:00:00 2001 From: Ricardo Dalarme Date: Thu, 12 Jan 2023 22:34:04 -0300 Subject: [PATCH] refactor(example): simplify the example --- example/lib/main.dart | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 95f1a89..6d47364 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -3,27 +3,14 @@ import 'package:flutter/material.dart'; import 'package:swipeable_cards_stack/swipeable_cards_stack.dart'; void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - } + runApp(const MaterialApp( + title: 'Flutter Demo', + home: const MyHomePage(), + )); } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key, required this.title}) : super(key: key); - final String title; + const MyHomePage({Key? key}) : super(key: key); @override State createState() => _MyHomePageState(); @@ -36,9 +23,6 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), body: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -68,8 +52,6 @@ class _MyHomePageState extends State { debugPrint('onDown ${(widget as CardView).text} $index'); } }, - enableSwipeUp: true, - enableSwipeDown: true, ), Container( margin: const EdgeInsets.symmetric(vertical: 20.0),