Skip to content

Instantly share code, notes, and snippets.

@rrousselGit
Created August 28, 2019 13:30
Show Gist options
  • Save rrousselGit/931b0475eeb074dbddbeb47525262dac to your computer and use it in GitHub Desktop.
Save rrousselGit/931b0475eeb074dbddbeb47525262dac to your computer and use it in GitHub Desktop.
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Transform.translate(
offset: Offset(100, 0),
child: Transform.rotate(
angle: 1,
child: BlueBox(),
),
);
}
}
class BlueBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.blue,
border: Border.all(),
),
);
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.ltr,
child: Container(
color: Color(0xffeeeeee),
child: Center(
child: Container(
child: MyWidget(),
color: Color(0xffcccccc),
),
),
),
);
}
}
Future<void> main() async {
await ui.webOnlyInitializePlatform();
runApp(MyApp());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment