yaru_widgets 2.0.0-beta-3 yaru_widgets: ^2.0.0-beta-3 copied to clipboard
Common flutter widgets useful for building desktop and web applications.
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:ubuntu_service/ubuntu_service.dart';
import 'package:yaru/yaru.dart';
import 'example.dart';
import 'theme.dart';
void main() {
registerService<Connectivity>(Connectivity.new);
runApp(
MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => LightTheme(yaruLight)),
ChangeNotifierProvider(create: (_) => DarkTheme(yaruDark)),
],
child: const Home(),
),
);
}
class Home extends StatelessWidget {
const Home({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Yaru Widgets Factory',
debugShowCheckedModeBanner: false,
theme: context.watch<LightTheme>().value,
darkTheme: context.watch<DarkTheme>().value,
home: Example.create(context),
);
}
}