Google UI is Flutter open-source UI library using Material Design 2.0 with many pre-built widgets to make Flutter development easier and faster.
To use this package as a library, pub.dev
Google UI use Poppins as main font family.
import 'package:google_ui/google_ui.dart';
...
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Google UI',
theme: GoogleThemeGenerator.generate(),
darkTheme: GoogleThemeGenerator.generateDark(),
home: const HomePage(),
);
}
}
All Google UI class has Google prefix e.g GoogleButton
fonts:
- family: Poppins
fonts:
- asset: fonts/Poppins/Poppins-Light.ttf
- asset: fonts/Poppins/Poppins-LightItalic.ttf
weight: 300
- asset: fonts/Poppins/Poppins-Regular.ttf
- asset: fonts/Poppins/Poppins-Italic.ttf
weight: 400
- asset: fonts/Poppins/Poppins-Medium.ttf
- asset: fonts/Poppins/Poppins-MediumItalic.ttf
weight: 500
Run this command:
With Flutter:
$ flutter pub add google_ui
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
google_ui: ^1.3.0
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:google_ui/google_ui.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'app.dart';
void main() {
runApp(ProviderScope(child: App()));
}