Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material3 #51

Merged
merged 24 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "net.studymongolian.example"
minSdkVersion 16
targetSdkVersion 29
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -285,7 +285,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -366,7 +366,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -415,7 +415,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
225 changes: 153 additions & 72 deletions example/lib/demos/button_demo.dart
Original file line number Diff line number Diff line change
@@ -1,82 +1,163 @@
import 'package:flutter/material.dart';
import 'package:mongol/mongol.dart';

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

@override
State<ButtonDemo> createState() => _ButtonDemoState();
}

class _ButtonDemoState extends State<ButtonDemo> {
var _material3 = true;

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const Text('Buttons'),
return Theme(
data: ThemeData(
fontFamily: 'MenksoftQagan',
useMaterial3: _material3,
),
body: Center(
child: Column(
children: [
const SizedBox(height: 32),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MongolTextButton(
onPressed: () {
_showStackBar(context, 'MongolTextButton');
},
child: const MongolText('ᠨᠢᠭᠡ'),
),
const SizedBox(width: 16),
MongolOutlinedButton(
onPressed: () {
_showStackBar(context, 'MongolOutlinedButton');
},
child: const MongolText('ᠬᠣᠶᠠᠷ'),
),
const SizedBox(width: 16),
MongolElevatedButton(
onPressed: () {
_showStackBar(context, 'MongolElevatedButton');
},
child: const MongolText('ᠭᠤᠷᠪᠠ'),
),
],
),
const SizedBox(height: 32),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MongolTextButton.icon(
onPressed: () {
_showStackBar(context, 'MongolTextButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠨᠢᠭᠡ'),
),
const SizedBox(width: 16),
MongolOutlinedButton.icon(
onPressed: () {
_showStackBar(context, 'MongolOutlinedButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠬᠣᠶᠠᠷ'),
),
const SizedBox(width: 16),
MongolElevatedButton.icon(
onPressed: () {
_showStackBar(context, 'MongolElevatedButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠭᠤᠷᠪᠠ'),
),
const SizedBox(width: 16),
MongolIconButton(
onPressed: () {
_showStackBar(context, 'MongolIconButton');
},
icon: const Icon(Icons.local_florist),
mongolTooltip: 'ᠳᠦᠷᠪᠡ',
),
],
),
],
child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const Text('Buttons'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {
_material3 = !_material3;
});
},
child: const Icon(Icons.refresh),
),
body: Center(
child: Column(
children: [
const SizedBox(height: 32),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MongolTextButton(
onPressed: () {
_showStackBar(context, 'MongolTextButton');
},
child: const MongolText('ᠨᠢᠭᠡ'),
),
const SizedBox(width: 16),
MongolOutlinedButton(
onPressed: () {
_showStackBar(context, 'MongolOutlinedButton');
},
child: const MongolText('ᠬᠣᠶᠠᠷ'),
),
const SizedBox(width: 16),
MongolElevatedButton(
onPressed: () {
_showStackBar(context, 'MongolElevatedButton');
},
child: const MongolText('ᠭᠤᠷᠪᠠ'),
),
const SizedBox(width: 16),
MongolFilledButton(
onPressed: () {
_showStackBar(context, 'MongolFilledButton');
},
child: const MongolText('ᠳᠦᠷᠪᠡ'),
),
const SizedBox(width: 16),
MongolFilledButton.tonal(
onPressed: () {
_showStackBar(context, 'MongolFilledButton.tonal');
},
child: const MongolText('ᠲᠠᠪᠤ'),
),
],
),
const SizedBox(height: 32),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MongolTextButton.icon(
onPressed: () {
_showStackBar(context, 'MongolTextButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠨᠢᠭᠡ'),
),
const SizedBox(width: 16),
MongolOutlinedButton.icon(
onPressed: () {
_showStackBar(context, 'MongolOutlinedButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠬᠣᠶᠠᠷ'),
),
const SizedBox(width: 16),
MongolElevatedButton.icon(
onPressed: () {
_showStackBar(context, 'MongolElevatedButton.icon');
},
icon: const Icon(Icons.local_florist),
label: const MongolText('ᠭᠤᠷᠪᠠ'),
),
const SizedBox(width: 16),
MongolFilledButton.icon(
onPressed: () {
_showStackBar(context, 'MongolFilledButton.icon');
},
label: const MongolText('ᠳᠦᠷᠪᠡ'),
icon: const Icon(Icons.local_florist),
),
const SizedBox(width: 16),
MongolFilledButton.tonalIcon(
onPressed: () {
_showStackBar(context, 'MongolFilledButton.tonalIcon');
},
label: const MongolText('ᠲᠠᠪᠤ'),
icon: const Icon(Icons.local_florist),
),
],
),
const SizedBox(height: 32),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MongolIconButton(
onPressed: () {
_showStackBar(context, 'MongolIconButton');
},
icon: const Icon(Icons.local_florist),
tooltip: 'ᠨᠢᠭᠡ',
),
const SizedBox(width: 16),
MongolIconButton.filled(
onPressed: () {
_showStackBar(context, 'MongolIconButton.filled');
},
icon: const Icon(Icons.local_florist),
tooltip: 'ᠬᠣᠶᠠᠷ',
),
const SizedBox(width: 16),
MongolIconButton.filledTonal(
onPressed: () {
_showStackBar(context, 'MongolIconButton.filledTonal');
},
icon: const Icon(Icons.local_florist),
tooltip: 'ᠭᠤᠷᠪᠠ',
),
const SizedBox(width: 16),
MongolIconButton.outlined(
onPressed: () {
_showStackBar(context, 'MongolIconButton.outlined');
},
icon: const Icon(Icons.local_florist),
tooltip: 'ᠳᠦᠷᠪᠡ',
),
],
),
],
),
),
),
);
Expand Down
Loading