import 'package:flutter/material.dart';
import 'animationTest.dart';
import 'layoutTest.dart';

class MyApplicaitonTest extends StatefulWidget {
  @override
  _MyApplicaitonTestState createState() => _MyApplicaitonTestState();
}

class _MyApplicaitonTestState extends State<MyApplicaitonTest> {
  @override
  Widget build(BuildContext context) {
        return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: WidgetA(),
      routes: {
        "/layouttest": layoutTestPage,
      },
    );
  }

  Widget layoutTestPage(BuildContext context) {
    return LayoutTest();
  }
}

class WidgetA extends StatefulWidget {
  final Widget child;

  WidgetA({Key key, this.child}) : super(key: key);
  _WidgetAState createState() => _WidgetAState();
}

class _WidgetAState extends State<WidgetA> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
          appBar: AppBar(
            title: Text('text'),
          ),
          body: Container(
            padding: EdgeInsets.all(32.0),
            child: Center(
              child: Column(
                children: <Widget>[
                  Center(
                    child: FlatButton(
                      child: Text('hit me'),
                      onPressed: (){
                        Navigator.of(context).pushNamed("/layouttest");
                      },
                    ),
                  )
                ],
              ),
            ),
          ),
        );
    
  }
}