flutter_turtle 0.2.0+1 copy "flutter_turtle: ^0.2.0+1" to clipboard
flutter_turtle: ^0.2.0+1 copied to clipboard

outdated

flutter_turtle is a simple implementation of turtle graphic. It simply uses a custom painter to draw graphics into a widget by a series of Logo-like commands.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'pages/logo_page.dart';
import 'pages/star_page.dart';
import 'pages/tree_page.dart';

void main() => runApp(MyApp());

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

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: ListView(
        children: <Widget>[
          MyTile(title: 'Star', builder: (_) => StarPage()),
          MyTile(title: 'Logo', builder: (_) => LogoPage()),
          MyTile(title: 'Tree', builder: (_) => TreePage()),
        ],
      ),
    );
  }
}

class MyTile extends StatelessWidget {
  final String title;
  final WidgetBuilder builder;

  const MyTile({
    Key key,
    this.title,
    this.builder,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) => ListTile(
        title: Text(title),
        trailing: Icon(Icons.arrow_forward_ios),
        onTap: () {
          Navigator.of(context).push(MaterialPageRoute(builder: builder));
        },
      );
}
44
likes
0
pub points
51%
popularity

Publisher

verified publisherzonble.net

flutter_turtle is a simple implementation of turtle graphic. It simply uses a custom painter to draw graphics into a widget by a series of Logo-like commands.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_turtle