Skip to content

Commit

Permalink
example about size
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed May 16, 2024
1 parent da9ce8b commit b1fc0b6
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ void main() {
runApp(const App());
}

class App extends StatelessWidget {
class App extends StatefulWidget {
const App({super.key});

@override
State<App> createState() => _AppState();
}

class _AppState extends State<App> {
late var _height = MediaQuery.of(context).size.height;

@override
Widget build(BuildContext context) => 'app root'
.textWidget
.text(align: TextAlign.center)
.modifyTextStyle(
context,
(raw) => raw.copyWith(
color: const Color(0xfffefdfa),
fontSize: _height / 6.18,
fontWeight: FontWeight.w900,
),
)
.wrapPadding(const EdgeInsets.all(75))
.wrapCenter
.wrap((context, child) => child.wrapFontSize(context, 50))
.wrapForeground(context, const Color(0xffdedcda))
.wrapBackground(const Color(0xff804044))
.listenSizeChange(this, (size) => _height = size.height)
.ensureTextEnvironment(context);
}

0 comments on commit b1fc0b6

Please sign in to comment.