dotfield 2.0.0 dotfield: ^2.0.0 copied to clipboard
Create a field of dots. More awesome than it sounds!
import 'package:flutter/material.dart';
import 'package:dotfield/dotfield.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Dotfield Example App',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
debugShowCheckedModeBanner: false,
home: MyHomePage(title: 'Demo of the Dotfield package'),
);
}
}
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) {
// Disable top status bar
SystemChrome.setEnabledSystemUIOverlays([]);
return Scaffold(
backgroundColor: Colors.black87,
body: DotField(
size: MediaQuery.of(context).size,
density: 50,
maxLineLength: 40,
threshold: 20,
minSpeed: 10,
maxSpeed: 10,
),
);
}
}